Remove Vertex Array Objects.

This commit is contained in:
Kitlith 2015-05-09 16:09:01 -07:00
parent a11e990a13
commit 20b2afe509
3 changed files with 3 additions and 45 deletions

View File

@ -95,27 +95,6 @@ static PROC WinGetProcAddress(const char *name)
#endif #endif
#endif #endif
int ogl_ext_ARB_vertex_array_object = ogl_LOAD_FAILED;
void (CODEGEN_FUNCPTR *_ptrc_glBindVertexArray)(GLuint) = NULL;
void (CODEGEN_FUNCPTR *_ptrc_glDeleteVertexArrays)(GLsizei, const GLuint *) = NULL;
void (CODEGEN_FUNCPTR *_ptrc_glGenVertexArrays)(GLsizei, GLuint *) = NULL;
GLboolean (CODEGEN_FUNCPTR *_ptrc_glIsVertexArray)(GLuint) = NULL;
static int Load_ARB_vertex_array_object()
{
int numFailed = 0;
_ptrc_glBindVertexArray = (void (CODEGEN_FUNCPTR *)(GLuint))IntGetProcAddress("glBindVertexArray");
if(!_ptrc_glBindVertexArray) numFailed++;
_ptrc_glDeleteVertexArrays = (void (CODEGEN_FUNCPTR *)(GLsizei, const GLuint *))IntGetProcAddress("glDeleteVertexArrays");
if(!_ptrc_glDeleteVertexArrays) numFailed++;
_ptrc_glGenVertexArrays = (void (CODEGEN_FUNCPTR *)(GLsizei, GLuint *))IntGetProcAddress("glGenVertexArrays");
if(!_ptrc_glGenVertexArrays) numFailed++;
_ptrc_glIsVertexArray = (GLboolean (CODEGEN_FUNCPTR *)(GLuint))IntGetProcAddress("glIsVertexArray");
if(!_ptrc_glIsVertexArray) numFailed++;
return numFailed;
}
void (CODEGEN_FUNCPTR *_ptrc_glAccum)(GLenum, GLfloat) = NULL; void (CODEGEN_FUNCPTR *_ptrc_glAccum)(GLenum, GLfloat) = NULL;
void (CODEGEN_FUNCPTR *_ptrc_glAlphaFunc)(GLenum, GLfloat) = NULL; void (CODEGEN_FUNCPTR *_ptrc_glAlphaFunc)(GLenum, GLfloat) = NULL;
void (CODEGEN_FUNCPTR *_ptrc_glBegin)(GLenum) = NULL; void (CODEGEN_FUNCPTR *_ptrc_glBegin)(GLenum) = NULL;
@ -1792,10 +1771,10 @@ typedef struct ogl_StrToExtMap_s
} ogl_StrToExtMap; } ogl_StrToExtMap;
static ogl_StrToExtMap ExtensionMap[1] = { static ogl_StrToExtMap ExtensionMap[1] = {
{"GL_ARB_vertex_array_object", &ogl_ext_ARB_vertex_array_object, Load_ARB_vertex_array_object}, {"", NULL, NULL},
}; };
static int g_extensionMapSize = 1; static int g_extensionMapSize = 0;
static ogl_StrToExtMap *FindExtEntry(const char *extensionName) static ogl_StrToExtMap *FindExtEntry(const char *extensionName)
{ {
@ -1812,7 +1791,6 @@ static ogl_StrToExtMap *FindExtEntry(const char *extensionName)
static void ClearExtensionVars() static void ClearExtensionVars()
{ {
ogl_ext_ARB_vertex_array_object = ogl_LOAD_FAILED;
} }

View File

@ -153,10 +153,6 @@ typedef unsigned int GLhandleARB;
extern "C" { extern "C" {
#endif /*__cplusplus*/ #endif /*__cplusplus*/
extern int ogl_ext_ARB_vertex_array_object;
#define GL_VERTEX_ARRAY_BINDING 0x85B5
#define GL_2D 0x0600 #define GL_2D 0x0600
#define GL_2_BYTES 0x1407 #define GL_2_BYTES 0x1407
#define GL_3D 0x0601 #define GL_3D 0x0601
@ -1036,18 +1032,6 @@ extern int ogl_ext_ARB_vertex_array_object;
#define GL_SRGB8_ALPHA8 0x8C43 #define GL_SRGB8_ALPHA8 0x8C43
#define GL_SRGB_ALPHA 0x8C42 #define GL_SRGB_ALPHA 0x8C42
#ifndef GL_ARB_vertex_array_object
#define GL_ARB_vertex_array_object 1
extern void (CODEGEN_FUNCPTR *_ptrc_glBindVertexArray)(GLuint);
#define glBindVertexArray _ptrc_glBindVertexArray
extern void (CODEGEN_FUNCPTR *_ptrc_glDeleteVertexArrays)(GLsizei, const GLuint *);
#define glDeleteVertexArrays _ptrc_glDeleteVertexArrays
extern void (CODEGEN_FUNCPTR *_ptrc_glGenVertexArrays)(GLsizei, GLuint *);
#define glGenVertexArrays _ptrc_glGenVertexArrays
extern GLboolean (CODEGEN_FUNCPTR *_ptrc_glIsVertexArray)(GLuint);
#define glIsVertexArray _ptrc_glIsVertexArray
#endif /*GL_ARB_vertex_array_object*/
extern void (CODEGEN_FUNCPTR *_ptrc_glAccum)(GLenum, GLfloat); extern void (CODEGEN_FUNCPTR *_ptrc_glAccum)(GLenum, GLfloat);
#define glAccum _ptrc_glAccum #define glAccum _ptrc_glAccum
extern void (CODEGEN_FUNCPTR *_ptrc_glAlphaFunc)(GLenum, GLfloat); extern void (CODEGEN_FUNCPTR *_ptrc_glAlphaFunc)(GLenum, GLfloat);

View File

@ -187,11 +187,7 @@ void RendererOpenGL::InitOpenGLObjects() {
// Generate VBO handle for drawing // Generate VBO handle for drawing
glGenBuffers(1, &vertex_buffer_handle); glGenBuffers(1, &vertex_buffer_handle);
// Generate VAO // Attach vertex data to VBO
glGenVertexArrays(1, &vertex_array_handle);
glBindVertexArray(vertex_array_handle);
// Attach vertex data to VAO
glBindBuffer(GL_ARRAY_BUFFER, vertex_buffer_handle); glBindBuffer(GL_ARRAY_BUFFER, vertex_buffer_handle);
glBufferData(GL_ARRAY_BUFFER, sizeof(ScreenRectVertex) * 4, nullptr, GL_STREAM_DRAW); glBufferData(GL_ARRAY_BUFFER, sizeof(ScreenRectVertex) * 4, nullptr, GL_STREAM_DRAW);
glVertexAttribPointer(attrib_position, 2, GL_FLOAT, GL_FALSE, sizeof(ScreenRectVertex), (GLvoid*)offsetof(ScreenRectVertex, position)); glVertexAttribPointer(attrib_position, 2, GL_FLOAT, GL_FALSE, sizeof(ScreenRectVertex), (GLvoid*)offsetof(ScreenRectVertex, position));