OGL Image Problem
I'm trying to get loaded PNGs onto the screen using glDrawPixels. The test cube that is supposed to draw is drawing, and the PNG is claiming to be loaded, but nothing's happening.
(most of) The display loop:
display(){
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(-50, 50, -50, 50, -20, 20);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glRasterPosition2i(100, 100);
glutSolidCube(10.0);
glDrawPixels(g_image.width, g_image.height, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8, &(g_image.data));
glutSwapBuffer();
}
Is something missing or being done wrong to throw off the glDrawPixels command?
-"Sta7ic" Matt
(most of) The display loop:
display(){
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(-50, 50, -50, 50, -20, 20);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glRasterPosition2i(100, 100);
glutSolidCube(10.0);
glDrawPixels(g_image.width, g_image.height, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8, &(g_image.data));
glutSwapBuffer();
}
Is something missing or being done wrong to throw off the glDrawPixels command?
-"Sta7ic" Matt
...does any one of the 55 logged viewers have any experience or sample source to share?
What do you mean by "nothing's happening"? Are you sure the GL context is properly initialized- can you draw anything else in it? Try loading the PNG into a normal Carbon or Cocoa window just to be sure the pixels made it to RAM.
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| mirror image problem? | WhatMeWorry | 3 | 3,006 |
Feb 15, 2005 08:44 AM Last Post: WhatMeWorry |
|

