Am just doin an exercise and have a problem…the idea is 2 shear a 2d image. when trying 2 set up the matrix and ran into a problem. The full program with everythin else is fine. it still compiles and runs but this viewport does not display as i get 2 warnings saying
warning C4047: ‘function’ : ‘const float *’ differs in levels of indirection from ‘float [4][4]’
warning C4024: ‘glLoadMatrixf’ : different types for formal and actual parameter 1
the code is below…
float shearMatrix[4][4]; //decared earlier
void display(void)
{
shearMatrix[0][0] = 1.0;
shearMatrix[0][1] = 0.0;
shearMatrix[0][2] = 0.0;
shearMatrix[0][3] = 0.0;
shearMatrix[1][0] = 2.0;
shearMatrix[1][1] = 1.0;
shearMatrix[1][2] = 0.0;
shearMatrix[1][3] = 0.0;
shearMatrix[2][0] = 0.0;
shearMatrix[2][1] = 0.0;
shearMatrix[2][2] = 1.0;
shearMatrix[2][3] = 0.0;
shearMatrix[3][0] = 0.0;
shearMatrix[3][1] = 0.0;
shearMatrix[3][2] = 0.0;
shearMatrix[3][3] = 1.0;
glClear(GL_COLOR_BUFFER_BIT) ; // clear the background
glMatrixMode(GL_PROJECTION) ;
glPushMatrix();
glViewport(200,0,200,200);
glMatrixMode(GL_PROJECTION);
glLoadMatrixf(shearMatrix);
initials(); //calls polygon co-ordinates for the image
glPopMatrix();
glutSwapBuffers() ;
}
Any guidance or a solution would be excellent. Thanks