我正在用glReadPixels進行截圖,以在兩幅圖像之間執行「交叉」效果。OpenGL ES - glReadPixels
在果醬SDK模擬器截圖取就好了和「交叉」效果的作品一種享受:
然而,這是它的外觀上的iOS和Android設備 - 損壞: http://www.eikona.info/images/81269689420703803966.png
我總是閱讀屏幕RGBA 1字節/通道,因爲它總是被接受的documentation says。
這裏是用來拍攝截圖代碼:
uint8* Gfx::ScreenshotBuffer(int& deviceWidth, int& deviceHeight, int& dataLength) {
/// width/height
deviceWidth = IwGxGetDeviceWidth();
deviceHeight = IwGxGetDeviceHeight();
int rowLength = deviceWidth * 4; /// data always returned by GL as RGBA, 1 byte/each
dataLength = rowLength * deviceHeight;
// set the target framebuffer to read
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glPixelStorei(GL_PACK_ALIGNMENT, 1);
uint8* buffer = new uint8[dataLength];
glReadPixels(0, 0, deviceWidth, deviceHeight, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
return buffer;
}
void Gfx::ScreenshotImage(CIwImage* img, uint8*& pbuffer) {
int deviceWidth, deviceHeight, dataLength;
pbuffer = ScreenshotBuffer(deviceWidth, deviceHeight, dataLength);
img->SetFormat(CIwImage::ABGR_8888);
img->SetWidth(deviceWidth);
img->SetHeight(deviceHeight);
img->SetBuffers(pbuffer, dataLength, 0, 0);
}
如果你刪除你的'up-down'塊,腐敗消失了嗎?只是倒過來?還是它被顛倒了? – sarnold
事情是,我沒有設備,所以我需要發送給我的客戶,然後等待他安裝和測試......所有這些可能需要幾天時間:-( –
上述評論是現在無需重新編輯我的消息,以反映我的新發現 –