OpenGL Windows 7 error (window creation)

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:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <Windows.h>
#include <stdio.h>
#include <GL/gl.h>
#include <GL/glu.h>

const int 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.
Last edited on
closed account (o1vk4iN6)
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 ?
Last edited on
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.
When I add
#include<GL/glut.h>
It can't find the file, despite the fact I'm linking glut32.lib. What am I doing wrong?
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.
Thanks, the file is now included, but the issue still persists. Whenever it runs in full-screen, it just gets stuck on an immobile black screen.
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.
Topic archived. No new replies allowed.