Sign in to follow this  
AneuryPerez

Glut & opengl only for 2D [Question]

Recommended Posts

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... !!

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this