From cae4fa3aa6f6d818d2d296756c0a59b6268f2a3a Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Sat, 25 Nov 2017 20:32:30 +1100 Subject: [PATCH] [client] allow texture stretch when in GL buffer mode --- client/main.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/client/main.c b/client/main.c index 833a8309..4ba208b7 100644 --- a/client/main.c +++ b/client/main.c @@ -293,6 +293,9 @@ int renderThread(void * unused) SDL_RenderClear(state.renderer); if (state.hasBufferStorage) { + int w, h; + SDL_GetWindowSize(state.window, &w, &h); + // copy the buffer to the texture and let the guest advance memcpySSE(texPixels[texIndex], pixels + state.shm->dataPos, texSize); ivshmem_kick_irq(state.shm->guestID, 0); @@ -314,10 +317,10 @@ int renderThread(void * unused) // draw the screen glBegin(GL_TRIANGLE_STRIP); - glTexCoord2f(0.0f, 0.0f); glVertex2f(0.0f , 0.0f ); - glTexCoord2f(1.0f, 0.0f); glVertex2f(state.shm->width, 0.0f ); - glTexCoord2f(0.0f, 1.0f); glVertex2f(0.0f , state.shm->height); - glTexCoord2f(1.0f, 1.0f); glVertex2f(state.shm->width, state.shm->height); + glTexCoord2f(0.0f, 0.0f); glVertex2i(0, 0); + glTexCoord2f(1.0f, 0.0f); glVertex2i(w, 0); + glTexCoord2f(0.0f, 1.0f); glVertex2i(0, h); + glTexCoord2f(1.0f, 1.0f); glVertex2i(w, h); glEnd(); glBindTexture(GL_TEXTURE_2D, 0); glDisable(GL_TEXTURE_2D);