Doesn't seem to work....
Code:
int InitGL(GLvoid) // All Setup For OpenGL Goes Here
{
if (!LoadGLTextures()) // Jump To Texture Loading Routine
{
return FALSE; // If Texture Didn't Load Return FALSE
}
glEnable(GL_TEXTURE_2D); // Enable Texture Mapping
glShadeModel(GL_SMOOTH); // Enable Smooth Shading
glClearColor(0.0f, 0.0f, 0.0f, 0.5f); // Black Background
glClearDepth(1.0f); // Depth Buffer Setup
glEnable(GL_DEPTH_TEST); // Enables Depth Testing
glDepthFunc(GL_LEQUAL); // The Type Of Depth Testing To Do
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); // Really Nice Perspective Calculations
glLightfv(GL_LIGHT1, GL_AMBIENT, LightAmbient); // Setup The Ambient Light
glLightfv(GL_LIGHT1, GL_DIFFUSE, LightDiffuse); // Setup The Diffuse Light
glLightfv(GL_LIGHT1, GL_POSITION,LightPosition); // Position The Light
glEnable(GL_LIGHT1); // Enable Light One
BuildFont();
SetCapture(hWnd);
cam.Y=2.5f;
return TRUE; // Initialization Went OK
}
Code:
case WM_MOUSEMOVE:
{
mousePoints = MAKEPOINTS(lParam);
currentCam->rotY=(float)((mousePoints.x)/3); //GET X AND Y MOUSE POSITIONS
if((mousePoints.y/3) < -90.0f)
currentCam->rotX=-89.0f;
else if((mousePoints.y/3) > 30.0f)
currentCam->rotX=29.0f;
else
currentCam->rotX= (float)((mousePoints.y)/3); //
break;
}