Hiya, I got a little question about WinXP and OpenGL. I used to code opengl under win98se, and I had no problems with it, I wrote a terrain engine and always got over 100 fps in it.
However, I recently installed winXP. If I run my terrain engine there, I barely get 30 fps. Anyone have an idea why that is? I’d think theres a driver issue, but if I play HL or any other FPS that uses OpenGL, my fps is just the same as back in win98se.
Are you synching with the monitor vsync? You can disable this in the video settings, I believe. You can also do it with a Windows call which I don’t recall offhand and my graphics code is all at home
Perhaps the other applications disable this in software and your terrain program does not? If not, you’ll be bound to the vsync rate of your monitor, with may be 30 FPS.
I don’t think I explained that very well. Try a groups.google.com search for “vsync” in comp.graphics.api.opengl.
Try to clear out the memory for the PIXELFORMATDESCRIPTOR before setting those fields. You don’t set all of them, so it’s possible that some garbage is left behind since the memory is allocated locally on the stack.
Either
ZeroMemory(ppfd, sizeof(PIXELFORMATDESCRIPTOR); // After ppfd=&pfd;
of
ZeroMemory(&pfd, sizeof(PIXELFORMATDESCRIPTOR);
Should work.
If nothing else, you can also always enumerate through all the pixelformats and find the one with the properties you want, that is hardware accellerated.
One more thing. Usually when you use ChoosePixelFormat, you should use DescribePixelFormat before SetPixelFormat to make sure that the PIXELFORMATDESCRIPTOR matches the number of the PixelFormat returned by ChoosePixelFormat.
[This message has been edited by Deiussum (edited 05-02-2003).]
Originally posted by Parsec:
ppfd->cColorBits = 8;
An 8 bit color buffer(no alpha) will most certainly give you a software rendering format, if one even exists. Try setting this to 24. It might work for now on your hardware/driver but could fail for anything else.
Hello.
I noticed exaclty the same problem : my fps was at 50 with win 2000 and 3 with winXP.
But I create my window with “glutCreateWindow” … etc.
Should I use the window functions? what are the differences between a window that was created with glutCreateWindow (which is simple) and a windows created with “wglCreateContext(g_hDC)” … etc ???
Thank you!
Creating a window with glut will eventually create a window using the Win32 API CreateWindow function on Windows and then setup the pixelformat based on what you want. For Linux it does the glx equivalent. (wglCreateContext doesn’t actually create the window for you, it just creates the GL context.)
What sort of things are you requesting for the window? (i.e. what do you pass to glutInitDisplayMode()?)
Also make sure you have the latest drivers for your card. Which card do you have, BTW?
[This message has been edited by Deiussum (edited 05-12-2003).]