OpenGL on Linux Question

Started by
6 comments, last by mrhodes 15 years, 1 month ago
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
Michael RhodesTiger Studios Web Designhttp://tigerstudios.net
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.
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.

Stephen M. Webb
Professional Free Software Developer

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
Michael RhodesTiger Studios Web Designhttp://tigerstudios.net
I am using it since 4-5 years too and I haven't noticed any performance issues until yet.

Kimmi
A complicate solution may indicate a not understood problem.


[twitter]KimKulling[/twitter]
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.

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.
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
Michael RhodesTiger Studios Web Designhttp://tigerstudios.net

This topic is closed to new replies.

Advertisement