Reputation: 53
I have an opengl live wallpaper that shows a rotating shape. I would like to place a static image as a background behind the rotating shape. What code would accomplish putting a static background behind an opengl rotating shape?
Upvotes: 1
Views: 1009
Reputation: 753
Well you could first draw your wallpaper, using a basic quad with a texture applied on it (draw the quad at coordinates (0,0), (1,0), (1,1), (0,1)) then draw your shape. Do not use depth while drawing your quad, that will enable your quad to stay behind your shape at all times.
To load the image in the texture, you can use SDL_image to get the data, or the devil image library.
Good luck :)
EDIT : oh sorry I didn't see you were in android. I have no idea on what libs to use to load image files to opengl on android.
Upvotes: 2