Opengl rendering on image background


I am new at using OpenGL and was wondering if
anyone knows if you can render OpenGL on top of a
static background image, such as a .png, .jpg, etc. I have an application where I need to create a gui containing a image background (a drawing) that will, at times, have graphical objects moving over the top of it. I was hoping that I could use OpenGL to do the object rendering over the image background. Any help/info on the coding steps involved or where to get examples on how to do this would be greatly appreciated.


There are many ways to do this. It depends on how much performance you want, how much flexibility you want, and what way you want to go about it.

First way would be to just draw the image using your window system’s API.

Second, you could use glDrawPixels, but that would not perform well if you redraw the background alot. I’ve never done it but my understanding of pixel buffer objects is that they would speed it up.

Third, probably the easiest way would be with texture mapping. There are thousands of tutorials out there for this method.

Omaha - Thanks for your reply. Performance won’t be an issue with the gui since any data updates I receive will be limited in duration. I’ll look into your second and third suggestions.