Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using glReadPixels



here's the code:
GLbyte *thePixels;
glReadBuffer(GL_FRONT_LEFT); // Is this necessary since I read from the default
buffer?
glReadPixels(10,10, 10,10, GL_RGBA, GL_BYTE, &thePixels);
cout << (int)thePixels[0] << endl;

Firstly thePixels is just a pointer to some memory. But have you allocated and intialised it?
Secondly why are you passing &thePixels? Shouldn't it be just thePixels?
The Blue book documents the function signature as:

glReadPixels(GLint x, .......,GLenum, GLvoid*pixels)

"Developing quality software requires a great deal of effort
over a long period of time." Doug Schmidt - C++ Report May 1996




Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.