What can prevent OpenGL glDrawPixels from working on some video cards?

The following code does not write data to the rear buffer of Intel integrated video cards, for example, on a MacBook. On ATI cards, such as the iMac, it accesses the back buffer. The width and height are correct (and the buffer is 800x600), and the m_PixelBuffer is correctly filled with 0xAA00AA00.

My best guess is that there is something amiss with the need to install glWindowPos. I do not currently set it (or raster position), and when I get GL_CURRENT_RASTER_POSITION, I noticed that the default value on the ATI card is 0,0,0,0, and Intel - 0,0,0,1. When I set the raster pose on the ATI card to 0,0,0,1, I get the same result as the Intel card, nothing accesses the feedback buffer. Is there some kind of transformation state that I am missing? This is a 2D application, so view conversion is very simple glOrtho.

glDrawPixels(GetBufferWidth(), GetBufferHeight(), GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, m_PixelBuffer);

For more information I can provide, please ask. I'm pretty much OpenGL and Mac newb, so I don't know if I am providing enough information.

+3
source share
4

OpenGL Intel

, , , - , glDrawPixels, , "" , , , , - .

,

, -, . , -, . , - 100%. , Intel Mac, .

, , . , , 3 :)

+1

, , glDrawPixels, . , GL_RGB GL_RGBA GL_UNSIGNED_BYTE GL_FLOAT ? , , ?

+1

(0,0,0,1), reset .

glDrawPixels()

GLint valid;
glGet(GL_CURRENT_RASTER_POSITION_VALID, &valid);

This should tell you if the current raster position is valid. If so, then this is not your problem.

+1
source

Source: https://habr.com/ru/post/1696524/


All Articles