Jump to content
  • Advertisement

Archived

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

Unsure

This topic is 6149 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

I posted this in the OpenGL forum, i''m posting it here only because i''m not really sure where i will get the most help. Ok, i''ve been reading some directx books and opengl books, and in the directx book it showed how to set a video mode and resolution, etc. I was wondering if there was a way to set the window up using DirectX then just use OpenGL code for the graphics? If you can help it is appreciated.

Share this post


Link to post
Share on other sites
Advertisement
DirectX is the only API for graphics that directly speaks to the HAL,(Hardware Abstraction Layer).

When using OpenGL, it makes requests to the OS, where the OS talks directly to the HAL.


To use OpenGL, with resolution (changes) you must use the DEVMODE that is in the WINAPI. Do this just before you call CreateWindow(Ex). By default the resolution is 800 x 600. Catch 22, You are responible for returning the mode to its orginal state.

Share this post


Link to post
Share on other sites
Some games (eg Quake3) use DirectDraw to change the screen mode, and then render using OpenGL, but using ChangeDisplayMode() should work just as well.

DirectDraw has been taken out of DirectX8, and I''m not sure where all the display mode functions are held now, but they''ll be around somewhere. What you do NOT want to do is set up a window for DirectX and OpenGL at the same time, this will either not work or be very slow.

Check out the NeHe samples for how to set the display mode through the API.

The display mode enumeration seen in DX can be got through the EnumDisplayModes() function. I really don''t see much advantage in using DirectX to set up the display mode, as you are requiring the end user to have the bloated DirectX8 installed

FatalXC

Share this post


Link to post
Share on other sites
Actually, the end user would need directx installed anyway since i''m going to be using directx for input, audio and eventually networking. Thanks for the responses though, it just seemed easier in the demos i''ve read in the books to setup the window with directx and then make graphics calls with opengl, but i think it would be best to stay with 1 api for the different sections of code and not mixing them.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!