2D-elements with GLUT?

Started by
1 comment, last by Cone83 22 years, 6 months ago
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
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
CoV
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!]

This topic is closed to new replies.

Advertisement