0

Right so I got all my lovely openGL stuff working and I can change the background colour via the property of the view or even the window however for the love of god I cant change it to an image.

  • I have tried adding it to the nib
  • I have tried adding a UIImageView as a subview.
  • I have tried addiing it as a UIColor with Pattern
  • I tried making the OpenGL view have a clear background and setting the
    image on the actual window.

Still no joy!

genpfault
  • 51,148
  • 11
  • 85
  • 139
Burf2000
  • 5,001
  • 14
  • 58
  • 117

1 Answers1

1

Issue a glClear then render 2 triangles (ie a quad) to the screen with the appropriate image texture mapped onto them.

Goz
  • 61,365
  • 24
  • 124
  • 204
  • I thought the texture has to be square where as my image is a rect – Burf2000 Jan 21 '11 at 15:07
  • Don't worry, your screen won't become bigger if you use a 512x512 image instead of an 320x480 ;) – JustSid Jan 21 '11 at 16:32
  • Apparently the iPhone supports non power of two textures in a limited set of cases that might just suit your needs : http://stackoverflow.com/questions/4760174/rendering-to-non-power-of-two-texture-on-iphone – rotoglup Jan 21 '11 at 21:37