PDA

View Full Version : Detecting Accelerated OpenGL and switching to the correct size



Paul Hoad
02-07-2000, 12:00 AM
Perhaps this should be a beginners question
but I'm not sure so I'll ask it here instead.

I've been using opengl for some time and now
I'd like to use the capabilities of my Voodoo2 card instead of using microsofts software opengl32.lib

how do I go about detecting a hardware capable opengl device when I simply copy
the 3dfxogl.dll to my exe dir and then rename
it two opengl32.dll it starts ok but the opengl screen is only in the bottom half of
the display.

Possibly this is a resouluation, ChangeDisplaySetting thing I'm missing?

Can anoyone help me

Paul

paolom
02-07-2000, 01:25 AM
Originally posted by Paul Hoad:
Perhaps this should be a beginners question
but I'm not sure so I'll ask it here instead.

Actually, I am a beginner...



how do I go about detecting a hardware capable opengl device
mmmhh... You cannot: simply that.
OpenGL specs state that core functions are always to be implemented by an ICD: which functions are accelerated by hardware is not an application's concern.



[...] it starts ok but the opengl screen is only in the bottom half of
the display.

OpenGL do not provide windowing APIs.
You have to write code for setting up the desired video mode, appropriate to the target platform. Or, alternatively, you could use GLUT, like I currently do for simple apps.

Anyway, I would suggest you to get GLsetup and install the driver from it.

Greetings.

[This message has been edited by paolom (edited 02-07-2000).]

Delphi3D
02-07-2000, 11:44 AM
You can use the 3dfx driver by renaming it, but to get it to run properly, you need to make sure your window is maximized and borderless. Also, use ChangeDisplaySettings() to set 800x600 or 640x480 (something the Voodoo2 can handle).


[This message has been edited by Delphi3D (edited 02-07-2000).]

Jeffry J. Brickley
02-07-2000, 11:59 AM
Originally posted by Paul Hoad:

how do I go about detecting a hardware capable opengl device when I simply copy
the 3dfxogl.dll to my exe dir and then rename
it two opengl32.dll it starts ok but the opengl screen is only in the bottom half of
the display.

Paul[/B]

I have not used the Voodoo Cards, as yet. However, with other cards, under Windows, you can querey the WGL Context to find out if the accelerated mode bit is on. Usually this would be rather odd in your application if it is always going to use the same board. If you look at your documentation for the board, you should discover what modes use OpenGL acceleration. I have found other boards only accelerate in 16 bit modes, others in 24 bit modes, and at least one board only in 800x600x16 only. None of these, however, were Voodoo boards, so check your manufacturer documentation to find out which modes are accelerated. Once in an accelerated screen mode, use of the accelerated opengl drivers SHOULD be automatic.
Just me,
Jeff

DJSnow
02-07-2000, 02:21 PM
Yes, Paolom is right.
OpenGL uses the functions of the ICD (installable client driver), provided by your hardware reseller. by installing these drivers, opengl32.dll is copied automatically to your windows-root, with this action it overwrites the old one: in your case the microsoft-provided software-implementation of OpenGL. But mmmh, with your voodoo2-card this can be a little bit tricky: voodoo-cards are using glide, a smaller "re-implementation" of OpenGL - it differences from hardware to hardware. The trick ,mentioned above, with renaming your glide-driver is a "no-official", but working method. But if your now want your game running on an other platform, it will crash perhaps, causī your glide-driver does support a lot of functions of OpenGL, but not *all*. This diefferences again from hardware to hardware. This is one of the big advanteges of "real" OpenGL: its platform independent - your can be sure if your app is running properly, it will do the same on every other system with an opengl-implementaion (software-implementations, too). But there is still one question to you: Where do you get a function-list of the
functions, your driver is supporting ?
Does anyone else have a solution ?

DjSnow

Paul Hoad
02-08-2000, 01:05 AM
I appreciated everyone taking time to give me some adivce here. let me tell you what I done since I posted last

Well have managed to get my app running full screen that wasn't a problem

but its still in software mode
copying the 3dfxog.dll over doesn't work it
is there its just as if the screen is offset vertically by about half.

So now I'm thinking how does Quake3 detect
the 3dfx opengl there must be some code somewhere that does through all the hassles
of detecting my 3dcard without the need
for me to copy over the opengl32.dll or renaming the 3dfx dll

Paul

paolom
02-08-2000, 04:29 AM
DJSnow: what do you mean by a "function-list of functions"?
I interpret this as "a means of knowing what functions are implemented by the driver".
If this is the question, the answer is this:
ICD must implement all of core functions, and are allowed to provide software implementations for whichever core function they want to.
3dfx, to my knowledge, comes with an MCD (mini client driver): it's a different kind of driver, in the sense that it does not provide all of specified core functions.

So the problem becomes to find a way to detect if we're running an ICD or an MCD driver on the system.

If I missed the point, please make me clear what you were talking about, with function-lists.

Paul Hoad
02-08-2000, 05:06 AM
I got this from the OpenGL Game Developers FAQ to do what you suggest.

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
DebugOut( "Software Mode");
}
else if (generic_format && generic_accelerated)
{
// hardware - MCD
DebugOut( "Hardware - MCD Mode");
}
else if (! generic_format && ! generic_accelerated)
{
// hardware - MCD
DebugOut( "Hardware - ICD Mode");
}

paolom
02-08-2000, 05:12 AM
Do you have some clues about a similar working solution for Linux?

DJSnow
02-08-2000, 11:59 AM
Mmmh, Paolom, your right with your interpretationof my definition. Havenīt you recieved my email ?
A way for linux ? uh, iīm a pure windows-coder, sorry !