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:
parent
f5384dc560
commit
7223603a08
@ -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";
|
||||
|
10
src/render.c
10
src/render.c
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user