99 lines
1.4 KiB
C
99 lines
1.4 KiB
C
#ifndef _mesh
|
|
|
|
#define _mesh
|
|
|
|
|
|
// Macros
|
|
|
|
#define GL_GLEXT_PROTOTYPES
|
|
|
|
|
|
|
|
|
|
#include "stdlib.h"
|
|
|
|
extern char * __ClassNames[];
|
|
|
|
|
|
// Includes
|
|
|
|
#include "unsignedIntegerArray.h"
|
|
|
|
#include "floatArray.h"
|
|
|
|
#include "program.h"
|
|
|
|
#include "shader.h"
|
|
|
|
#include "block.h"
|
|
|
|
#include <GL/glx.h>
|
|
|
|
#include <GL/gl.h>
|
|
|
|
#include <GL/glext.h>
|
|
|
|
|
|
typedef struct mesh{
|
|
|
|
struct program * program;
|
|
|
|
struct unsignedIntegerArray * indices;
|
|
|
|
struct floatArray * textureCoordinates;
|
|
|
|
struct floatArray * vertexCoordinates;
|
|
|
|
struct floatArray * normalCoordinates;
|
|
|
|
struct array * blocks;
|
|
|
|
GLuint vertexArrayObject;
|
|
|
|
GLuint uniformBuffer;
|
|
|
|
GLuint indexBuffer;
|
|
|
|
GLuint vertexbuffer;
|
|
|
|
GLuint textureCoordinateBuffer;
|
|
|
|
GLuint meshIndexBuffer;
|
|
|
|
GLuint uvBuffer;
|
|
|
|
struct unsignedIntegerArray * uniformBuffers;
|
|
|
|
|
|
} mesh;
|
|
|
|
struct block * mesh_getUniformBlock( mesh * this, char * blockName );
|
|
|
|
void mesh_bindBlock( mesh * this, struct block * blockInstance );
|
|
|
|
void mesh_setProgram( mesh * this, struct program * currentProgram );
|
|
|
|
GLuint mesh_getGLTypeSize( mesh * this, GLuint type );
|
|
|
|
GLuint mesh_getComponentType( mesh * this, GLuint type );
|
|
|
|
GLuint mesh_getItemSize( mesh * this, GLuint type );
|
|
|
|
GLuint mesh_createBuffer( mesh * this, char * attributeName, void * data, GLenum target, GLenum usage );
|
|
|
|
void mesh_createBuffers( mesh * this );
|
|
|
|
void mesh_createOrderedTriangleStripQuad( mesh * this );
|
|
|
|
mesh mesh_new( );
|
|
|
|
mesh * mesh_newPointer( );
|
|
|
|
#endif
|
|
|
|
|
|
typedef struct mesh mesh;
|
|
|
|
|
|
|