I've been working on an OpenGL project for several months, and recently ran into a problem after transferring it from Windows XP to Windows 7. Whenever I run the application in a window, it has SEVERE performance issues (around 2-3 FPS) despite being an extremely simple and efficient program. Furthermore, whenever I run it in full-screen, it just creates a completely black window and doesn't run anything, not allowing itself to even be closed. I've stripped the code down to the following:
#include <Windows.h>
#include <stdio.h>
#include <GL/gl.h>
#include <GL/glu.h>
constint XRES = 1280, YRES = 800;
bool fullscreen = true;
int WINAPI WinMain( HINSTANCE hInstance, // Instance
HINSTANCE hPrevInstance, // Previous Instance
LPSTR lpCmdLine, // Command Line Parameters
int nCmdShow) // Window Show State
{
MSG msg;
if (!CreateGLWindow("<Project Name>",XRES,YRES,32,fullscreen))
{
return 0;
}
KillGLWindow();
return (msg.wParam);
}
There is, of course, other code, but this is the only relevant section. Any insight would be much appreciated, as I've been stuck on this issue for over a month.
Well I don't see anything wrong with what you posted other then you are missing glut header or something similar, unless windows provides some sort of opengl window creation now ?
GL does not provide OS specific window creation routines.
As xerzi said, you may miss glut header.
After adding glut header, delete gl.h and glu.h headers.
you should add glut.h file in include folder of your compiler and add glut.lib to lib folder and add glut.dll to system32 folder. did you do that?
Then you can use glut function.
If you think you do not have logical errors, run your program on a XP windows.
Maybe problem is with 7 because of using old versions of glut. (glut is discontinued). freeglut is an alternative for that.