Jump to content
  • Advertisement
Sign in to follow this  
Zapeth

OpenGL Whats the easiest DirectX version to port from?

This topic is 1819 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 was unsure whether to post this in the DirectX section or in the OpenGL one but since I ultimately want to port the game I have over to OpenGL (I'd like to make it cross-compatible) I figured its better to post here.

 

So I have a source code for an old game which uses DirectX 6. And I was wondering if its better (or easier) to upgrade it to a later DirectX version and then port it over to OpenGL or just do it directly.

 

Also I would like to know if there is some kind of reference (like what are similar functions or what is necessary to use instead) or some useful tipps for porting?

Something like this would surely come in handy since I never did such a thing before ;)

Share this post


Link to post
Share on other sites
Advertisement

New DX has almost nothing similar with DX6. I almost sure that it would be better and faster if you would write your OpenGL renderer from scratch. It wont take you much time to achieve DX6-level graphics with newest OpenGL. 

Share this post


Link to post
Share on other sites

I didn't mean to update to the highest available DirectX version anyway, I just wanted to know what "the best" would be (the highest I would try to go for is DirectX 9).

 

And I was unsure because it seems to be harder to find reference for DirectX 6 than newer versions. But I guess it would be easier to do it directly since I also heard that updating DirectX is no easy task either (especially for older versions).

Edited by Zapeth

Share this post


Link to post
Share on other sites

Sorry for the double post but I figured this would still fit in here.

 

So after spending some time with OpenGL tutorials I'm wondering which OpenGL version I should aim for porting.

I read here and there that 2.x should be sufficient for DirectX 6 games, is that true?

 

But even if it is, should really do it or rather aim for 3.x or maybe even 4.x?

The main concern I have with this is that it could end up requiring some deeper source modifications (than with an older OpenGL version).

Edited by Zapeth

Share this post


Link to post
Share on other sites

This is entirely dependent on your intended market and usage of the thing you are trying to convert... only you can know the answer.

Choosing a version means leaving some hardware class in or out of your project.

Do your researches.

 

The idea of converting a DX6 to another DX version IN ORDER to convert it again to OGL is quite silly honestly.. I really don't know how you guys come up with these crazy ideas, it hits me every single time.

Share this post


Link to post
Share on other sites

This is entirely dependent on your intended market and usage of the thing you are trying to convert... only you can know the answer.

 

Well I want it to be cross-platform compatible (mainly support for Linux but if it opens the road to other platforms too then that would also be appreciated) and supported by nowadays hardware (support for older hardware would be good too but its not a requirement).

Also I would like to avoid making any deeper code modifications and as I said I would imagine that 3.x+ requires deeper changes.

 

 

The idea of converting a DX6 to another DX version IN ORDER to convert it again to OGL is quite silly honestly..

 

I believe I made it clear in my penultimate post that I decided not go down that road and that the idea is pretty much "silly" but whatever...

Edited by Zapeth

Share this post


Link to post
Share on other sites

Thinking longer about it wont make it much easier to decide, you better just look at the sourcecode what actually gets done there and then use the most similar thing you can find in OpenGL to replace it and thats most likely something old for your old DX game.wink.png

Share this post


Link to post
Share on other sites
Porting software is always fiddly (which is why I often avoid using DirectX in the first place).

Hopefully in your existing game you have wrapped things like vertex buffers and meshes in classes (I doubt you will be using shaders for DX6 level code).

Write a very small OpenGL application using all the equivalent functionality your game uses (to make sure everything is working) and then go through your code swapping out the individual parts.

Now the hard bit for porting DX to OpenGL (or the other way round) is that it is pretty much all or nothing ;). You will need the majority of the port to be complete before you start to see any results.
To get round this you can go for an intermediate where the code for both APIs is in the game (perhaps in #ifdefs) just to make sure everything still compiles.

As for replacing the Windowing system, even though Glut is simpler, I find SDL to be a closer match to the event driven way the WinApi works. Edited by Karsten_

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!