|
Blender
V2.59
|
00001 /* 00002 * $Id: GPU_draw.h 37521 2011-06-15 18:59:22Z moguri $ 00003 * 00004 * ***** BEGIN GPL LICENSE BLOCK ***** 00005 * 00006 * This shader is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU General Public License 00008 * as published by the Free Software Foundation; either version 2 00009 * of the License, or (at your option) any later version. The Blender 00010 * Foundation also sells licenses for use in proprietary software under 00011 * the Blender License. See http://www.blender.org/BL/ for information 00012 * about this. 00013 * 00014 * This shader is distributed in the hope that it will be useful, 00015 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00017 * GNU General Public License for more details. 00018 * 00019 * You should have received a copy of the GNU General Public License 00020 * along with this shader; if not, write to the Free Software Foundation, 00021 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00022 * 00023 * The Original Code is Copyright (C) 2005 Blender Foundation. 00024 * All rights reserved. 00025 * 00026 * The Original Code is: all of this file. 00027 * 00028 * Contributor(s): Brecht Van Lommel. 00029 * 00030 * ***** END GPL LICENSE BLOCK ***** 00031 */ 00032 00037 #ifndef GPU_GAME_H 00038 #define GPU_GAME_H 00039 00040 #ifdef __cplusplus 00041 extern "C" { 00042 #endif 00043 00044 struct Image; 00045 struct ImageUser; 00046 struct MTFace; 00047 struct Object; 00048 struct Scene; 00049 struct View3D; 00050 struct RegionView3D; 00051 struct SmokeModifierData; 00052 00053 /* OpenGL drawing functions related to shading. These are also 00054 * shared with the game engine, where there were previously 00055 * duplicates of some of these functions. */ 00056 00057 /* Initialize 00058 * - sets the default Blender opengl state, if in doubt, check 00059 * the contents of this function 00060 * - this is called when starting Blender, for opengl rendering, 00061 * and for switching back from the game engine for example. */ 00062 00063 void GPU_state_init(void); 00064 00065 /* Debugging */ 00066 00067 void GPU_state_print(void); 00068 00069 /* Material drawing 00070 * - first the state is initialized by a particular object and 00071 * it's materials 00072 * - after this, materials can be quickly enabled by their number, 00073 * GPU_enable_material returns 0 if drawing should be skipped 00074 * - after drawing, the material must be disabled again */ 00075 00076 void GPU_begin_object_materials(struct View3D *v3d, struct RegionView3D *rv3d, 00077 struct Scene *scene, struct Object *ob, int glsl, int *do_alpha_pass); 00078 void GPU_end_object_materials(void); 00079 00080 int GPU_enable_material(int nr, void *attribs); 00081 void GPU_disable_material(void); 00082 00083 void GPU_set_material_blend_mode(int blendmode); 00084 int GPU_get_material_blend_mode(void); 00085 00086 /* TexFace drawing 00087 * - this is mutually exclusive with material drawing, a mesh should 00088 * be drawn using one or the other 00089 * - passing NULL clears the state again */ 00090 00091 int GPU_set_tpage(struct MTFace *tface, int mipmap); 00092 00093 /* Lights 00094 * - returns how many lights were enabled 00095 * - this affects fixed functions materials and texface, not glsl */ 00096 00097 int GPU_default_lights(void); 00098 int GPU_scene_object_lights(struct Scene *scene, struct Object *ob, 00099 int lay, float viewmat[][4], int ortho); 00100 00101 /* Text render 00102 * - based on moving uv coordinates */ 00103 00104 void GPU_render_text(struct MTFace *tface, int mode, 00105 const char *textstr, int textlen, unsigned int *col, 00106 float *v1, float *v2, float *v3, float *v4, int glattrib); 00107 00108 /* Mipmap settings 00109 * - these will free textures on changes */ 00110 00111 void GPU_set_mipmap(int mipmap); 00112 void GPU_set_linear_mipmap(int linear); 00113 void GPU_paint_set_mipmap(int mipmap); 00114 00115 /* Anisotropic filtering settings 00116 * - these will free textures on changes */ 00117 void GPU_set_anisotropic(float value); 00118 float GPU_get_anisotropic(void); 00119 00120 /* Image updates and free 00121 * - these deal with images bound as opengl textures */ 00122 00123 void GPU_paint_update_image(struct Image *ima, int x, int y, int w, int h, int mipmap); 00124 void GPU_update_images_framechange(void); 00125 int GPU_update_image_time(struct Image *ima, double time); 00126 int GPU_verify_image(struct Image *ima, struct ImageUser *iuser, int tftile, int compare, int mipmap); 00127 void GPU_free_image(struct Image *ima); 00128 void GPU_free_images(void); 00129 void GPU_free_images_anim(void); 00130 00131 /* smoke drawing functions */ 00132 void GPU_free_smoke(struct SmokeModifierData *smd); 00133 void GPU_create_smoke(struct SmokeModifierData *smd, int highres); 00134 00135 /* Delayed free of OpenGL buffers by main thread */ 00136 void GPU_free_unused_buffers(void); 00137 00138 #ifdef __cplusplus 00139 } 00140 #endif 00141 00142 #endif 00143