diff options
Diffstat (limited to 'source/blender/gpu/GPU_draw.h')
-rw-r--r-- | source/blender/gpu/GPU_draw.h | 87 |
1 files changed, 22 insertions, 65 deletions
diff --git a/source/blender/gpu/GPU_draw.h b/source/blender/gpu/GPU_draw.h index de53b1e8739..ebce83d2a5f 100644 --- a/source/blender/gpu/GPU_draw.h +++ b/source/blender/gpu/GPU_draw.h @@ -39,76 +39,32 @@ extern "C" { struct ImBuf; struct Image; struct ImageUser; -struct MTexPoly; +struct Main; struct Object; struct Scene; +struct ViewLayer; struct View3D; struct RegionView3D; struct SmokeModifierData; struct DupliObject; -/* OpenGL drawing functions related to shading. These are also - * shared with the game engine, where there were previously - * duplicates of some of these functions. */ +#include "DNA_object_enums.h" + +/* OpenGL drawing functions related to shading. */ /* Initialize * - sets the default Blender opengl state, if in doubt, check * the contents of this function - * - this is called when starting Blender, for opengl rendering, - * and for switching back from the game engine for example. */ + * - this is called when starting Blender, for opengl rendering. */ void GPU_state_init(void); -/* Material drawing - * - first the state is initialized by a particular object and - * it's materials - * - after this, materials can be quickly enabled by their number, - * GPU_object_material_bind returns 0 if drawing should be skipped - * - after drawing, the material must be disabled again */ - -void GPU_begin_object_materials(struct View3D *v3d, struct RegionView3D *rv3d, - struct Scene *scene, struct Object *ob, bool glsl, bool *do_alpha_after); -void GPU_end_object_materials(void); -bool GPU_object_materials_check(void); - -int GPU_object_material_bind(int nr, void *attribs); -void GPU_object_material_unbind(void); -int GPU_object_material_visible(int nr, void *attribs); - -void GPU_begin_dupli_object(struct DupliObject *dob); -void GPU_end_dupli_object(void); - -void GPU_material_diffuse_get(int nr, float diff[4]); -bool GPU_material_use_matcaps_get(void); - -void GPU_set_material_alpha_blend(int alphablend); -int GPU_get_material_alpha_blend(void); - -/* TexFace drawing - * - this is mutually exclusive with material drawing, a mesh should - * be drawn using one or the other - * - passing NULL clears the state again */ - -int GPU_set_tpage(struct MTexPoly *mtexpoly, int mipmap, int transp); -void GPU_clear_tpage(bool force); +/* Programmable point size + * - shaders set their own point size when enabled + * - use glPointSize when disabled */ -/* Lights - * - returns how many lights were enabled - * - this affects fixed functions materials and texface, not glsl */ - -int GPU_default_lights(void); -int GPU_scene_object_lights( - struct Scene *scene, struct Object *ob, - int lay, float viewmat[4][4], int ortho); - -/* Text render - * - based on moving uv coordinates */ - -void GPU_render_text( - struct MTexPoly *mtexpoly, int mode, - const char *textstr, int textlen, unsigned int *col, - const float *v_quad[4], const float *uv_quad[4], - int glattrib); +void GPU_enable_program_point_size(void); +void GPU_disable_program_point_size(void); /* Mipmap settings * - these will free textures on changes */ @@ -131,11 +87,6 @@ void GPU_set_gpu_mipmapping(struct Main *bmain, int gpu_mipmap); * - these deal with images bound as opengl textures */ void GPU_paint_update_image(struct Image *ima, struct ImageUser *iuser, int x, int y, int w, int h); -void GPU_update_images_framechange(struct Main *bmain); -int GPU_update_image_time(struct Image *ima, double time); -int GPU_verify_image( - struct Image *ima, struct ImageUser *iuser, - int textarget, int tftile, bool compare, bool mipmap, bool is_data); void GPU_create_gl_tex( unsigned int *bind, unsigned int *rect, float *frect, int rectw, int recth, int textarget, bool mipmap, bool use_hight_bit_depth, struct Image *ima); @@ -155,17 +106,23 @@ void GPU_create_smoke(struct SmokeModifierData *smd, int highres); /* Delayed free of OpenGL buffers by main thread */ void GPU_free_unused_buffers(struct Main *bmain); -#ifdef WITH_OPENSUBDIV -struct DerivedMesh; -void GPU_draw_update_fvar_offset(struct DerivedMesh *dm); -#endif - /* utilities */ void GPU_select_index_set(int index); void GPU_select_index_get(int index, int *r_col); int GPU_select_to_index(unsigned int col); void GPU_select_to_index_array(unsigned int *col, const unsigned int size); +typedef enum eGPUAttribMask { + GPU_DEPTH_BUFFER_BIT = (1 << 0), + GPU_ENABLE_BIT = (1 << 1), + GPU_SCISSOR_BIT = (1 << 2), + GPU_VIEWPORT_BIT = (1 << 3), + GPU_BLEND_BIT = (1 << 4), +} eGPUAttribMask; + +void gpuPushAttrib(eGPUAttribMask mask); +void gpuPopAttrib(void); + #ifdef __cplusplus } #endif |