Changeset 0b1b52d in opengl-game for graphics-pipeline_opengl.hpp
- Timestamp:
- Oct 4, 2019, 8:27:07 PM (5 years ago)
- Branches:
- feature/imgui-sdl, master, points-test
- Children:
- 771b33a
- Parents:
- 83b5b4b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
graphics-pipeline_opengl.hpp
r83b5b4b r0b1b52d 2 2 #define _GRAPHICS_PIPELINE_OPENGL_H 3 3 4 #include "graphics-pipeline.hpp" 5 6 #include <vector> 7 4 8 #include <GL/glew.h> 5 9 6 #include "graphics-pipeline.hpp" 10 enum VaryingAttribType { 11 ATTRIB_OBJECT_VARYING, 12 ATTRIB_POINT_VARYING, 13 }; 14 15 // TODO: Might be better to create a different struct for uniform attributes 16 struct VaryingAttribInfo { 17 VaryingAttribType attribType; 18 GLuint index; 19 GLint size; 20 GLenum type; 21 // UniformType uniType; 22 GLuint buffer; // For uniforms, this is the uniform location 23 size_t fieldOffset; 24 // GLfloat* data; // pointer to data source for uniform attributes 25 }; 7 26 8 27 class GraphicsPipeline_OpenGL : public GraphicsPipeline { 9 28 public: 10 GraphicsPipeline_OpenGL( );29 GraphicsPipeline_OpenGL(Viewport viewport); 11 30 ~GraphicsPipeline_OpenGL(); 12 31 32 void addVaryingAttribute(VaryingAttribType attribType, GLint size, GLenum type, size_t fieldOffset); 13 33 void createPipeline(string vertShaderFile, string fragShaderFile); 14 34 … … 18 38 unsigned int numPoints; 19 39 40 vector<VaryingAttribInfo> varyingAttribs; 41 20 42 GLuint loadShaderProgram(string vertShaderFile, string fragShaderFile); 21 43 GLuint loadShader(GLenum type, string file);
Note:
See TracChangeset
for help on using the changeset viewer.