Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I have this piece of code

glReadBuffer( GL_FRONT );
glReadPixels( 0, 0, width, height, GL_RGB, GL_UNSIGNED_BYTE, buffer ); 

Which works just perfectly in all the Nvidia and AMD GPUs I have tried, but it fails in almost every single Intel built-in video that I have tried. It actually works in a very old 945GME, but fails in all the others. Instead of getting a screenshot I am actually getting a black screen.

If it helps, I am working with the Doom3 Engine, and that code is derived from the built-in screen capture code. By the way, even with the original game I cannot do screen capture on those intel devices anyway. My guess is that they are not implementing the standard correctly or something. Is there a workaround for this?

share|improve this question
1  
Can you give us a few specific examples of Intel built-in video chipsets that fail? Just so we're all sure we're talking about the same thing. (My code looks very much like yours, incidentally) –  Trevor Powell Oct 1 '12 at 5:55
    
I was using Intel 945,965,GMA HD and neither of them worked. They were in some inspirons 1525, another from an inspiron 1764. The one that did work was a very old Intel 950 from an Acer Aspire One 110L. Were you able to fix it? –  cloudraven Oct 3 '12 at 15:59
3  
Maybe you need to read from the GL_BACK buffer? The OpenGL manpages says that's the default for double-buffered mode. But for reference, the above code (with GL_FRONT or GL_BACK) did work on my Intel HD card. –  QuasarDonkey Oct 4 '12 at 21:49
    
I will try that tomorrow. It's odd, isn't that supposed to be undefined behavior? Well, I can make it happen only on intel cards. –  cloudraven Oct 8 '12 at 6:56
    
Cloudraven, I would check RB_ExecuteBackEndCommands from tr_backend.cpp for cases where the backbuffer may be cleared prior to your call of ReadPixels. –  Jing Oct 9 '12 at 3:59

1 Answer 1

up vote 2 down vote accepted

Intel graphics have historically always had problems with reading from, or drawing to, the front buffer. A good rule of thumb I follow with Intel is this - if you can't do it in D3D then don't even attempt to do it in OpenGL, even if the spec says that you should be able to - and D3D doesn't allow access to the front buffer in this manner so... just use GL_BACK instead.

share|improve this answer
    
Yeah, I would prefer to use GL_BACK, but GL_FRONT. It's just that GL_BACK doesn't work. Funny enough, GL_FRONT does seem to work, but I haven't tested it thoroughly. –  cloudraven Nov 2 '12 at 0:35

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.