1
0
mirror of https://github.com/FunkyFr3sh/cnc-ddraw.git synced 2025-03-15 06:04:49 +01:00

don't draw whole texture into framebuffer

This commit is contained in:
FunkyFr3sh 2018-05-12 19:54:55 +02:00
parent f5384dc560
commit 7223603a08
2 changed files with 6 additions and 6 deletions

View File

@ -240,7 +240,7 @@ GLuint OpenGL_BuildProgramFromFile(const char *filePath)
if (fragSource && vertSource)
{
const char *versionStart = strstr(source, "#version");
char *versionStart = strstr(source, "#version");
if (versionStart)
{
const char deli[2] = "\n";

View File

@ -351,13 +351,13 @@ DWORD WINAPI render_main(void)
glBindFramebuffer(GL_FRAMEBUFFER, frameBufferId);
glPushAttrib(GL_VIEWPORT_BIT);
glViewport(0, 0, tex_width, tex_height);
glViewport(0, 0, ddraw->width, ddraw->height);
glBegin(GL_TRIANGLE_FAN);
glTexCoord2f(0, 0); glVertex2f(-1, -1);
glTexCoord2f(0, 1); glVertex2f(-1, 1);
glTexCoord2f(1, 1); glVertex2f(1, 1);
glTexCoord2f(1, 0); glVertex2f(1, -1);
glTexCoord2f(0, 0); glVertex2f(-1, -1);
glTexCoord2f(0, scale_h); glVertex2f(-1, 1);
glTexCoord2f(scale_w, scale_h); glVertex2f(1, 1);
glTexCoord2f(scale_w, 0); glVertex2f(1, -1);
glEnd();
glBindFramebuffer(GL_FRAMEBUFFER, 0);