probs better this way

(ultimately RequestLine should be axed)
This commit is contained in:
Arisotura 2019-04-01 04:22:03 +02:00
parent 8bc4ca3fc8
commit 2d0d501d1f
1 changed files with 3 additions and 9 deletions

View File

@ -146,18 +146,9 @@ void RenderFrame()
} }
void RequestLine(int line) void RequestLine(int line)
{
//
}
u32* GetLine(int line)
{ {
if (line == 0) if (line == 0)
{ {
/*glBindFramebuffer(GL_FRAMEBUFFER, FramebufferID);
glReadBuffer(GL_COLOR_ATTACHMENT0);
glReadPixels(0, 0, 256, 192, GL_RGBA, GL_UNSIGNED_BYTE, Framebuffer);*/
u8* data = (u8*)glMapBuffer(GL_PIXEL_PACK_BUFFER, GL_READ_ONLY); u8* data = (u8*)glMapBuffer(GL_PIXEL_PACK_BUFFER, GL_READ_ONLY);
if (data) memcpy(&Framebuffer[4*256*0], data, 4*256*48); if (data) memcpy(&Framebuffer[4*256*0], data, 4*256*48);
glUnmapBuffer(GL_PIXEL_PACK_BUFFER); glUnmapBuffer(GL_PIXEL_PACK_BUFFER);
@ -186,7 +177,10 @@ u32* GetLine(int line)
if (data) memcpy(&Framebuffer[4*256*144], data, 4*256*48); if (data) memcpy(&Framebuffer[4*256*144], data, 4*256*48);
glUnmapBuffer(GL_PIXEL_PACK_BUFFER); glUnmapBuffer(GL_PIXEL_PACK_BUFFER);
} }
}
u32* GetLine(int line)
{
return (u32*)&Framebuffer[256*4 * line]; return (u32*)&Framebuffer[256*4 * line];
} }