Guest User

gl.h

a guest
Nov 27th, 2014
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.77 KB | None | 0 0
  1.  
  2. #ifndef GL_H
  3. #define GL_H
  4.  
  5. #include <stdint.h>
  6.  
  7. /* using gsVBO for now */
  8. #include "gs.h"
  9.  
  10. typedef size_t GLuint;
  11. typedef int16_t GLint;
  12. typedef uint8_t GLubyte;
  13.  
  14. typedef int GLboolean;
  15. typedef uint16_t GLenum;
  16. typedef int32_t GLsizei;
  17.  
  18. enum GLbooleanValue
  19. {
  20.     GL_FALSE =                  0,
  21.     GL_TRUE =                   1,
  22. };
  23.  
  24. enum GLblendMode
  25. {
  26.     GL_FUNC_ADD =               0,
  27.     GL_FUNC_SUBTRACT =          1,
  28.     GL_FUNC_REVERSE_SUBTRACT =  2,
  29.     GL_MIN =                    3,
  30.     GL_MAX =                    4,
  31. };
  32.  
  33. enum GLblendFactor
  34. {
  35.     GL_ZERO =                       0,
  36.     GL_ONE =                        1,
  37.     GL_SRC_COLOR =                  2,
  38.     GL_ONE_MINUS_SRC_COLOR =        3,
  39.     GL_DST_COLOR =                  4,
  40.     GL_ONE_MINUS_DST_COLOR =        5,
  41.     GL_SRC_ALPHA =                  6,
  42.     GL_ONE_MINUS_SRC_ALPHA =        7,
  43.     GL_DST_ALPHA =                  8,
  44.     GL_ONE_MINUS_DST_ALPHA =        9,
  45.     GL_CONSTANT_COLOR =             10,
  46.     GL_ONE_MINUS_CONSTANT_COLOR =   11,
  47.     GL_CONSTANT_ALPHA =             12,
  48.     GL_ONE_MINUS_CONSTANT_ALPHA =   13,
  49.     GL_SRC_ALPHA_SATURATE =         14,
  50. };
  51.  
  52. enum GLcaps
  53. {
  54.     GL_CULL_FACE =      0x0001,
  55.     GL_STENCIL_TEST =   0x0002,
  56.     GL_BLEND =          0x0004,
  57.     GL_ALPHA_TEST =     0x0008,
  58.     GL_DEPTH_TEST =     0x0010,
  59. };
  60.  
  61. enum GLcullFaceMode
  62. {
  63.     GL_FRONT =      0,
  64.     GL_BACK =       1,
  65.     /*GL_FRONT_AND_BACK -- not supported?*/
  66. };
  67.  
  68. enum GLfrontFaceMode
  69. {
  70.     GL_CW =         0,
  71.     GL_CCW =        1,
  72. };
  73.  
  74. enum GLstencilOp
  75. {
  76.     GL_KEEP =       0,
  77.     GL_AND_NOT =    1,
  78.     GL_XOR =        5,
  79. };
  80.  
  81. enum GLtestFunc
  82. {
  83.     GL_NEVER =      0,
  84.     GL_ALWAYS =     1,
  85.     GL_EQUAL =      2,
  86.     GL_NOTEQUAL =   3,
  87.     GL_LESS =       4,
  88.     GL_LEQUAL =     5,
  89.     GL_GREATER =    6,
  90.     GL_GEQUAL =     7,
  91. };
  92.  
  93. //
  94. void ctrglInit();
  95. void ctrglBeginRendering();
  96. void ctrglFlushState();
  97.  
  98. /* **** STATE **** */
  99. void glEnable(GLenum cap);
  100.  
  101. /* Alpha Test */
  102. void glAlphaFunc(GLenum func, GLclampf ref);
  103.  
  104. void glAlphaFuncubCTR(GLenum func, GLubyte ref);
  105.  
  106. /* Blending */
  107. void glBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
  108.  
  109. void glBlendColor4ubCTR(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha);
  110.  
  111. /* Culling */
  112. void glCullFace(GLenum mode);
  113. void glFrontFace(GLenum mode);
  114.  
  115. /* Depth Test */
  116. void glDepthFunc(GLenum func);
  117. void glDepthMask(GLboolean flag);
  118.  
  119. /* Stencil */
  120. void glStencilFunc(GLenum func, GLint ref, GLuint mask);
  121. void glStencilOp(GLenum sfail, GLenum dpfail, GLenum dppass);
  122.  
  123. /* **** TEXTURES **** */
  124. void glGenTextures(GLsizei n, GLuint* textures);
  125.  
  126. /* **** SHADERS **** */
  127. GLuint glCreateProgram(void);
  128.  
  129. /* temporary */
  130. void glDrawVbo(gsVbo_s* vbo);
  131.  
  132. #endif
Advertisement
Add Comment
Please, Sign In to add comment