Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

XzenoX

Linux

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

On linux: i know opengl seems to work fine and i know directx stuff doesn''t work at all, so to render a 2d plane must i use strickly OpenGL or just declaring the window will make it work on all OSes? I''m sorta new programming and me and a few friends were thinking doing a game and i was wondering if i should be better of starting to program using Linux to ensure compatibility, the other programmers all have win98/2k. I know i can get a compiler fine with linux but will all the code work fine with all OSs if i program Linux or it will end up working only on that(which we don''t want to) Tnx ^_^

Share this post


Link to post
Share on other sites
Advertisement
try SDL, its got some nice 2D bit blitting stuff and is OS independant for the most part, using linux does not guarantee compatibility, its the api''s you use and the way you code that does, the code should compile on all compilers that are standards compliant, though there are issues but mostly it shouldn''t concern you.

Share this post


Link to post
Share on other sites
XWindow programming is different from Windows programming.

The function calls you use to create a window (and such stuff) in Windows won''t work to create a window in X, and vice versa. That''s why GLUT has been developped. If you''re using it to handle the windowing, input and stuff, you should be fine.

As far as files & stuff are concerned, standard C and C++ functions are the same unless you have a faulty install.

Oh, and Microsoft claims that Windows is POSIX compliant (-insert laughter here-)...

Your code will only be as portable as you make it be. Stay away from compiler-specific code or learn to use preprocessor conditionals, like

  
#ifdef linux
// linux specific code

#endif
#ifdef WIN32
// windows specific code

#endif

Share this post


Link to post
Share on other sites
Tnx, basicaly, when using C++ to work with all, or as much OSs, stay away from compiler specific code and just by using SDL and i should try GLUT, O.K

That was great help tnx ^_^

Share this post


Link to post
Share on other sites
Well, since everyone is ragging on MSVC allow me to point out the failings of GCC...

1.) With regards to exceptions, you can''t do this:
try
{
...
throw new exception("Error here"); // bombs here
...
}
catch(exception &e)
{
cout << e.what();
}

2.) GCC does not properly implement the ctype class - behavior clearly specified in the standard (and in examples by Bjarne and others) fail:
ctype()->toupper(str.begin(), str.end()); // fails 


In the final analysis, all compilers have quirks. GCC is an excellent choice if you want to write cross platform code because it runs on so damn many platforms. However, once we move away from the compiler itself we come to more complex issues like wrapping/encapsulate APIs and so forth. Those are major decisions, and a good strategy is a necessity for a successful development cycle.

Then there''s the question of your experience level. If you''re not familiar with Linux, mid-development is not a good time to jump in. Other than that, good luck!

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!