Modifying the OpenGLWidget so that it can render multiple meshes.

This commit is contained in:
David Williams
2014-05-22 16:25:36 +02:00
parent 7fc954a6bf
commit 51e93fdabc
2 changed files with 18 additions and 13 deletions

View File

@ -31,6 +31,14 @@ distribution.
#include <QGLWidget>
#include <QGLShaderProgram>
struct OpenGLMeshData
{
GLuint noOfIndices;
GLuint indexBuffer;
GLuint vertexBuffer;
GLuint vertexArrayObject;
};
class OpenGLWidget : public QGLWidget
{
public:
@ -52,10 +60,7 @@ protected:
private:
//Index/vertex buffer data
GLuint noOfIndices;
GLuint indexBuffer;
GLuint vertexBuffer;
GLuint vertexArrayObject;
OpenGLMeshData mMeshData;
QGLShaderProgram shader;