Jump to content
  • Advertisement
Sign in to follow this  
mrhodes

OpenGL OpenGL on Linux Question

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

Hey everyone, I'm starting work on a small 2D tile based game in Linux and I have decided to use OpenGL for the images. I've currently started using SDL so far, but I'm just wondering if I'd be better off using OpenGL directly using GLX ? Does anyone have any thoughts on performace of both approaches ? As for portability I don't care too much at this point, I'm going to isolate that code and write code for windows later on. Thanks for any replies, Michael

Share this post


Link to post
Share on other sites
Advertisement
If your game is going to be 2D, there is absolutely no need to use OpenGL, SDL itself is perfect for such project, and you have portability covered automagically.

Share this post


Link to post
Share on other sites
GLX is great if all you want is graphics. If you plan to do things like have sound, user input, text, images, and so on you might want to consider using SDL or something like that (eg. Qt) instead.

Share this post


Link to post
Share on other sites
Thanks for the replies so far... I guess I'm more or less wondering if there is a performance benefit to using GLX vs getting a rendering context with SDL. Does SDL add a lot of overhead that could slow anything down ?

Thanks,

Michael

Share this post


Link to post
Share on other sites
I am using it since 4-5 years too and I haven't noticed any performance issues until yet.

Kimmi

Share this post


Link to post
Share on other sites
When using SDL and OpenGL you are only using SDL to generate an OpenGL context. At that point it would be the same if you used GLX to generate an OpenGL context. Any GL calls you make interact with this context and allows you to draw.

SDL is a nice framework to program in due to its expansive facilities and cross-platform support. I would recommend it.

Share this post


Link to post
Share on other sites
Quote:
Original post by noe
If your game is going to be 2D, there is absolutely no need to use OpenGL, SDL itself is perfect for such project, and you have portability covered automagically.


I disagree here. I've been making 2D games, initially using just SDL, but I soon started using SDL + OpenGL instead of just SDL because with OpenGL it's easier, better, faster and allows more effects like alpha channels, rotations, etc...

So, a 3D accelaration library is better for 2D too imho, except if you need things like 2D line art with thick lines, bezier curves, or if you need individual pixel access for e.g. a raycaster, plasma effect or fractal.

SDL provides the easiest and most portable way to set up your OpenGL screen.

Share this post


Link to post
Share on other sites
Thanks for the advice everyone. I think I will stick with SDL + OpenGL instead of GLX. I was looking at some of the GLX code and it does seem a bit complicated to set everything up.

And Lode, I was thinking the same wrt using OpenGL for 2D. I would like to be able to maybe incorporate special fx in my engine and figured that I could get better speed out of map rendering and sprite drawing if I used OpenGL.

Well, no more time to waste ;) I'm going to get working on my code again. Thanks guys

Michael

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!