Jump to content
  • Advertisement
Sign in to follow this  
omagaalpha

2d opengl game help

This topic is 4369 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 have look at lot 3d tutorial, at time though jump into what want to program in but it never amount to much. Recendtly I found a good series tutorial that basic stuff for 2d tutorials but problem is that it is a SDL which is not good for make 3d games. My goal is to get to make 3d games. I have choose to use opengl to do 3d games for it easy export for other os, and other option which is Direct3d seem lot more complicated. But as most people will tell you it is very bad to just jump into make 3d games. You need make 2d games to build up skill in proggraming games. ____I have look in Beginner section but seem 2d opengl is not really lot about it in it. As for google I did not get very good answer when I try 2d opengl. I know for fact that opengl can at least do 2d for interface but have not seen for entire game, I don't know weather it really wise thing to do. So should I use opengl fo 2d game or use sdl? Sorry for grammer problems in my writing. [Edited by - omagaalpha on July 3, 2006 6:08:13 PM]

Share this post


Link to post
Share on other sites
Advertisement
Have you done a graphics game before? If so, then use OpenGL for 2d so you can get the hange of it. Otherwise, just use SDL for a few 2d games as it will make things *really* simple for you.

And - if you learn SDL, later on you can continue using it's windowing system, event system, sound system, etc. but you can integrate OpenGL for the graphics when you learn OpenGL.

I'm not exactly sure where to find OpenGL 2d info, but look around for OpenGL "orthogonal" or "ortho" tutorials/info.

Basically you set up an ortho project and use it as if it was simple 2d.

Share this post


Link to post
Share on other sites
Since OpenGL is only a graphics engine and you will need drivers for input devices and sound as well, use SDL and OpenGL together. You'll need the SDL libraries to load in your textures from most graphics formats and SDL_Mixer will play most sound effect formats as well.

OpenGL is difficult to use when writing a 2d game so maybe a wrapper library like hxRender or glSDL would help to convert your graphics calls to their equivalent OpenGL functions. As an added bonus, both of these libraries will split textures that are not powers of two into multiple textures internally so your program will not crash.

The author of hxRender is in the process of writing a tutorial for his library used toghether with SDL but I'm not sure how far along he has gotten yet.

Share this post


Link to post
Share on other sites
Thank you very much for helpfulness. I was look at NEhe's tutoral notice something different "int InitGL(GLvoid)". What does GLvoid do that void does not do for you?

Share this post


Link to post
Share on other sites
OpenGL uses its own typedefs for portability reasons as does SDL. Personally, I'd use SDL's types when not dealing directly with OpenGL itself because SDL supports endian swapping if you know how to ask for it. (See SDL_endian.h for details.)

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.

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

Sign me up!