1

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?

genpfault
  • 51,148
  • 11
  • 85
  • 139
  • 1
    Have you tried displaying in your opengl live wallpaper a image behind your rotating shape ? (also adding the code you already have usually helps :P) – Jason Rogers Aug 01 '11 at 20:05
  • The code I am working on is not mine and I do not know the rules for posting code that is not mine(It is from the book "Hello, Android"). This is only a modification that I am trying. Is it permissable to post that code? However, the answer I am looking for could apply to any OpenGL code for a live wallpaper. From what I have read a textured quad is needed that takes up the whole screen and then have the rotating shape on top of that. – Keith Whitt Aug 02 '11 at 01:04

1 Answers1

2

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.

Tuxer
  • 753
  • 1
  • 6
  • 20