• Advertisement

Archived

This topic is now archived and is closed to further replies.

2D-elements with GLUT?

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

Can I draw 2D elements like scores or energy with GLUT? If not, is using OpenGL with SDL a good choice (not DirectDraw! I want to programm for Linux)? Thanx Konstantin

Share this post


Link to post
Share on other sites
Advertisement
Some things can be drawn with gl. An energy bar with (say) ten states could be implemented as a quad and a texture that holds each of the states. When drawing the quad, use the part of the texture that holds the image for that state.

If you want to draw text, you''re better off using SDL (or some other 2D API, SDL is portable though, and that may make it your first choice, it''s also almost certainly faster than you could do it with Xlib or GDI, unless you are good are writing fast Xlib or GDI stuff (I know I''m not)).

Uuuuuulrika-ka-ka-ka-ka-ka

Share this post


Link to post
Share on other sites
Don''t use OpenGL when you''re using SDL''s video functions. SDL is a good way to do all the OS specific code combined with OpenGL for the graphics, just don''t use both for graphics at the same time. 2D stuff is pretty easy in OpenGL anyway. I''ve answered the how to do 2D in OpenGL question dozens of times.

[Resist Windows XP''s Invasive Production Activation Technology!]

Share this post


Link to post
Share on other sites

  • Advertisement