aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArisotura <thetotalworm@gmail.com>2019-05-16 01:46:09 +0200
committerArisotura <thetotalworm@gmail.com>2019-05-16 01:46:09 +0200
commitf2282e9e32cce0c335f0ca065e5a3b1bc564e406 (patch)
treed1c3fe5f0f6ec0a811ffc034ec949d0751a92a49
parent4b874cc440c8e9f69f9ae983c5ea253f3f560a4b (diff)
Arisotura is a fucking derp
-rw-r--r--src/libui_sdl/main.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/libui_sdl/main.cpp b/src/libui_sdl/main.cpp
index 4d3cf64..47f5f13 100644
--- a/src/libui_sdl/main.cpp
+++ b/src/libui_sdl/main.cpp
@@ -184,6 +184,7 @@ bool GLDrawing_Init()
glEnableVertexAttribArray(1); // texcoord
glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, 4*4, (void*)(2*4));
+ // TODO: consider reallocating the texture when changing screen sizes
glGenTextures(1, &GL_ScreenTexture);
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, GL_ScreenTexture);
@@ -348,8 +349,10 @@ void GLDrawing_DrawScreen()
int frontbuf = GPU::FrontBuffer;
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, GL_ScreenTexture);
- glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 512, 384, GL_RGBA_INTEGER, GL_UNSIGNED_BYTE, GPU::Framebuffer[frontbuf][0]);
- glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 768, 512, 384, GL_RGBA_INTEGER, GL_UNSIGNED_BYTE, GPU::Framebuffer[frontbuf][1]);
+ glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 256<<ScreenScale[0], 192<<ScreenScale[0], GL_RGBA_INTEGER,
+ GL_UNSIGNED_BYTE, GPU::Framebuffer[frontbuf][0]);
+ glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 768, 256<<ScreenScale[1], 192<<ScreenScale[1], GL_RGBA_INTEGER,
+ GL_UNSIGNED_BYTE, GPU::Framebuffer[frontbuf][1]);
glBindBuffer(GL_ARRAY_BUFFER, GL_ScreenVertexBufferID);
glBindVertexArray(GL_ScreenVertexArrayID);