Sign in to follow this  

API Question.

Recommended Posts

Original post by orcbane145
I am curious if you can program some of the game in OpenGL and some of it in D3D.
is that possible because i am working on a project that some people prefer one or the other.

I think in the context of what your asking, the answer is "yes". Games can support options to render in either opengl or directx. However, the objects used by the two are generally incompatible, so you'll either have to write two rendering systems, or create an abstract layer between your game data and the rendering system being used (dx or opengl). Either one of these approaches can get quite complicated.

If the "other people" you mentioned are developers you're working with, this gets to be even more of a problem. Since, generally speaking, you want the DX and OpenGL screens to look the same, you'll have to double check and make sure all the developers are coding for the same kinds of effects / lighting / textures / etc. What this usually means is having developers that know how to do the same thing in both system.

The easier solution here (not to stifle creativity or the learning process) would be to use an existing rendering library that handles both DX and OpenGL such as crystal space or Ogre3d. But these have their own learning curves. If you're limited in resources, I would recommend just picking one and leaving the other out for now.


Share this post

Link to post
Share on other sites
No. They aren't compatible APIs. Games render graphics using OpenGL or D3D. Some games have code that supports both (yes, redundant code). However, one cannot mix OpenGL and Direct3D.

If you have a number of people who offer OpenGL expertise, and others who offer Direct3D assistance, you will have to choose.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this