PDA

View Full Version : new to opengl on windows platform



mpratscher
11-01-2002, 01:37 PM
A couple of questions:

Where can I find a good starter explanation for using opengl in windows? I have 'the white book', but I didn't know if there was something a little more up-to-date out there.

How do I know if the generic implementation of opengl is being used, or if the card's driver is being used? I have used opengl on sgi's and most of my dev has also been on that platform, so all this dll and icd and so on is new to me.

where can i get opengl 1.2? I read about something called glsetup (?) to install the proper drivers, but it has been beta for like 2 years? is it safe to use?

From the little I have read in the white book (Ron Fosner), it mentions something about the PIXELFORMATDESCRIPTOR not supporting alpha? Does this mean you can't use alpha values when using RGBA? Is there any way to get alpha / transparency support on the win platform?

Last one... does the rendering context work through the device context? I guess I'm asking, can opengl not do anymore than the device context will allow it too? (I guess this would explain no alpha support, if it's true, since a device context does not support alpha, correct?)

Thanks for spending some time helping me out.

Mike

nexusone
11-02-2002, 03:59 AM
First the video card maker writes the openGL drivers and if you have a Nvada or ATI will have drivers that support the most up todate openGL features. And the openGL driver will be loaded with the standard windows drivers. But note maybe on older cards, check to see if they have updated the openGL drivers for them, by download the lastest drivers or checking on there openGL support for that card.

Platform support for openGL is by the OS maker. MicroSoft pushing Direct X only has support for I think only openGL 1.2 in there library's, but if you current video card supports the newest opengl features, you can access them using openGL extensions. People like ATI and Nvada have these examples on there websites.

Hardware use is automatic, there are ways to poll your card to see what features are hardware accerated and which will be done via software. Also I have seen a utility that will poll them for you, and let you know your video cards openGL support.

As for Alpha support, I think maybe he is talking about windows BMP files format?
Which does not support an alpha channel, I use TGA file format for my images which has a alpha support.
But in windows openGL rendering, alpha and transparentcy are supported just the same as in all other platforms.


Originally posted by mpratscher:
A couple of questions:

Where can I find a good starter explanation for using opengl in windows? I have 'the white book', but I didn't know if there was something a little more up-to-date out there.

How do I know if the generic implementation of opengl is being used, or if the card's driver is being used? I have used opengl on sgi's and most of my dev has also been on that platform, so all this dll and icd and so on is new to me.

where can i get opengl 1.2? I read about something called glsetup (?) to install the proper drivers, but it has been beta for like 2 years? is it safe to use?

From the little I have read in the white book (Ron Fosner), it mentions something about the PIXELFORMATDESCRIPTOR not supporting alpha? Does this mean you can't use alpha values when using RGBA? Is there any way to get alpha / transparency support on the win platform?

Last one... does the rendering context work through the device context? I guess I'm asking, can opengl not do anymore than the device context will allow it too? (I guess this would explain no alpha support, if it's true, since a device context does not support alpha, correct?)

Thanks for spending some time helping me out.

Mike

mpratscher
11-02-2002, 08:38 AM
nexusone,

thanks for the reply.

I have an ATI Rage Fury MAXX and the most up-to-date driver for it. But it is dated and there is not a more recent version out there. That is why I was curious about obtaining 1.2. I believe the driver only supports 1.1 but I'll know for sure as soon as I get it running on stupid windows.

As for the alpha thing, I'm not sure what the book is talking about. It just mentions that the PIXELFORMATDESCRIPTOR does not support alpha. I guess the PFD is used to set up the device context and then the rendering context is overlaid on the DC? So maybe using GDI on the DC doesn't support alpha? I don't know, especially since this is all new to me.

Thanks again. That info about the drivers was helpful. I'm sure I'll learn more as I go.

Deiussum
11-03-2002, 04:01 PM
You can use glGetString(GL_VERSION) to find what version of OpenGL your drivers support, and glGetString(GL_VENDOR) and glGetString(GL_RENDERER) to find out who wrote the drivers. If those return Microsoft's implementation, you aren't likely going to get any hardware support.

The version of OpenGL of the default MS implementation is 1.1, but if you're driver is higher than that, you simply use wglGetProcAddress() to get access to the 1.2 or greater functions.

The book was probably talking about using a DESTINATION alpha with the PIXELFORMATDESCRIPTOR stuff. Most blending you would do would use SOURCE alpha, which doesn't require you to have a destination alpha buffer.

Edit:
I should probably also note that in order for ANY gl function to work INCLUDING glGetString(), you need to have an OpenGL context created. If you're using Win32 to create your window, this means the wglCreateContext method. If you're using glut, you need to have done glutCreateWindow first.

[This message has been edited by Deiussum (edited 11-03-2002).]

nomad82
11-05-2002, 06:11 AM
i have some tutorials too on beginners with win32 and opengl (and using the two together) at:
http://nomad.openglforums.com

hehe (shameless plug...:/) ) but i hope it helps!

*Aaron*
11-05-2002, 07:23 AM
One more point: You can tell if a particular pixel format will be using Microsoft's generic implementation or the your video card vendor's implementation before you select it. If the dwFlags member of the PIXELFORMATDESCRIPTOR structure has the PFD_GENERIC_ACCELERATED bit set, it is your hardware manufacturer's, and if it has PFD_GENERIC_FORMAT, it is Microsoft's. Of course, individual features of OpenGL (e.g., 3-d texture mapping) can be implemented in software even if you have an accellerated pixel format. As far as I know, the only way to test this is to use a feature and see how fast it is.