Advertisement

Glut & opengl only for 2D [Question]

Started by September 28, 2015 01:16 PM
4 comments, last by AneuryPerez 9 years, 3 months ago

Greeting !!

I have a question , I always look that when we use use opengl or derivate we alwasy rely on SDL or a window manager

but is there any way that I can use OpenGL or derivate without use other library ,framework or other ?

thank you in advance... !!

Hi!

To use OpenGL, you need a window to draw to. This means you'll always need some kind of window manager. Either use the OS's native one, or a cross-platform one, like SDL. The benefit of the latter is that it abstracts away a lot of platform-specific details you won't have to bother with, and a lot of work is already done for you.

If simply not using SDL or any other "library", you could do fine with using a native window handler ( WinAPI for example ). Technically that's another library, but I think that's okay, you can't really go lower-level from there.

Now, I'm not entirely sure about this one, but technically you could do "without a window" on some Linux distros when no GUI is present. Then again, you still need to request a surface, which is pretty close to using a window manager. I could be wrong on this one, and I don't advise going this route.

On the other hand, if SDL seems like an overkill, try GLFW. It handles windows and input to some limited extent. You'll have to do anything else by yourself.

Advertisement
I second GLFW. GLUT is far out of date and no longer supported.

it seems I Change SDL2 to glfw But another question is possible make full 2d game using opengl, maybe this question seem a litle bit dummy but now I want to re-writte my PONG game at this library.. thank you for your answer.

Yes, OpenGL is well suited to 2D rendering. Google "OpenGL orthographic projection" to get started. You could also use DirectX, if you wanted. 2D is 3D, missing a D. *wink*

I will look for it , thank you !!

This topic is closed to new replies.

Advertisement