Fixed ScreenCoords::ToPixelData stack corruption
This commit is contained in:
@@ -32,11 +32,10 @@ glm::vec3 ScreenCoords::ToWorldPos(glm::vec2 screenCoord, float depth, float scr
|
|||||||
ScreenCoords::PixelData ScreenCoords::ToPixelData(float x, float y, FrameBuffer* PickDataBuffer, GLuint DepthBuffer)
|
ScreenCoords::PixelData ScreenCoords::ToPixelData(float x, float y, FrameBuffer* PickDataBuffer, GLuint DepthBuffer)
|
||||||
{
|
{
|
||||||
PickDataBuffer->Bind();
|
PickDataBuffer->Bind();
|
||||||
unsigned char pdata[2];
|
unsigned char pdata[3];
|
||||||
glReadPixels(x, y, 1, 1, GL_RG, GL_UNSIGNED_BYTE, &pdata);
|
glReadPixels(x, y, 1, 1, GL_RGB, GL_UNSIGNED_BYTE, &pdata);
|
||||||
PickDataBuffer->Unbind();
|
PickDataBuffer->Unbind();
|
||||||
|
|
||||||
|
|
||||||
glBindFramebuffer(GL_FRAMEBUFFER, DepthBuffer);
|
glBindFramebuffer(GL_FRAMEBUFFER, DepthBuffer);
|
||||||
float depthData;
|
float depthData;
|
||||||
glReadPixels(x, y, 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, &depthData);
|
glReadPixels(x, y, 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, &depthData);
|
||||||
|
|||||||
Reference in New Issue
Block a user