Hello,
I'd like to display the contents of an UIView-subclass (such as UITableView or UITextView) on the surface of an OpenGL-object (a cube). Therefore I need to render the tableView (textView respectively) into my own context.
I experimented with UIGraphicsPushContext(...) and UIGraphicsPopContext() hoping that subviews like the tableView would render themself into the alternative context (which is my texture), but they didn't. Here's my code to create the texture:
Code:
...
size_t TEXTURE_WIDTH = 256;
size_t TEXTURE_HEIGHT = 256;
GLubyte *textureData = (GLubyte*)malloc(TEXTURE_WIDTH * TEXTURE_HEIGHT * 4);
CGContextRef textureContext = CGBitmapContextCreate(textureData,
TEXTURE_WIDTH, TEXTURE_HEIGHT, 8, TEXTURE_WIDTH * 4,
CGColorSpaceCreateDeviceRGB(), kCGImageAlphaPremultipliedLast);
// Try to render tableView on texture
UIGraphicsPushContext(textureContext);
[tableView drawRect:CGRectMake(0, 0, 193, 138)];
UIGraphicsPopContext();
...
Any suggestions preventing me from adopting the lookalike of the ready-existing views all by myself

, will be much appreciated.
Thanks in advance,
Paul