hello.
I trying to convert a opengl 2.0 project without shader in a opengl 2.0 project with shader.
My problem is this:
I have
void RenderFrame()
{
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glMultMatrixf(&g_camera.getViewMatrix()[0][0]);//in g_camera.getViewMatrix() i have a correct view matrix with
//rotation's and orientation
RenderModel();// draw mesh
}
void RenderModel()
{
glPushMatrix();
m[3][0] = g_meshPosition.x;
m[3][1] = g_meshPosition.y;
m[3][2] = g_meshPosition.z;
glMultMatrixf(&m[0][0]);
.
.
.
glDrawElements(GL_TRIANGLES, pMesh->triangleCount * 3,
GL_UNSIGNED_INT, g_model.getIndexBuffer() + pMesh->startIndex);
glPopMatrix();
}
In my project i have only shader and for each shader a Model view matrix and projection matrix.
But the demo project first set the correct view matrix(that I have ) then set the position of the mesh(that i have) and then draw.
But how i can do this with shaders?