PDA

View Full Version : OpenGL+hardware acceleration



Maciek Sawitus
09-28-2000, 03:17 AM
i'm a real beginner and i would be pleased if anybody can write me how to make my OpenGL programs (in VC++6.0)
working with my hardware accelerator
(3DFX Voodoo 2)..
i mean what to add to my programs working now only with software renderer..

it would be great if anybody can send me any sorce code in VC++ using hardware acceleration (3DFX Voodoo 2)..

thanks in advance everybody can help me

maciek.

[This message has been edited by Maciek Sawitus (edited 09-28-2000).]

Teofuzz
09-28-2000, 11:01 PM
I'm a real beginner too!
It doesn't matters if you have or not some specific card, at least to start writing code...
You only need opengl: if your card supports ogl, in your system 3d accel is already enabled. All you have to do is start writing: some interesting tutorials are in http://www.opengl.org/developers/code/tutorials.html
Good work!

tdavie
09-29-2000, 12:04 AM
Hi, I have been reliably shouted at by many people that on windoze you don't need to do anything to get hardware acceleration, however I have seen evidence to the contary.
I don't know much about how a PC does things, but on a Mac you use a nice piece of code called SetupGL (at www.apple.com/developer). (http://www.apple.com/developer).) It may be some use to you as an example of the sort of things you need to do, on the other hand, it may not.

Bob
09-29-2000, 03:51 AM
Voodoo cards are slightly different from standard cars. They, at least the two first series, requires fullscreen environment to work properly. Dunno how this is done for Voodoo cards, but at leat you know you have to go fullscreen to get hardware acceleration.

Give it a proper pixelformat and you will get hardware acceleration. No need to do anything else, like initialize the card... on Windows at least.

Maciek Sawitus
10-02-2000, 01:01 AM
Thank you teofuzz, tdavie and Bob for your replies.

but it's not so simple...
i know i have to run everything in fullscreen mode..
but when i'm runnig any of, say Nehe's demo it always uses my software renderer
called GDI Generic (Microsoft Corporation) instead of 3DFX Standalone OpenGL Driver as all games i play do..
it's because this GDI Generic seems to be Default OpenGL Driver and any time i use OpenGL it's chosen..
in professional 3D games i can always choose between
- Default OpenGL Driver (software) and
- 3DFX Standalone OpenGL Driver (hardware)

so, the only problem is to activate (choose) not Default ... but real hardware driver of my accelerator..
i don't know how to do this..
by the way it seems to be only problem for those having Voodoo and Voodoo 2 cards, because only they (me too) need an extra graphic card which is used by default..

thanks in advance for any help..
maciek.

tdavie
10-02-2000, 01:07 AM
I have already had a big argument with bob about this one. I am sure that graphics acceleraters must be innitialised before they are used, I have no idea how you do it on a PC but on a mat you use SetupGL (as I said earlier).
I too get the choice of what does the rendering (software or hardware) when I play games but bob swears that it dosn't exist.

xvs
10-02-2000, 02:07 AM
Ok, here's the catch: on "normal" 3D cards, simply linking to opengl32.lib will load opengl32.dll, the MS OpenGL lib, which then decides if it wants or not to use the hardware driver. The problem is, on Voodoo's (1 and 2), you must dynamically load 3dfxogl.dll (or something like that...this is all IIRC) instead of opengl32.dll (I'm not entirely sure how, as I've never done such a thing). Hope this helps.

Bob
10-02-2000, 03:18 AM
In Win32, you can use LoadLibrary, GetProcAddress and FreeLibrary to load functionpointers from a .DLL file. Don't remember exactly how they work, but you can look in some documentation or help file. They are pretty stright forward, and not that hard to use. This way you can load the functions from 3dfxogl.dll.

tdavie:
Well, don't wanna start a new argumentation here or anything, even though it was a bit funny http://www.opengl.org/discussion_boards/ubb/smile.gif
In the code I use (which is, in general, the same code as most Win32 users use) there are no special functions for initializing the card. I use the following functions:

CreateWindow - Creates a standard window, nothing to do with OpenGL
ChoosePixelFormat - Tells you what pixelformats are available
SetPixelFormat - Set the pixelformat you choose
wglCreateContext - Creates an OpenGL rendering context
wglMakeCurrent - Activates the specified context

Now I'm done. No special functions for initializing the card, and It's fully hardware accelerated. And if you haven't used Win32, then how do you know what you have to do or not?

As I said to you in the other topic, where we held the major argumentation, I said I'm not playing games that much. And I didn't say they don't exist, I said I haven't seen any place where you can choose to use the OpenGL software renderer. I have seen a place where you can choose renderer, but then you can only choose between my TNT and my Voodoo 1, and both of 'em was hardware, no software option in OpenGL. I have seen a software option, but then it was DirectX and not OpenGL. If you feel like continue this discusion, I sugest we either start a new topic, or just keep it between the two of us (in other words, via e-mail or so). Don't wanna spam other people questions with our arguments.

p.s. Maybe I sound rude or so, but my intention is not to... http://www.opengl.org/discussion_boards/ubb/tongue.gif

[This message has been edited by Bob (edited 10-02-2000).]

Punchey
10-03-2000, 09:46 AM
Here's the deal. In Windows, you don't need to do anything extra aside from having your video card's OpenGL drivers installed. Here's where the catch is: 3DFX sucks. The reason I say this is because they have only recently released an OpenGL ICD. Prior to that they used a stupid "miniGL" driver which didn't work worth didley-squat on anything but big name commercial games such as HalfLife. If you're still using a Voodoo1 or 2 then chances are, you don't have full OpenGL drivers and that's why. Also, if you have a multi-monitor configuration using two different types of video cards (and thus two different OpenGL drivers) you must go into Display Properties and disable one of the cards so the system can choose a hardware OpenGL driver. Otherwise, it'll use the software renderer (GDI). If you havn't already, go to 3DFX.com and try to get a newer driver for your card.

ben
10-03-2000, 11:34 AM
My experience has been that (under Windows) the key to getting the acceleration is to choose the appropriate pixel format. Due to some vendors' OpenGL drivers not working correctly, I have included in my app an option to turn hardware acceleration on or off (if the machine has an accelerated card). When turned on, I will get the card vendor's renderer. When turned off, I get Microsoft's software renderer. The only thing that changes between the two is how I pick the pixel format. Nothing else. I've tried this out on many cards (ATI, Oxygen, Diamond FireGL, etc, but not a Voodoo yet) and the hardware accleration toggle works the same on all of them.

Hope this helps.