Jump to content

  • Log In with Google      Sign In   
  • Create Account

Whats the easiest DirectX version to port from?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
7 replies to this topic

#1 Zapeth   Members   -  Reputation: 103

Like
0Likes
Like

Posted 10 August 2013 - 11:57 AM

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 ;)



Sponsor:

#2 GuardianX   Crossbones+   -  Reputation: 1522

Like
0Likes
Like

Posted 10 August 2013 - 02:06 PM

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. 



#3 Zapeth   Members   -  Reputation: 103

Like
0Likes
Like

Posted 10 August 2013 - 02:41 PM

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, 10 August 2013 - 02:42 PM.


#4 Zapeth   Members   -  Reputation: 103

Like
0Likes
Like

Posted 02 October 2013 - 09:04 AM

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, 02 October 2013 - 09:04 AM.


#5 kunos   Crossbones+   -  Reputation: 2207

Like
0Likes
Like

Posted 02 October 2013 - 09:09 AM

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.


Stefano Casillo
Lead Programmer
TWITTER: @KunosStefano
AssettoCorsa - netKar PRO - Kunos Simulazioni

#6 Zapeth   Members   -  Reputation: 103

Like
0Likes
Like

Posted 02 October 2013 - 09:54 AM

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, 02 October 2013 - 09:55 AM.


#7 wintertime   Members   -  Reputation: 1876

Like
0Likes
Like

Posted 02 October 2013 - 10:13 AM

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



#8 Karsten_   Members   -  Reputation: 1655

Like
0Likes
Like

Posted 02 October 2013 - 03:39 PM

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_, 02 October 2013 - 03:41 PM.

Mutiny - Open-source C++ Unity re-implementation.
Defile of Eden 2 - FreeBSD and OpenBSD binaries of our latest game.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS