Changeset 0b1b52d in opengl-game for graphics-pipeline_opengl.hpp


Ignore:
Timestamp:
Oct 4, 2019, 8:27:07 PM (5 years ago)
Author:
Dmitry Portnoy <dmitry.portnoy@…>
Branches:
feature/imgui-sdl, master, points-test
Children:
771b33a
Parents:
83b5b4b
Message:

In openglgame, port over the functionality to specify and initialize varying attributes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • graphics-pipeline_opengl.hpp

    r83b5b4b r0b1b52d  
    22#define _GRAPHICS_PIPELINE_OPENGL_H
    33
     4#include "graphics-pipeline.hpp"
     5
     6#include <vector>
     7
    48#include <GL/glew.h>
    59
    6 #include "graphics-pipeline.hpp"
     10enum VaryingAttribType {
     11   ATTRIB_OBJECT_VARYING,
     12   ATTRIB_POINT_VARYING,
     13};
     14
     15// TODO: Might be better to create a different struct for uniform attributes
     16struct 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};
    726
    827class GraphicsPipeline_OpenGL : public GraphicsPipeline {
    928   public:
    10       GraphicsPipeline_OpenGL();
     29      GraphicsPipeline_OpenGL(Viewport viewport);
    1130      ~GraphicsPipeline_OpenGL();
    1231
     32      void addVaryingAttribute(VaryingAttribType attribType, GLint size, GLenum type, size_t fieldOffset);
    1333      void createPipeline(string vertShaderFile, string fragShaderFile);
    1434
     
    1838      unsigned int numPoints;
    1939
     40      vector<VaryingAttribInfo> varyingAttribs;
     41
    2042      GLuint loadShaderProgram(string vertShaderFile, string fragShaderFile);
    2143      GLuint loadShader(GLenum type, string file);
Note: See TracChangeset for help on using the changeset viewer.