PDA

View Full Version : Speeding up Win32 Opengl



08-31-2000, 05:00 PM
my win32 opengl program is running EXTREMELY slow right now and I believe its not a problem of processing vertices, but the of actually plotting the pixels onto the screen. I think the problem is that my program is using the windows GDI to draw the pixels, but I don't know. I do have an accelerator, but if windows is drawing pixels, that means it's using only software (which is REALLY slow), right? I was wondering if there's any way to set up an opengl engine that maybe takes exclusive control of the display and draws the pixels really really fast (i.e. directX flipping style). it must be possible because all these good looking commercial games use opengl but I don't know what how they are setting up their opengl window to make things run so smoothly. please help

kschroed
08-31-2000, 11:30 PM
Some accelerator drivers only take control of rendering in fullscreen modes.

glGetString(GL_VENDOR) returns something like "Microsoft" when it's just the software implementation.
You can also use glGetString(GL_RENDERER) to get further infos. But this needs an OpenGL rendering context set up ready for drawing.

good luck.

El Jefe
09-01-2000, 07:12 AM
e-mail me if you want some sample code that I use to set up a gl window.

09-01-2000, 11:32 AM
thanx for the glgetstring bit, i used it on my program but it said vendor was microsoft corporation and rendering was gdi generic. this is a REAL bad sign i suppose. so how do i get my card, specifically ati rage pro turbo, to work? right now my window is a win32 program set up to be a popup window whose size is the screen resolution. am i supposed to set it to something special first before my gfx accelerator can kick in? i was thinking of using changedisplaysettings... but the problem is that ive never used it before, and in my msdn documentation, it says about the CDS_FULLSCREEN mode "the mode is temporary in nature." i dont know what thats supposed to mean so...

kschroed
09-04-2000, 12:51 AM
Me again. I found this in http://www.3dgamedev.com/resources/openglfaq.txt

Subject 6.01: How do I determine if I'm getting hardware acceleration under
Windows NT/95/98?

After you fill out the PIXELFORMATDESCRIPTOR, do the following:

int pixelFormat = ChoosePixelFormat (hDC, &pfd);

PIXELFORMATDESCRIPTOR pfd_new;
DescribePixelFormat (hDC, pixelFormat, sizeof(PIXELFORMATDESCRIPTOR), &pfd_new);

int generic_format = pfd_new.dwFlags & PFD_GENERIC_FORMAT;
int generic_accelerated = pfd_new.dwFlags & PFD_GENERIC_ACCELERATED;

if (generic_format && ! generic_accelerated)
{
// software
}
else if (generic_format && generic_accelerated)
{
// hardware - MCD
}
else if (! generic_format && ! generic_accelerated)
{
// hardware - ICD
}

Could be interesting for You.

09-06-2000, 07:43 AM
Originally posted by 70741 n3w1313:
thanx for the glgetstring bit, i used it on my program but it said vendor was microsoft corporation and rendering was gdi generic. this is a REAL bad sign i suppose. so how do i get my card, specifically ati rage pro turbo, to work? right now my window is a win32 program set up to be a popup window whose size is the screen resolution. am i supposed to set it to something special first before my gfx accelerator can kick in? i was thinking of using changedisplaysettings... but the problem is that ive never used it before, and in my msdn documentation, it says about the CDS_FULLSCREEN mode "the mode is temporary in nature." i dont know what thats supposed to mean so...

"the mode temporary in nature" means you change it only for the time your program runs. If I understood correct you're trying to make a full-screen output. It'll look on the screen like you use DirectDraw (people think it's DirectDraw when they see windows app running at full screen). One more thing, there are opengl dll's that give software rasterization and there are these that give you calls to 3D accelerator. For 3dfx it's name is something like: 3dfx*.dll (I don't remember exact form) and not opengl32.dll.
Some game developers ask users of the game to copy this dll (3dfx one) in the game's directory and rename to opengl32.dll (I think they assume that windows searches dll's first in the folder that program started from and then c:\windows and c:\windows\system). May be you've got to do something like that (in case you know the name for your card's dll).