Jump to content
  • Advertisement
Sign in to follow this  
BloodLust666

DirectX AND OpenGL

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

is it possible for my game engine to use either DX or OGL? or both?? such as OGL graphics and DirectSound? or some other combination? what about both doing graphics?

Share this post


Link to post
Share on other sites
Advertisement
Yes, it can work.

Direct3D and OpenGL won't necessarily play nice as they're both going to be trying to use the same hardware and do the same thing. Using OpenGL for graphics and XInput/DInput for your controller and DirectSound for audio seems to be a fairly common combination.

hth
Jack

Share this post


Link to post
Share on other sites
It's possible for both to do graphics, I'm just not sure if at the same time. Some 3D rendering packages give you the option to render in OpenGL or Direct X. You just have to design your rendering engine so it's flexible enough to use different APIs.

Share this post


Link to post
Share on other sites
Ogre is an example of an engine that has renderers for both OpenGL and Direct3D. You'll notice that they have abstract classes which act as a template for the rendering system so that you can make a new renderer for pretty much any API you want to.

Share this post


Link to post
Share on other sites
Please, correct me if I'm wrong, but I think you can't use OpenGL and Direct3D at the same time (they couldn't use the same graphic device at the same time).
The engines allow us to select the graphic API (OGL or D3D) before the application starts. That is, I think it is not possible to render, in the same viewport, one mesh using D3D and another mesh using OGL.

Share this post


Link to post
Share on other sites
I'm probably wrong but there should be no reason why you can't use two graphical API's at the same time. I know people who have used regular renderers and raytracing at the same time (for things like hair).

You should be able to happily draw several objects to seen in DirectX, and then loop through the other objects in openGL. All your doing as adding data to the framebuffer and it shouldn't care where the information comes from.

What you will have problems with is that openGL and DirectX have their Z axes pointed in different directions. You have to mess around with the geometry. Per frame this would be way too slow.

I'm a bit confused by the initial post tho. Do you want to using both at the same time...or do you want to be able to switch from DirectX to OpenGL just as you would change resolution?

Share this post


Link to post
Share on other sites
Of course you can use both APIs at the same time - if you have multiple adapters* [wink]
* complete and total assumption

But yeah, if you want to achieve something like what Orge does, its not altogether to abstract the APIs and have a common interface. The only hard part is when you get into the more advanced stuff and not everything matches up exactly.

Share this post


Link to post
Share on other sites
Of course you can use both simultaneously. I'm running Duke Nukem MP (Direct3D8) and a NeverBall (OpenGL) simultaneously in two separate windows right now.

Share this post


Link to post
Share on other sites
You could use OpenGL for graphic rendering, DirectInput for input handling and SDL for window management...... Although I don't really see the point.

Share this post


Link to post
Share on other sites
Quote:
Original post by doynax
Of course you can use both simultaneously. I'm running Duke Nukem MP (Direct3D8) and a NeverBall (OpenGL) simultaneously in two separate windows right now.


I guess there might be a problem if you use both APIs on the same render target, you could however use both if you delegate a separate render target to each.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!