Fixed flipped texts and menu elements that were beyond the near clip plane.
This commit is contained in:
parent
20fd3a8f67
commit
6f35e00c16
|
|
@ -827,7 +827,9 @@ static void gfx_opengl_init(void) {
|
|||
glBindVertexArray(opengl_vao);
|
||||
#endif
|
||||
|
||||
// glEnable(GL_DEPTH_CLAMP); // GL4 only
|
||||
if (GLAD_GL_ARB_depth_clamp) {
|
||||
glEnable(GL_DEPTH_CLAMP);
|
||||
}
|
||||
glDepthFunc(GL_LEQUAL);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
|
|
|
|||
|
|
@ -2133,10 +2133,7 @@ static void gfx_dp_texture_rectangle(int32_t ulx, int32_t uly, int32_t lrx, int3
|
|||
// dsdx and dtdy are S5.10
|
||||
// lrx, lry, ulx, uly are U10.2
|
||||
// lrs, lrt are S10.5
|
||||
if (flip) {
|
||||
dsdx = -dsdx;
|
||||
dtdy = -dtdy;
|
||||
}
|
||||
|
||||
int16_t width = !flip ? lrx - ulx : lry - uly;
|
||||
int16_t height = !flip ? lry - uly : lrx - ulx;
|
||||
float lrs = ((uls << 7) + dsdx * width) >> 7;
|
||||
|
|
|
|||
|
|
@ -1,12 +1,13 @@
|
|||
/*
|
||||
|
||||
OpenGL loader generated by glad 0.1.34 on Sun Jul 30 09:46:53 2023.
|
||||
OpenGL loader generated by glad 0.1.34 on Tue Aug 15 02:22:41 2023.
|
||||
|
||||
Language/Generator: C/C++
|
||||
Specification: gl
|
||||
APIs: gl=2.1
|
||||
Profile: compatibility
|
||||
Extensions:
|
||||
GL_ARB_depth_clamp,
|
||||
GL_ARB_framebuffer_object,
|
||||
GL_EXT_framebuffer_object
|
||||
Loader: True
|
||||
|
|
@ -15,9 +16,9 @@
|
|||
Reproducible: False
|
||||
|
||||
Commandline:
|
||||
--profile="compatibility" --api="gl=2.1" --generator="c" --spec="gl" --local-files --extensions="GL_ARB_framebuffer_object,GL_EXT_framebuffer_object"
|
||||
--profile="compatibility" --api="gl=2.1" --generator="c" --spec="gl" --local-files --extensions="GL_ARB_depth_clamp,GL_ARB_framebuffer_object,GL_EXT_framebuffer_object"
|
||||
Online:
|
||||
https://glad.dav1d.de/#profile=compatibility&language=c&specification=gl&loader=on&api=gl%3D2.1&extensions=GL_ARB_framebuffer_object&extensions=GL_EXT_framebuffer_object
|
||||
https://glad.dav1d.de/#profile=compatibility&language=c&specification=gl&loader=on&api=gl%3D2.1&extensions=GL_ARB_depth_clamp&extensions=GL_ARB_framebuffer_object&extensions=GL_EXT_framebuffer_object
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
|
@ -815,6 +816,7 @@ PFNGLWINDOWPOS3IPROC glad_glWindowPos3i = NULL;
|
|||
PFNGLWINDOWPOS3IVPROC glad_glWindowPos3iv = NULL;
|
||||
PFNGLWINDOWPOS3SPROC glad_glWindowPos3s = NULL;
|
||||
PFNGLWINDOWPOS3SVPROC glad_glWindowPos3sv = NULL;
|
||||
int GLAD_GL_ARB_depth_clamp = 0;
|
||||
int GLAD_GL_ARB_framebuffer_object = 0;
|
||||
int GLAD_GL_EXT_framebuffer_object = 0;
|
||||
PFNGLISRENDERBUFFERPROC glad_glIsRenderbuffer = NULL;
|
||||
|
|
@ -1474,6 +1476,7 @@ static void load_GL_EXT_framebuffer_object(GLADloadproc load) {
|
|||
}
|
||||
static int find_extensionsGL(void) {
|
||||
if (!get_exts()) return 0;
|
||||
GLAD_GL_ARB_depth_clamp = has_ext("GL_ARB_depth_clamp");
|
||||
GLAD_GL_ARB_framebuffer_object = has_ext("GL_ARB_framebuffer_object");
|
||||
GLAD_GL_EXT_framebuffer_object = has_ext("GL_EXT_framebuffer_object");
|
||||
free_exts();
|
||||
|
|
|
|||
|
|
@ -1,12 +1,13 @@
|
|||
/*
|
||||
|
||||
OpenGL loader generated by glad 0.1.34 on Sun Jul 30 09:46:53 2023.
|
||||
OpenGL loader generated by glad 0.1.34 on Tue Aug 15 02:22:41 2023.
|
||||
|
||||
Language/Generator: C/C++
|
||||
Specification: gl
|
||||
APIs: gl=2.1
|
||||
Profile: compatibility
|
||||
Extensions:
|
||||
GL_ARB_depth_clamp,
|
||||
GL_ARB_framebuffer_object,
|
||||
GL_EXT_framebuffer_object
|
||||
Loader: True
|
||||
|
|
@ -15,9 +16,9 @@
|
|||
Reproducible: False
|
||||
|
||||
Commandline:
|
||||
--profile="compatibility" --api="gl=2.1" --generator="c" --spec="gl" --local-files --extensions="GL_ARB_framebuffer_object,GL_EXT_framebuffer_object"
|
||||
--profile="compatibility" --api="gl=2.1" --generator="c" --spec="gl" --local-files --extensions="GL_ARB_depth_clamp,GL_ARB_framebuffer_object,GL_EXT_framebuffer_object"
|
||||
Online:
|
||||
https://glad.dav1d.de/#profile=compatibility&language=c&specification=gl&loader=on&api=gl%3D2.1&extensions=GL_ARB_framebuffer_object&extensions=GL_EXT_framebuffer_object
|
||||
https://glad.dav1d.de/#profile=compatibility&language=c&specification=gl&loader=on&api=gl%3D2.1&extensions=GL_ARB_depth_clamp&extensions=GL_ARB_framebuffer_object&extensions=GL_EXT_framebuffer_object
|
||||
*/
|
||||
|
||||
|
||||
|
|
@ -2691,6 +2692,7 @@ typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X3FVPROC)(GLint location, GLsizei cou
|
|||
GLAPI PFNGLUNIFORMMATRIX4X3FVPROC glad_glUniformMatrix4x3fv;
|
||||
#define glUniformMatrix4x3fv glad_glUniformMatrix4x3fv
|
||||
#endif
|
||||
#define GL_DEPTH_CLAMP 0x864F
|
||||
#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE 0x8211
|
||||
|
|
@ -2815,6 +2817,10 @@ GLAPI PFNGLUNIFORMMATRIX4X3FVPROC glad_glUniformMatrix4x3fv;
|
|||
#define GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53
|
||||
#define GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54
|
||||
#define GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55
|
||||
#ifndef GL_ARB_depth_clamp
|
||||
#define GL_ARB_depth_clamp 1
|
||||
GLAPI int GLAD_GL_ARB_depth_clamp;
|
||||
#endif
|
||||
#ifndef GL_ARB_framebuffer_object
|
||||
#define GL_ARB_framebuffer_object 1
|
||||
GLAPI int GLAD_GL_ARB_framebuffer_object;
|
||||
|
|
|
|||
Loading…
Reference in New Issue