libgoatvr

diff src/mesh.c @ 9:d12592558809

build on macosx
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 20 Sep 2014 16:52:42 +0300
parents 3d9ec6fe97d7
children 827ec716c275
line diff
     1.1 --- a/src/mesh.c	Sat Sep 20 13:22:53 2014 +0300
     1.2 +++ b/src/mesh.c	Sat Sep 20 16:52:42 2014 +0300
     1.3 @@ -1,6 +1,7 @@
     1.4  #include <stdio.h>
     1.5  #include <stdlib.h>
     1.6  #include <string.h>
     1.7 +#include <stddef.h>
     1.8  #include "opengl.h"
     1.9  #include "mesh.h"
    1.10  
    1.11 @@ -15,7 +16,7 @@
    1.12  #define GL_STATIC_DRAW			0x88E4
    1.13  #endif
    1.14  
    1.15 -#if !defined(GL_VERSION_1_5) || !defined(GL_GLEXT_PROTOTYPES)
    1.16 +#ifndef GL_VERSION_1_5
    1.17  static void (*glGenBuffers)(GLsizei, GLuint*);
    1.18  static void (*glDeleteBuffers)(GLsizei, GLuint*);
    1.19  static void (*glBufferData)(GLenum, unsigned int, const GLvoid*, GLenum);
    1.20 @@ -31,6 +32,7 @@
    1.21  	m->num_verts = m->num_faces = 0;
    1.22  	m->vbo = m->ibo = 0;
    1.23  
    1.24 +#ifndef GL_VERSION_1_5
    1.25  	if(!glGenBuffers) {
    1.26  		glGenBuffers = vrimp_glfunc("glGenBuffersARB");
    1.27  		glDeleteBuffers = vrimp_glfunc("glDeleteBuffersARB");
    1.28 @@ -42,6 +44,7 @@
    1.29  			return -1;
    1.30  		}
    1.31  	}
    1.32 +#endif
    1.33  
    1.34  	return 0;
    1.35  }