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



Simon Lemieux:
>
[Crash on 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;

I suspect you need to allocate a sufficiently large buffer, i.e.
thePixels = malloc(number of pixels * pixel size).


--
\\\\ Jens Ayton, Fratello di Vetinari 36.3636363636364% insane
\\\\\__, Bringing sarcastic one-liners to the common hedgehog since 1999
\\\\\`/ PGP key: http://home4.swipnet.se/~w-49116/stuff/jens_ayton.pgp


References: 
 >Using glReadPixels (From: Simon Lemieux <email@hidden>)



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.