Cross Platform Dev

Started by
4 comments, last by CoolAcid 22 years, 3 months ago
I have a few questions. 1: Is there a DirectX Wrapper available for Linux/UNIX? Meaning I could write DirectX stuff in windows, and easily port it for UNIX? 2: what is the best (In your opinion) cross platform API? I want to be able to build software that ports easily to Linux/Win32. Thanks, Jason
Advertisement
quote:Original post by CoolAcid
1: Is there a DirectX Wrapper available for Linux/UNIX? Meaning I could write DirectX stuff in windows, and easily port it for UNIX?

Short answer: No.
quote:Original post by CoolAcid
2: what is the best (In your opinion) cross platform API? I want to be able to build software that ports easily to Linux/Win32.

Use SDL with OpenGL (and possibly OpenAL also, although SDL can do sound). It''s what I''m doing, and it works without changing any of my code.


[Resist Windows XP''s Invasive Production Activation Technology!]
Saw SDL.. Thought it was cool.. But looking over the website I saw a few parts that had ifdef''s for unix etc..

Does it work well?
Yeah, SDL is good stuff. Nice to see you again, Cool.

"Don''t be afraid to dream, for out of such fragile things come miracles."
Yeah.. I''m always arround.

Always with ideas.. This one''s a good one tho..
I''m using ClanLib. It''s similar in most ways to SDL but its a bit more "high level" API. That means it has more functionality that may or may not be useful for you. An important difference for you might be that ClanLib is straightly OOP while SDL uses procedural programming.
I haven''t seen much of SDL but I got the impression its easier to use at first. But ClanLib has more functionality imho and once you understood it it makes perfectly sense and provides you with all . I especially like the slot system (you can connect your class member functions with any events like keypresses etc).

The best two things that are (afaik) unique for ClanLib are resource definition files and a decent gui.
The resource thing means that you make a file that lists all of the games resources and gives them a unique name. Then the program can load its resources (mostly files but also strings and constants) using only the name of the resource without needing to know where the data is. That means you can place your files in a data dir and then compile the whole thing into one large data file without changing a single line of code.
The gui is a graphical user interface featuring many controls you know from your favourite OS. It uses the slot system so any of your classes can handle events. You can define your gui from a gui definition file create it on the fly. The look can easily be changed and you can use custom graphics for your controls and also you can add your own controls. Its still not completly done but can already used perfectly.

One main drawback of ClanLib is that it only has ports to Windows, Linux and BeOS, yet and that its limited to C++.

I recommend trying both and then deciding which one you prefer.

hth

Jan Rehders
http://www.turtlegame.f2s.com - my 2D Platformer
Editors available now !

This topic is closed to new replies.

Advertisement