pass data (xyz, uv) with 1 buffer to shader,
bugs: 2 triangles are not painted, one is wrong positioned
This commit is contained in:
@@ -6,6 +6,23 @@
|
||||
#include <vector>
|
||||
#include "Object.h"
|
||||
|
||||
#define VERTEX_INDEX_XYZ 0
|
||||
#define VERTEX_INDEX_UV 1
|
||||
|
||||
#define VERTEX_COMPONENTS_XYZ 3
|
||||
#define VERTEX_COMPONENTS_UV 4
|
||||
|
||||
#define VERTEX_SIZE_XYZ (sizeof(float) * VERTEX_COMPONENTS_XYZ)
|
||||
#define VERTEX_SIZE_UV (sizeof(float) * VERTEX_COMPONENTS_UV)
|
||||
|
||||
#define VERTEX_OFFSET_XYZ 0
|
||||
#define VERTEX_OFFSET_UV (VERTEX_SIZE_XYZ)
|
||||
|
||||
struct Vertex {
|
||||
GLfloat position[3];
|
||||
GLfloat uv[2];
|
||||
};
|
||||
|
||||
class OpenGLController
|
||||
{
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -35,10 +52,10 @@ private:
|
||||
// IDs ==========================
|
||||
//object data
|
||||
GLuint gluiVertexArrayID;
|
||||
GLuint gluiInstanceBufferID;
|
||||
GLuint gluiVertexBufferID;
|
||||
|
||||
//obj color
|
||||
GLuint gluiUVBufferID;
|
||||
GLuint gluiTextureID;
|
||||
GLuint gluiShaderPrgmID;
|
||||
GLuint gluiSamplerID;
|
||||
|
Reference in New Issue
Block a user