* add needed libui functions under Windows, even if they don't do a whole lot

* fix ass-stupid fog bug
This commit is contained in:
Arisotura
2019-05-31 21:37:30 +02:00
parent 65ccf2a717
commit f6814e02c0
3 changed files with 27 additions and 6 deletions

View File

@ -187,7 +187,7 @@ void SetupDefaultTexParams(GLuint tex)
bool Init() bool Init()
{ {
GLint uni_id; GLint uni_id;
glEnable(GL_DEPTH_TEST); glEnable(GL_DEPTH_TEST);
glEnable(GL_STENCIL_TEST); glEnable(GL_STENCIL_TEST);
@ -1043,9 +1043,6 @@ void RenderFrame()
{ {
if (RenderPolygonRAM[i]->Degenerate) continue; if (RenderPolygonRAM[i]->Degenerate) continue;
// zog.
//if (RenderPolygonRAM[i]->YBottom <= 96 || RenderPolygonRAM[i]->YTop >= 144) continue;
SetupPolygon(&PolygonList[npolys], RenderPolygonRAM[i]); SetupPolygon(&PolygonList[npolys], RenderPolygonRAM[i]);
if (firsttrans < 0 && RenderPolygonRAM[i]->Translucent) if (firsttrans < 0 && RenderPolygonRAM[i]->Translucent)
firsttrans = npolys; firsttrans = npolys;

View File

@ -42,7 +42,7 @@ uniform uint uOpaquePolyID;
uniform uint uFogFlag; uniform uint uFogFlag;
out vec4 oColor; out vec4 oColor;
out vec3 oAttr; out vec4 oAttr;
void main() void main()
{ {
@ -50,6 +50,7 @@ void main()
oAttr.r = float(uOpaquePolyID) / 63.0; oAttr.r = float(uOpaquePolyID) / 63.0;
oAttr.g = 0; oAttr.g = 0;
oAttr.b = float(uFogFlag); oAttr.b = float(uFogFlag);
oAttr.a = 1;
} }
)"; )";
@ -178,7 +179,7 @@ smooth in vec2 fTexcoord;
flat in ivec3 fPolygonAttr; flat in ivec3 fPolygonAttr;
out vec4 oColor; out vec4 oColor;
out vec3 oAttr; out vec4 oAttr;
int TexcoordWrap(int c, int maxc, int mode) int TexcoordWrap(int c, int maxc, int mode)
{ {
@ -620,6 +621,7 @@ void main()
oColor = col; oColor = col;
oAttr.r = float((fPolygonAttr.x >> 24) & 0x3F) / 63.0; oAttr.r = float((fPolygonAttr.x >> 24) & 0x3F) / 63.0;
oAttr.b = float((fPolygonAttr.x >> 15) & 0x1); oAttr.b = float((fPolygonAttr.x >> 15) & 0x1);
oAttr.a = 1;
} }
)"; )";
@ -635,6 +637,7 @@ void main()
oColor = col; oColor = col;
oAttr.r = float((fPolygonAttr.x >> 24) & 0x3F) / 63.0; oAttr.r = float((fPolygonAttr.x >> 24) & 0x3F) / 63.0;
oAttr.b = float((fPolygonAttr.x >> 15) & 0x1); oAttr.b = float((fPolygonAttr.x >> 15) & 0x1);
oAttr.a = 1;
gl_FragDepth = fZ; gl_FragDepth = fZ;
} }
)"; )";
@ -649,6 +652,7 @@ void main()
oColor = col; oColor = col;
oAttr.b = 0; oAttr.b = 0;
oAttr.a = 1;
} }
)"; )";
@ -664,6 +668,7 @@ void main()
oColor = col; oColor = col;
oAttr.b = 0; oAttr.b = 0;
oAttr.a = 1;
gl_FragDepth = fZ; gl_FragDepth = fZ;
} }
)"; )";

View File

@ -135,8 +135,27 @@ void *uiGLGetProcAddress(const char* proc)
return (void*)wglGetProcAddress(proc); return (void*)wglGetProcAddress(proc);
} }
void uiGLBegin(uiGLContext* ctx)
{
}
void uiGLEnd(uiGLContext* ctx)
{
}
void uiGLSwapBuffers(uiGLContext* ctx) void uiGLSwapBuffers(uiGLContext* ctx)
{ {
if (ctx == NULL) return; if (ctx == NULL) return;
SwapBuffers(ctx->dc); SwapBuffers(ctx->dc);
} }
int uiGLGetFramebuffer(uiGLContext* ctx)
{
return 0;
}
float uiGLGetFramebufferScale(uiGLContext* ctx)
{
// TODO
return 1;
}