=== modified file 'mesh.cpp'
@@ -108,7 +108,7 @@
glEnableVertexAttribArray(Shader::NormalAttribLocation);
glEnableVertexAttribArray(Shader::TexCoordAttribLocation);
- glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0);
+ glBindBuffer(GL_ARRAY_BUFFER, 0);
glVertexAttribPointer(Shader::VertexAttribLocation, 3, GL_FLOAT,
GL_FALSE, sizeof(Vertex), &mVertex[0].v.x);
glVertexAttribPointer(Shader::NormalAttribLocation, 3, GL_FLOAT,
@@ -146,22 +146,22 @@
}
// Generate And Bind The Vertex Buffer
- glGenBuffersARB(1, &mVBOVertices); // Get A Valid Name
- glBindBufferARB(GL_ARRAY_BUFFER_ARB, mVBOVertices); // Bind The Buffer
+ glGenBuffers(1, &mVBOVertices);
+ glBindBuffer(GL_ARRAY_BUFFER, mVBOVertices);
// Load The Data
- glBufferDataARB(GL_ARRAY_BUFFER_ARB, mVertexQty * sizeof(Vector3f), vertex, GL_STATIC_DRAW_ARB);
+ glBufferData(GL_ARRAY_BUFFER, mVertexQty * sizeof(Vector3f), vertex, GL_STATIC_DRAW);
// Generate And Bind The normal Buffer
- glGenBuffersARB(1, &mVBONormals); // Get A Valid Name
- glBindBufferARB(GL_ARRAY_BUFFER_ARB, mVBONormals); // Bind The Buffer
+ glGenBuffers(1, &mVBONormals);
+ glBindBuffer(GL_ARRAY_BUFFER, mVBONormals);
// Load The Data
- glBufferDataARB(GL_ARRAY_BUFFER_ARB, mVertexQty * sizeof(Vector3f), normal, GL_STATIC_DRAW_ARB);
+ glBufferData(GL_ARRAY_BUFFER, mVertexQty * sizeof(Vector3f), normal, GL_STATIC_DRAW);
// Generate And Bind The Texture Coordinate Buffer
- glGenBuffersARB(1, &mVBOTexCoords); // Get A Valid Name
- glBindBufferARB(GL_ARRAY_BUFFER_ARB, mVBOTexCoords); // Bind The Buffer
+ glGenBuffers(1, &mVBOTexCoords);
+ glBindBuffer(GL_ARRAY_BUFFER, mVBOTexCoords);
// Load The Data
- glBufferDataARB(GL_ARRAY_BUFFER_ARB, mVertexQty * sizeof(Texel), texel, GL_STATIC_DRAW_ARB);
+ glBufferData(GL_ARRAY_BUFFER, mVertexQty * sizeof(Texel), texel, GL_STATIC_DRAW);
glBindBuffer(GL_ARRAY_BUFFER, 0);
@@ -179,11 +179,11 @@
glEnableClientState(GL_NORMAL_ARRAY);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
- glBindBufferARB(GL_ARRAY_BUFFER_ARB, mVBOVertices);
+ glBindBuffer(GL_ARRAY_BUFFER, mVBOVertices);
glVertexPointer(3, GL_FLOAT, 0, 0);
- glBindBufferARB(GL_ARRAY_BUFFER_ARB, mVBONormals);
+ glBindBuffer(GL_ARRAY_BUFFER, mVBONormals);
glNormalPointer(GL_FLOAT, 0, 0);
- glBindBufferARB(GL_ARRAY_BUFFER_ARB, mVBOTexCoords);
+ glBindBuffer(GL_ARRAY_BUFFER, mVBOTexCoords);
glTexCoordPointer(2, GL_FLOAT, 0, 0);
glDrawArrays(GL_TRIANGLES, 0, mVertexQty);
@@ -202,11 +202,11 @@
glEnableVertexAttribArray(Shader::NormalAttribLocation);
glEnableVertexAttribArray(Shader::TexCoordAttribLocation);
- glBindBufferARB(GL_ARRAY_BUFFER_ARB, mVBOVertices);
+ glBindBuffer(GL_ARRAY_BUFFER, mVBOVertices);
glVertexAttribPointer(Shader::VertexAttribLocation, 3, GL_FLOAT, GL_FALSE, 0, 0);
- glBindBufferARB(GL_ARRAY_BUFFER_ARB, mVBONormals);
+ glBindBuffer(GL_ARRAY_BUFFER, mVBONormals);
glVertexAttribPointer(Shader::NormalAttribLocation, 3, GL_FLOAT, GL_FALSE, 0, 0);
- glBindBufferARB(GL_ARRAY_BUFFER_ARB, mVBOTexCoords);
+ glBindBuffer(GL_ARRAY_BUFFER, mVBOTexCoords);
glVertexAttribPointer(Shader::TexCoordAttribLocation, 2, GL_FLOAT, GL_FALSE, 0, 0);
glDrawArrays(GL_TRIANGLES, 0, mVertexQty);
=== modified file 'shader.cpp'
@@ -35,8 +35,8 @@
char *vertex_shader_source, *fragment_shader_source;
char msg[512];
- mVertexShader = glCreateShaderObjectARB(GL_VERTEX_SHADER);
- mFragmentShader = glCreateShaderObjectARB(GL_FRAGMENT_SHADER);
+ mVertexShader = glCreateShader(GL_VERTEX_SHADER);
+ mFragmentShader = glCreateShader(GL_FRAGMENT_SHADER);
vertex_shader_source = readShaderFile(pVertexShaderFileName);
@@ -45,25 +45,25 @@
const char *vs = vertex_shader_source;
const char *fs = fragment_shader_source;
- glShaderSourceARB(mVertexShader, 1, &vs, NULL);
- glShaderSourceARB(mFragmentShader, 1, &fs, NULL);
+ glShaderSource(mVertexShader, 1, &vs, NULL);
+ glShaderSource(mFragmentShader, 1, &fs, NULL);
free(vertex_shader_source);
free(fragment_shader_source);
- glCompileShaderARB(mVertexShader);
+ glCompileShader(mVertexShader);
glGetShaderInfoLog(mVertexShader, sizeof msg, NULL, msg);
if (strlen(msg) > 0)
printf("%s: %s", pVertexShaderFileName, msg);
- glCompileShaderARB(mFragmentShader);
+ glCompileShader(mFragmentShader);
glGetShaderInfoLog(mFragmentShader, sizeof msg, NULL, msg);
if (strlen(msg) > 0)
printf("%s: %s\n", pFragmentShaderFileName, msg);
- mShaderProgram = glCreateProgramObjectARB();
- glAttachObjectARB(mShaderProgram, mFragmentShader);
- glAttachObjectARB(mShaderProgram, mVertexShader);
+ mShaderProgram = glCreateProgram();
+ glAttachShader(mShaderProgram, mFragmentShader);
+ glAttachShader(mShaderProgram, mVertexShader);
glBindAttribLocation(mShaderProgram, VertexAttribLocation, "position");
glBindAttribLocation(mShaderProgram, NormalAttribLocation, "normal");
glBindAttribLocation(mShaderProgram, TexCoordAttribLocation, "texcoord");
@@ -121,22 +121,22 @@
void Shader::use()
{
- glUseProgramObjectARB(mShaderProgram);
+ glUseProgram(mShaderProgram);
}
void Shader::remove()
{
- glUseProgramObjectARB(0);
+ glUseProgram(0);
}
void Shader::unload()
{
- glDetachObjectARB(mShaderProgram, mVertexShader);
- glDetachObjectARB(mShaderProgram, mFragmentShader);
+ glDetachShader(mShaderProgram, mVertexShader);
+ glDetachShader(mShaderProgram, mFragmentShader);
- glDeleteObjectARB(mVertexShader);
- glDeleteObjectARB(mFragmentShader);
- glDeleteObjectARB(mShaderProgram);
+ glDeleteShader(mVertexShader);
+ glDeleteShader(mFragmentShader);
+ glDeleteShader(mShaderProgram);
mVertexShader = 0;
mFragmentShader = 0;