Unsure

Started by
2 comments, last by caffeineaddict 22 years, 9 months ago
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.
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.
--What are you nutz?I have nothing to say to your unevolved little brain. The more I say gives you more weapons to ask stupid questions.
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
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.

This topic is closed to new replies.

Advertisement