I'm using Pyglet(and OpenGL) in Python on an application, I'm trying to use glReadPixels to get the RGBA values for a set of pixels. It's my understanding that OpenGL returns the data as packed integers, since that's how they are stored on the hardware. However for obvious reasons I'd like to get it into a normal format for working wit...
This is my code that i use to get my mouse position in the 3d scene:
void GetOGLPos(int x, int y, GLdouble &pX, GLdouble &pY, GLdouble &pZ){
GLint viewport[4];
GLdouble modelview[16];
GLdouble projection[16];
GLfloat winX, winY, winZ;
glGetDoublev(GL_MODELVIEW_MATRIX, modelview);
glGetDoublev(GL_PROJECTION_MATRIX, projection);
g...
Suppose I open a glfw window with:
glfwOpenWindow(width, height, 8,8,8,8,8,8, GLFW_WINDOW);
Then, I try to read it back with:
glReadPixels(0, 0, width, height, ..1.., ..2..);
I'm not sure what I should be putting in as ..1.. and ..2.. ; I think ..1.. should be GL_RGBA, but no idea for ..2..
Thanks!
...
I need to read content of CAEAGLLayer, which has various widths and heights (based on background image size). on iPad emulator everything is okay, but on device I have crashes or weird horizontal lines instead of content.
Crashes not happens on width, for example, from 537 to 544 pixels
I'm using following code
- (UIImage*)image
{
...