views:

186

answers:

1

I want to make a program similar to GLPaint using CGContext that is very smooth and easy to put images behind. I understand that GLPaint has no allowance for putting an Image behind the painting canvas, rather than having just a black one.

+2  A: 

You can very simply use an image behind the painting canvas. 4 basic steps

  1. load your image in a texture (for example 256x256)
  2. enable TEXTURE_2D mode and set the current texture to the texture id you loaded.
  3. draw a rectangle with that texture enabled and set a texture map coordinates pointer (array of u,v points)
  4. loop on your screen touch events to overlay with points like in GL_PAINT (without clearing your buffer) to keep the old points and bg image. Render your buffer after drawing points (brush).

Do you need more precision or sample code ?

Vincent Zgueb
I think I do because I don't know any OpenGL and that would helpful in reading you sudo
Jaba