PDA

View Full Version : Render to texture with native API



scheidsn
03-19-2007, 06:31 AM
Hi!

I want to do the following:

-> Render to a bitmap that is 512x512 pixel in size and use this bitmap as a texture in OpenGL ES without having to call glTexImage2D each time the bitmap changes.
-> I want to access the bitmap via a pointer, so I can set the pixel by myself and I do not have to use GDI or any other 2D-API.

I think I have to use a pixmapSurface to be able to access the buffer and eglBindTexture... But I am not able to create a pixmapSurface. Maybe because my window with its associated WindowSurface that I use for the OpenGL drawing has a different size than 512x512? But I do not want them to match...

Thanks in advance for the help.

Nils Pipenbrinck
03-19-2007, 10:21 AM
That won't work.

The only surfaces you can bind as textures are PBuffers, and you don't get a pointer to their surface memory.

Infact you don't get pointers to any kind of surface memory using EGL or OpenGL/ES.