diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-12-09 12:01:47 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-12-09 12:01:47 +0300 |
commit | 7c76bdca1b7195720a769c4911678d85825907fe (patch) | |
tree | 003fab9c0a71af49b89f49eda0076b8018b6cfe8 /source/blender/gpu/GPU_immediate.h | |
parent | 9f546d690899e05b25a6ef764cc8cf2f5db918b0 (diff) |
Cleanup: move public doc-strings into headers for 'gpu'
Ref T92709
Diffstat (limited to 'source/blender/gpu/GPU_immediate.h')
-rw-r--r-- | source/blender/gpu/GPU_immediate.h | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/source/blender/gpu/GPU_immediate.h b/source/blender/gpu/GPU_immediate.h index edb7c9fe5b5..a175fc65ba4 100644 --- a/source/blender/gpu/GPU_immediate.h +++ b/source/blender/gpu/GPU_immediate.h @@ -39,7 +39,7 @@ extern "C" { /** Returns a cleared vertex format, ready for #add_attr. */ GPUVertFormat *immVertexFormat(void); -/** Every immBegin must have a program bound first. */ +/** Every #immBegin must have a program bound first. */ void immBindShader(GPUShader *shader); /** Call after your last immEnd, or before binding another program. */ void immUnbindProgram(void); @@ -50,10 +50,12 @@ void immBegin(GPUPrimType, uint vertex_len); void immBeginAtMost(GPUPrimType, uint max_vertex_len); void immEnd(void); /* finishes and draws. */ -/* immBegin a batch, then use standard immFunctions as usual. */ -/* immEnd will finalize the batch instead of drawing. */ -/* Then you can draw it as many times as you like! +/* - #immBegin a batch, then use standard `imm*` functions as usual. + * - #immEnd will finalize the batch instead of drawing. + * + * Then you can draw it as many times as you like! * Partially replaces the need for display lists. */ + GPUBatch *immBeginBatch(GPUPrimType, uint vertex_len); GPUBatch *immBeginBatchAtMost(GPUPrimType, uint vertex_len); @@ -81,12 +83,14 @@ void immAttr4ub(uint attr_id, unsigned char r, unsigned char g, unsigned char b, void immAttr3ubv(uint attr_id, const unsigned char data[3]); void immAttr4ubv(uint attr_id, const unsigned char data[4]); -/* Explicitly skip an attribute. */ -/* This advanced option kills automatic value copying for this attr_id. */ +/* Explicitly skip an attribute. + * This advanced option kills automatic value copying for this attr_id. */ + void immAttrSkip(uint attr_id); -/* Provide one last attribute value & end the current vertex. */ -/* This is most often used for 2D or 3D position (similar to glVertex). */ +/* Provide one last attribute value & end the current vertex. + * This is most often used for 2D or 3D position (similar to #glVertex). */ + void immVertex2f(uint attr_id, float x, float y); void immVertex3f(uint attr_id, float x, float y, float z); void immVertex4f(uint attr_id, float x, float y, float z, float w); @@ -101,6 +105,7 @@ void immVertex3fv(uint attr_id, const float data[3]); void immVertex2iv(uint attr_id, const int data[2]); /* Provide uniform values that don't change for the entire draw call. */ + void immUniform1i(const char *name, int x); void immUniform1f(const char *name, float x); void immUniform2f(const char *name, float x, float y); @@ -109,6 +114,9 @@ void immUniform3f(const char *name, float x, float y, float z); void immUniform3fv(const char *name, const float data[3]); void immUniform4f(const char *name, float x, float y, float z, float w); void immUniform4fv(const char *name, const float data[4]); +/** + * Note array index is not supported for name (i.e: "array[0]"). + */ void immUniformArray4fv(const char *bare_name, const float *data, int count); void immUniformMatrix4fv(const char *name, const float data[4][4]); @@ -116,7 +124,8 @@ void immBindTexture(const char *name, GPUTexture *tex); void immBindTextureSampler(const char *name, GPUTexture *tex, eGPUSamplerState state); /* Convenience functions for setting "uniform vec4 color". */ -/* The rgb functions have implicit alpha = 1.0. */ +/* The RGB functions have implicit alpha = 1.0. */ + void immUniformColor4f(float r, float g, float b, float a); void immUniformColor4fv(const float rgba[4]); void immUniformColor3f(float r, float g, float b); @@ -135,7 +144,7 @@ void immUniformColor4ubv(const unsigned char rgba[4]); */ void immBindBuiltinProgram(eGPUBuiltinShader shader_id); -/* Extend immUniformColor to take Blender's themes */ +/** Extend #immUniformColor to take Blender's themes. */ void immUniformThemeColor(int color_id); void immUniformThemeColorAlpha(int color_id, float a); void immUniformThemeColor3(int color_id); |