www.pudn.com > 基于SDK框架下OpenGL的实现.rar > WindowOpenGL.hpp
#include#include #include #include #include static LPCTSTR lpszAppName = "GLTest"; LRESULT CALLBACK WndProc( HWND hWnd, UINT message,WPARAM wParam, LPARAM lParam); void SetDCPixelFormat(HDC hDC); void SetupRC(); void ChangeSize(GLsizei w, GLsizei h); void RenderScene(); HPALETTE GetOpenGLPalette(HDC hDC); void SetDCPixelFormat(HDC hDC); HPALETTE hPalette = NULL; GLfloat windowWidth; GLfloat windowHeight; // Rotation amounts static GLfloat xRot = 0.0f; static GLfloat yRot = 0.0f; #define GL_PI 3.1415f // Light values and coordinates GLfloat ambientLight[] = { 0.3f, 0.3f, 0.3f, 1.0f }; GLfloat diffuseLight[] = { 0.6f, 0.6f, 0.6f, 1.0f }; GLfloat specular[] = { 1.0f, 1.0f, 1.0f, 1.0f}; GLfloat specref[] = { 1.0f, 1.0f, 1.0f, 1.0f }; static int iShape = 1;