Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Game Development

Reply
 
LinkBack Thread Tools Display Modes
Old 04-29-2010, 12:19 AM   #1 (permalink)
Registered Member
 
Join Date: Apr 2010
Posts: 2
Default glReadPixel operation

Hi,
I am new to iPhone development and would like to use glReadPixel operation in a sample application I am developing. The read should happen from the back buffer. Though read pixel is giving me a color from the frame buffer, the value doesn't look right. I suspect the read is happening from the front buffer.
Can somebody help me?
aibin is offline   Reply With Quote
Old 04-29-2010, 12:54 AM   #2 (permalink)
Registered Member
 
Join Date: Apr 2010
Posts: 2
Default

Problem solved... The buffer used should be unsigned byte

GLubyte pColor[4];
glReadPixels(X,Y,1,1,GL_RGBA,GL_UNSIGNED_BYTE,&pCo lor[0]);

Earlier it was:

Byte pColor[4];
glReadPixels(X,Y,1,1,GL_RGBA,GL_BYTE,&pColor[0]);

I don't have an explanation why this doesn't work though...
aibin is offline   Reply With Quote
Reply

Bookmarks

Tags
glreadpixel, opengl

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 267
19 members and 248 guests
2WeeksToGo, @sandris, AdamL, ADY, Dani77, diyora, F_Bryant, GHuebner, HDshot, headkaze, mer10, Oral B, prchn4christ, Rudy, smithdale87, Thompson22, timle8n1, Touchmint, vigu360
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,880
Threads: 89,228
Posts: 380,748
Top Poster: BrianSlick (7,129)
Welcome to our newest member, @sandris
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 12:56 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0