LEFT | RIGHT |
1 /* | 1 /* |
2 * $Id$ | |
3 * | |
4 * ***** BEGIN GPL LICENSE BLOCK ***** | 2 * ***** BEGIN GPL LICENSE BLOCK ***** |
5 * | 3 * |
6 * This shader is free software; you can redistribute it and/or | 4 * This program is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU General Public License | 5 * modify it under the terms of the GNU General Public License |
8 * as published by the Free Software Foundation; either version 2 | 6 * as published by the Free Software Foundation; either version 2 |
9 * of the License, or (at your option) any later version. The Blender | 7 * of the License, or (at your option) any later version. |
10 * Foundation also sells licenses for use in proprietary software under | |
11 * the Blender License. See http://www.blender.org/BL/ for information | |
12 * about this. | |
13 * | 8 * |
14 * This shader is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
17 * GNU General Public License for more details. | 12 * GNU General Public License for more details. |
18 * | 13 * |
19 * You should have received a copy of the GNU General Public License | 14 * You should have received a copy of the GNU General Public License |
20 * along with this shader; if not, write to the Free Software Foundation, | 15 * along with this program; if not, write to the Free Software Foundation, |
21 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 16 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
22 * | 17 * |
23 * The Original Code is Copyright (C) 2005 Blender Foundation. | 18 * The Original Code is Copyright (C) 2005 Blender Foundation. |
24 * All rights reserved. | 19 * All rights reserved. |
25 * | 20 * |
26 * The Original Code is: all of this file. | 21 * The Original Code is: all of this file. |
27 * | 22 * |
28 * Contributor(s): Brecht Van Lommel. | 23 * Contributor(s): Brecht Van Lommel. |
29 * | 24 * |
30 * ***** END GPL LICENSE BLOCK ***** | 25 * ***** END GPL LICENSE BLOCK ***** |
31 */ | 26 */ |
32 | 27 |
33 /** \file GPU_draw.h | 28 /** \file GPU_draw.h |
34 * \ingroup gpu | 29 * \ingroup gpu |
35 */ | 30 */ |
36 | 31 |
37 #ifndef GPU_GAME_H | 32 #ifndef __GPU_DRAW_H__ |
38 #define GPU_GAME_H | 33 #define __GPU_DRAW_H__ |
39 | 34 |
40 #ifdef __cplusplus | 35 #ifdef __cplusplus |
41 extern "C" { | 36 extern "C" { |
42 #endif | 37 #endif |
43 | 38 |
44 struct Image; | 39 struct Image; |
45 struct ImageUser; | 40 struct ImageUser; |
46 struct MTFace; | 41 struct MTFace; |
47 struct Object; | 42 struct Object; |
48 struct Scene; | 43 struct Scene; |
(...skipping 18 matching lines...) Expand all Loading... |
67 void GPU_state_print(void); | 62 void GPU_state_print(void); |
68 | 63 |
69 /* Material drawing | 64 /* Material drawing |
70 * - first the state is initialized by a particular object and | 65 * - first the state is initialized by a particular object and |
71 * it's materials | 66 * it's materials |
72 * - after this, materials can be quickly enabled by their number, | 67 * - after this, materials can be quickly enabled by their number, |
73 * GPU_enable_material returns 0 if drawing should be skipped | 68 * GPU_enable_material returns 0 if drawing should be skipped |
74 * - after drawing, the material must be disabled again */ | 69 * - after drawing, the material must be disabled again */ |
75 | 70 |
76 void GPU_begin_object_materials(struct View3D *v3d, struct RegionView3D *rv3d,· | 71 void GPU_begin_object_materials(struct View3D *v3d, struct RegionView3D *rv3d,· |
77 » struct Scene *scene, struct Object *ob, int glsl, int *do_alpha_pass); | 72 struct Scene *scene, struct Object *ob, bool gls
l, bool *do_alpha_after); |
78 void GPU_end_object_materials(void); | 73 void GPU_end_object_materials(void); |
| 74 |
| 75 int GPU_enable_material(int nr, void *attribs); |
| 76 void GPU_disable_material(void); |
| 77 |
| 78 void GPU_material_diffuse_get(int nr, float diff[4]); |
79 | 79 |
80 int GPU_enable_material(int nr, void *attribs); | 80 int GPU_enable_material(int nr, void *attribs); |
81 void GPU_disable_material(void); | 81 void GPU_disable_material(void); |
82 | 82 |
83 void GPU_set_material_blend_mode(int blendmode); | 83 void GPU_set_material_blend_mode(int blendmode); |
84 int GPU_get_material_blend_mode(void); | 84 int GPU_get_material_blend_mode(void); |
85 | 85 |
86 /* TexFace drawing | 86 /* TexFace drawing |
87 * - this is mutually exclusive with material drawing, a mesh should | 87 * - this is mutually exclusive with material drawing, a mesh should |
88 * be drawn using one or the other | 88 * be drawn using one or the other |
89 * - passing NULL clears the state again */ | 89 * - passing NULL clears the state again */ |
90 | 90 |
91 int GPU_set_tpage(struct MTFace *tface, int mipmap, int transp); | 91 int GPU_set_tpage(struct MTFace *tface, int mipmap); |
92 | 92 |
93 /* Lights | 93 /* Lights |
94 * - returns how many lights were enabled | 94 * - returns how many lights were enabled |
95 * - this affects fixed functions materials and texface, not glsl */ | |
96 | |
97 int GPU_default_lights(void); | |
98 int GPU_scene_object_lights(struct Scene *scene, struct Object *ob, | |
99 int lay, float viewmat[][4], int ortho); | |
100 | |
101 /* Text render | |
102 * - based on moving uv coordinates */ | |
103 | |
104 void GPU_render_text(struct MTFace *tface, int mode, | |
105 const char *textstr, int textlen, unsigned int *col, | |
106 float *v1, float *v2, float *v3, float *v4, int glattrib); | |
107 | |
108 /* Mipmap settings | |
109 * - these will free textures on changes */ | |
110 | |
111 void GPU_set_mipmap(int mipmap); | |
112 void GPU_set_linear_mipmap(int linear); | |
113 void GPU_paint_set_mipmap(int mipmap); | |
114 | |
115 /* Image updates and free | |
116 * - these deal with images bound as opengl textures */ | |
117 | |
118 void GPU_paint_update_image(struct Image *ima, int x, int y, int w, int h, int m
ipmap); | |
119 void GPU_update_images_framechange(void); | |
120 int GPU_update_image_time(struct Image *ima, double time); | |
121 int GPU_verify_image(struct Image *ima, struct ImageUser *iuser, int tftile, int
compare, int mipmap); | |
122 void GPU_free_image(struct Image *ima); | |
123 void GPU_free_images(void); | |
124 void GPU_free_images_anim(void); | |
125 | |
126 /* smoke drawing functions */ | |
127 void GPU_free_smoke(struct SmokeModifierData *smd); | |
128 void GPU_create_smoke(struct SmokeModifierData *smd, int highres); | |
129 | |
130 /* Delayed free of OpenGL buffers by main thread */ | |
131 void GPU_free_unused_buffers(void); | |
132 | |
133 #ifdef __cplusplus | |
134 } | |
135 #endif | |
136 | |
137 #endif | |
138 | |
LEFT | RIGHT |