PDA

View Full Version : background ?



McZ
10-09-2001, 03:52 AM
is there any simple way to draw a picture(.jpg .tga or something) as background ?

marcus256
10-09-2001, 04:38 AM
1) Read it using some apropriate function (e.g. libjpeg for jpg files).
2) Upload it as a texture
3) Instead of clearing the color buffer, draw a quad with the texture which covers the entire viewport

This method is insensitive to screen/window resolution since the texture will be sceled to fit the viewport (use GL_LINEAR filtering).

/Marcus

McZ
10-09-2001, 08:01 AM
IŽll try that.
Thanks http://www.opengl.org/discussion_boards/ubb/smile.gif