diff options
Diffstat (limited to 'code/gl_graphics.h')
-rw-r--r-- | code/gl_graphics.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/code/gl_graphics.h b/code/gl_graphics.h new file mode 100644 index 0000000..d97d062 --- /dev/null +++ b/code/gl_graphics.h @@ -0,0 +1,36 @@ +#ifndef GL_GRAPHICS_H +#define GL_GRAPHICS_H + +void LoadUniformInt(u32 SP, const char *Unifrom, i32 Val); +void LoadUniformFloat(u32 SP, const char *Uniform, r32 Val); +void LoadUniformVec3(u32 SP, const char *Unifrom, Vec3 Val); +void LoadUniformMat4(u32 SP, const char *Uniform, Mat4 Val); +u32 CreateVertexShader(const char *VertexShaderSource); +u32 CreateFragmentShader(const char *FragmentShaderSource); +u32 CreateShaderProgram(unsigned int VertexShader, unsigned int FragmentShader); + +u32 CreateTriangle(r32 vertices[], i32 sz); +void DrawTriangle(u32 VAO); + +u32 CreateRectangle(r32 vertices[], i32 v_sz, u32 indices[], i32 i_sz); +/** + * @note: the texture functions for rectangle are more obtuse and less clear + * they don't make as much sense. And they dont just create something. + * They play on to the state machine-ness of opengl, and just enable a set of + * operations I find repetitive. + * + * @todo: I need to probably add the examples to my utils file as notes + * */ +BufferO CreateRectangleTextured(r32 vertices[], i32 v_sz, u32 indices[], i32 i_sz, u32 attr); +void MakeRectangleTextured(BufferO *bo, r32 vertices[], i32 v_sz, u32 indices[], i32 i_sz, u32 attr); +void DrawRectangle(u32 VAO); +void DrawRectangleTextured(u32 VAO, u32 TexO); + +BufferO CreateCube(r32 vertices[], i32 v_sz); +BufferO CreateCubeTextured(r32 vertices[], i32 v_sz); +void DrawCube(u32 VAO); + +GLint GetColorAttrib(u32 nrChannels); +void GenAndBindGlTexture(Texture2D Tex, u32 VAO, u32 *TexO); +void BindGlTexture(Texture2D Tex, u32 VAO, u32 TexO); +#endif |