Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

sysmark

OpenGL DX coder trying to use OpenGL...

This topic is 6358 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Allright, here''s my problem. When programming Direct3D I always create a class that handles all the system information for me (just as the example apps), like enumerating the display devices, the videomodes, system capabilities, etc. This makes me happy, because I know the program will work on most computers. Allright, now I''m using OpenGL (demo group, but all the others are to dumb to use D3D) (just kidding!). I know GL has to be cross-platform and all, but there has to be a way to find out simple stuff like supported videomodes, or even which render devices are installed (and a way to select them). I mean, it would be nice If I could detect if a videocard can do 8 bits stencil buffering or not... Or maybe even hardware T&L. So does anybody know a way (or documentation explaining it) of how to do any of the above?

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
Setting up the enviroment is not easy if you want it to work on multiple platforms. I would check out the GLUT sources or better just use the GLUT library.

Most OpenGL programs does not care much about checking the hardware features. You just ask for some features and the system should give you the best, closest enviroment available. The common way with Direct3D is as you wrote to do a lot of enumeration and try to take full advantage of the card. I guess this is because of the different backgrounds. OpenGL comes from a hardware rich enviroment but Direct3D has the opposite background.

I think the OpenGL approach is much more relaxed and fun but if you really wants to worry about the hw can you do it but D3D is probably your kind of API.

Share this post


Link to post
Share on other sites
There''s ways to do that using the Win32 API. Like you said, OpenGL has no platform specific things within itself. There are Windows specific extensions however. I don''t personally know how to do it with the Win32 API, I just know it is technically possible.

"Finger to spiritual emptiness underlying everything." -- How a C manual referred to a "pointer to void." --Things People Said
Resist Windows XP''s Invasive Production Activation Technology!
http://druidgames.cjb.net/

Share this post


Link to post
Share on other sites
GetSystemMetrics(parameter)

check it out in vC++ docs

there''s a way to check hardware configurations too in OGL I just forget what it is...

-----------------------------------------------------------
"If I wanted to hear the pitter patter of little feet I would put shoes on my cat"

Share this post


Link to post
Share on other sites
There are a number of functions that will prove useful to that end:


EnumDisplaySettings
ChangeDisplaySettings
SetDeviceGammaRamp


Of course, these are all Win32 API functions, so you''ll find them documented in MSDN.

Share this post


Link to post
Share on other sites
That just proves what an idiot I really am, I never even thought about checking the win32 specs.... Thanks loads guys!

Oh and yes, D3D IS my kinda API, but GL is ok too.

Share this post


Link to post
Share on other sites
my personal opinion says that OpenGL is better for begginer and D3D not (my own experience- i''m begginer)

Share this post


Link to post
Share on other sites
I started 3D with directX but recently changed to OpenGL. The reason was that my D3D programs worked well on my macine but it used to crash on others computers. I think OpenGL is very nice, clean. Well, DirectX8 is by far getting near to OpenGL. Initialization can be done by one call, before it ned many numerations.

In WinAPI you can use EnumDisplaySettings,EnumdisplayDevices and changedisplaySettings... or use GLU.

One thing I hated Direct3D was resource invalidating and restoring and surface losts (Is it really to be implemented?).

Share this post


Link to post
Share on other sites
OpenGL may be easy to pick up (NeHe helps a lot), but it sure isn''t for beginners. I wrote a Quake2 model viewer in 2 days using D3D8, but it took me about a week to convert it to OpenGL!!! It''s just that I had a little trouble understanding the logic behind OpenGL. OpenGL just hides to much from me, and the way the matrices are handled is just plain scary. D3D8 in combination with D3DX8 is way better if you ask me, as you have total control over what Direct3D does.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!