From f6814e02c02a0ad68af107e7605c08ee47de79f4 Mon Sep 17 00:00:00 2001 From: Arisotura Date: Fri, 31 May 2019 21:37:30 +0200 Subject: [PATCH] * add needed libui functions under Windows, even if they don't do a whole lot * fix ass-stupid fog bug --- src/GPU3D_OpenGL.cpp | 5 +---- src/GPU3D_OpenGL_shaders.h | 9 +++++++-- src/libui_sdl/libui/windows/gl.cpp | 19 +++++++++++++++++++ 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/src/GPU3D_OpenGL.cpp b/src/GPU3D_OpenGL.cpp index db2617c2..95243d1c 100644 --- a/src/GPU3D_OpenGL.cpp +++ b/src/GPU3D_OpenGL.cpp @@ -187,7 +187,7 @@ void SetupDefaultTexParams(GLuint tex) bool Init() { GLint uni_id; - + glEnable(GL_DEPTH_TEST); glEnable(GL_STENCIL_TEST); @@ -1043,9 +1043,6 @@ void RenderFrame() { if (RenderPolygonRAM[i]->Degenerate) continue; - // zog. - //if (RenderPolygonRAM[i]->YBottom <= 96 || RenderPolygonRAM[i]->YTop >= 144) continue; - SetupPolygon(&PolygonList[npolys], RenderPolygonRAM[i]); if (firsttrans < 0 && RenderPolygonRAM[i]->Translucent) firsttrans = npolys; diff --git a/src/GPU3D_OpenGL_shaders.h b/src/GPU3D_OpenGL_shaders.h index b12dc612..4c5b82e3 100644 --- a/src/GPU3D_OpenGL_shaders.h +++ b/src/GPU3D_OpenGL_shaders.h @@ -42,7 +42,7 @@ uniform uint uOpaquePolyID; uniform uint uFogFlag; out vec4 oColor; -out vec3 oAttr; +out vec4 oAttr; void main() { @@ -50,6 +50,7 @@ void main() oAttr.r = float(uOpaquePolyID) / 63.0; oAttr.g = 0; oAttr.b = float(uFogFlag); + oAttr.a = 1; } )"; @@ -178,7 +179,7 @@ smooth in vec2 fTexcoord; flat in ivec3 fPolygonAttr; out vec4 oColor; -out vec3 oAttr; +out vec4 oAttr; int TexcoordWrap(int c, int maxc, int mode) { @@ -620,6 +621,7 @@ void main() oColor = col; oAttr.r = float((fPolygonAttr.x >> 24) & 0x3F) / 63.0; oAttr.b = float((fPolygonAttr.x >> 15) & 0x1); + oAttr.a = 1; } )"; @@ -635,6 +637,7 @@ void main() oColor = col; oAttr.r = float((fPolygonAttr.x >> 24) & 0x3F) / 63.0; oAttr.b = float((fPolygonAttr.x >> 15) & 0x1); + oAttr.a = 1; gl_FragDepth = fZ; } )"; @@ -649,6 +652,7 @@ void main() oColor = col; oAttr.b = 0; + oAttr.a = 1; } )"; @@ -664,6 +668,7 @@ void main() oColor = col; oAttr.b = 0; + oAttr.a = 1; gl_FragDepth = fZ; } )"; diff --git a/src/libui_sdl/libui/windows/gl.cpp b/src/libui_sdl/libui/windows/gl.cpp index 1e3732c2..c6217217 100644 --- a/src/libui_sdl/libui/windows/gl.cpp +++ b/src/libui_sdl/libui/windows/gl.cpp @@ -135,8 +135,27 @@ void *uiGLGetProcAddress(const char* proc) return (void*)wglGetProcAddress(proc); } +void uiGLBegin(uiGLContext* ctx) +{ +} + +void uiGLEnd(uiGLContext* ctx) +{ +} + void uiGLSwapBuffers(uiGLContext* ctx) { if (ctx == NULL) return; SwapBuffers(ctx->dc); } + +int uiGLGetFramebuffer(uiGLContext* ctx) +{ + return 0; +} + +float uiGLGetFramebufferScale(uiGLContext* ctx) +{ + // TODO + return 1; +}