LEFT | RIGHT |
1 /* | 1 /* |
| 2 * $Id$ |
| 3 * |
2 * ***** BEGIN GPL LICENSE BLOCK ***** | 4 * ***** BEGIN GPL LICENSE BLOCK ***** |
3 * | 5 * |
4 * This program is free software; you can redistribute it and/or | 6 * This program is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU General Public License | 7 * modify it under the terms of the GNU General Public License |
6 * as published by the Free Software Foundation; either version 2 | 8 * as published by the Free Software Foundation; either version 2 |
7 * of the License, or (at your option) any later version. | 9 * of the License, or (at your option) any later version. The Blender |
| 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. |
8 * | 13 * |
9 * This program is distributed in the hope that it will be useful, | 14 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 * GNU General Public License for more details. | 17 * GNU General Public License for more details. |
13 * | 18 * |
14 * You should have received a copy of the GNU General Public License | 19 * You should have received a copy of the GNU General Public License |
15 * along with this program; if not, write to the Free Software Foundation, | 20 * along with this program; if not, write to the Free Software Foundation, |
16 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 21 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
17 * | 22 * |
18 * The Original Code is Copyright (C) 2005 Blender Foundation. | 23 * The Original Code is Copyright (C) 2005 Blender Foundation. |
19 * All rights reserved. | 24 * All rights reserved. |
20 * | 25 * |
21 * The Original Code is: all of this file. | 26 * The Original Code is: all of this file. |
22 * | 27 * |
23 * Contributor(s): Brecht Van Lommel. | 28 * Contributor(s): Brecht Van Lommel. |
24 * | 29 * |
25 * ***** END GPL LICENSE BLOCK ***** | 30 * ***** END GPL LICENSE BLOCK ***** |
26 */ | 31 */ |
27 | 32 |
28 /** \file blender/gpu/intern/gpu_draw.c | 33 /** \file blender/gpu/intern/gpu_draw.c |
29 * \ingroup gpu | 34 * \ingroup gpu |
30 */ | 35 */ |
31 | 36 |
32 | 37 |
33 #include <string.h> | 38 #include <string.h> |
34 | 39 |
35 #include "GL/glew.h" | 40 #include "GL/glew.h" |
36 | 41 |
37 #include "BLI_blenlib.h" | |
38 #include "BLI_linklist.h" | |
39 #include "BLI_math.h" | 42 #include "BLI_math.h" |
40 #include "BLI_threads.h" | |
41 #include "BLI_utildefines.h" | 43 #include "BLI_utildefines.h" |
42 | 44 |
43 #include "DNA_lamp_types.h" | 45 #include "DNA_lamp_types.h" |
44 #include "DNA_material_types.h" | 46 #include "DNA_material_types.h" |
45 #include "DNA_meshdata_types.h" | 47 #include "DNA_meshdata_types.h" |
46 #include "DNA_modifier_types.h" | 48 #include "DNA_modifier_types.h" |
47 #include "DNA_node_types.h" | 49 #include "DNA_node_types.h" |
48 #include "DNA_object_types.h" | 50 #include "DNA_object_types.h" |
49 #include "DNA_scene_types.h" | 51 #include "DNA_scene_types.h" |
50 #include "DNA_smoke_types.h" | 52 #include "DNA_smoke_types.h" |
51 #include "DNA_view3d_types.h" | 53 #include "DNA_view3d_types.h" |
52 | 54 |
53 #include "MEM_guardedalloc.h" | 55 #include "MEM_guardedalloc.h" |
54 | 56 |
55 #include "IMB_imbuf.h" | 57 #include "IMB_imbuf.h" |
56 #include "IMB_imbuf_types.h" | 58 #include "IMB_imbuf_types.h" |
57 | 59 |
58 #include "BKE_bmfont.h" | 60 #include "BKE_bmfont.h" |
59 #include "BKE_global.h" | 61 #include "BKE_global.h" |
60 #include "BKE_image.h" | 62 #include "BKE_image.h" |
61 #include "BKE_main.h" | 63 #include "BKE_main.h" |
62 #include "BKE_material.h" | 64 #include "BKE_material.h" |
63 #include "BKE_node.h" | 65 #include "BKE_node.h" |
64 #include "BKE_object.h" | 66 #include "BKE_object.h" |
65 #include "BKE_scene.h" | 67 |
66 #include "BKE_DerivedMesh.h" | 68 |
| 69 #include "BLI_threads.h" |
| 70 #include "BLI_blenlib.h" |
67 | 71 |
68 #include "GPU_buffers.h" | 72 #include "GPU_buffers.h" |
69 #include "GPU_draw.h" | 73 #include "GPU_draw.h" |
70 #include "GPU_extensions.h" | 74 #include "GPU_extensions.h" |
71 #include "GPU_material.h" | 75 #include "GPU_material.h" |
72 | 76 |
73 #include "smoke_API.h" | 77 #include "smoke_API.h" |
74 | 78 |
75 extern Material defmaterial; /* from material.c */ | 79 extern Material defmaterial; /* from material.c */ |
76 | 80 |
77 /* These are some obscure rendering functions shared between the | 81 /* These are some obscure rendering functions shared between the |
78 * game engine and the blender, in this module to avoid duplicaten | 82 * game engine and the blender, in this module to avoid duplicaten |
79 * and abstract them away from the rest a bit */ | 83 * and abstract them away from the rest a bit */ |
80 | 84 |
81 /* Text Rendering */ | 85 /* Text Rendering */ |
82 | 86 |
83 static void gpu_mcol(unsigned int ucol) | 87 static void gpu_mcol(unsigned int ucol) |
84 { | 88 { |
85 /* mcol order is swapped */ | 89 /* mcol order is swapped */ |
86 char *cp= (char *)&ucol; | 90 char *cp= (char *)&ucol; |
87 glColor3ub(cp[3], cp[2], cp[1]); | 91 glColor3ub(cp[3], cp[2], cp[1]); |
88 } | 92 } |
89 | 93 |
90 void GPU_render_text(MTFace *tface, int mode, | 94 void GPU_render_text(MTFace *tface, int mode, |
91 const char *textstr, int textlen, unsigned int *col, | 95 const char *textstr, int textlen, unsigned int *col, |
92 float *v1, float *v2, float *v3, float *v4, int glattrib) | 96 float *v1, float *v2, float *v3, float *v4, int glattrib) |
93 { | 97 { |
94 if ((mode & GEMAT_TEXT) && (textlen>0) && tface->tpage) { | |
95 const char *textstr, int textlen, unsigned int *col, | |
96 float *v1, float *v2, float *v3, float *v4, int glattrib) | |
97 { | |
98 if ((mode & TF_BMFONT) && (textlen>0) && tface->tpage) { | 98 if ((mode & TF_BMFONT) && (textlen>0) && tface->tpage) { |
99 Image* ima = (Image*)tface->tpage; | 99 Image* ima = (Image*)tface->tpage; |
100 int index, character; | 100 int index, character; |
101 float centerx, centery, sizex, sizey, transx, transy, movex, mov
ey, advance; | 101 float centerx, centery, sizex, sizey, transx, transy, movex, mov
ey, advance; |
LEFT | RIGHT |