Files
PojavLauncher_iOS/Natives/gl_mesa3d_patch.m
T
Adam Tunnic 70c150af38 Make the debug logging switch actually do something
Pretty much disables everything except for [Pre-Init] and [Init], as well as Renderer Init Success. Toggle debug logging off to see.

regLog(message) -> logs all the time
debugLog(message) -> logs only when debug logging is enabled
2022-03-13 21:23:02 -04:00

26 lines
784 B
Objective-C

#include <assert.h>
#include <dlfcn.h>
// #include "log.h"
#include "GL/gl.h"
void (*glDrawArrays_p) (GLenum mode, GLint first, GLsizei count);
GLAPI void GLAPIENTRY glDrawArrays(GLenum mode, GLint first, GLsizei count) {
if (!glDrawArrays_p) {
glDrawArrays_p = dlsym(RTLD_NEXT, "glDrawArrays");
}
// debugLog("func=%p, next=%p", glDrawArrays, glDrawArrays_real);
// debugLog("glDrawArrays mode=%p", mode);
if (mode == GL_TRIANGLE_FAN) {
// debugLog("ERROR: GL_TRIANGLE_FAN unsupported!");
// this is wrong but idk how to deal with it yet...
// minecraft stills works with this for unknown reason
glDrawArrays_p(GL_TRIANGLE_STRIP, first, count);
} else {
glDrawArrays_p(mode, first, count);
}
}