I am trying to create an iPad notepad kind of application, where you can write/draw with your finger. I followed some Apple's examples and got it to work on either white or black background. But I would like have an image for a background, like a notebook page, or the like... I have searched, but none of what I've found helped me, or they just confused me even more!! I am very new to this so any suggestion, sample codes would be greatly appreciated. Thank you! :)
Asked
Active
Viewed 558 times
0
-
possible duplicate of [OpenGL ES recommended way of displaying a background image](http://stackoverflow.com/questions/2276633/opengl-es-recommended-way-of-displaying-a-background-image) – Brad Larson Aug 26 '11 at 00:26
-
See also [How to draw a texture as a 2D background in OpenGL ES 2.0?](http://stackoverflow.com/questions/4036737/how-to-draw-a-texture-as-a-2d-background-in-opengl-es-2-0) and [How to set background image using OpenGL ES 1.1 for iPhone](http://stackoverflow.com/questions/6044557/how-to-set-background-image-using-opengl-es-1-1-for-iphone) – Brad Larson Aug 26 '11 at 00:27
1 Answers
1
you can load in your background image as a texture map and apply it to a quad that has the same size as the screen.
here is the workflow:
you push your current model view matrix and projection matrix into the matrix stack to save your current camera status.
and then clear these matrices to the default identity matrix, set depth buffer mask to true, so that you don't write to the depth buffer, and draw the quad with the background texture.
and then pop the old model view and projection matrices, and draw everything else.

Bill Yan
- 3,369
- 4
- 27
- 42