Files
PojavLauncher_iOS/Natives/gl_mesa3d_patch.m
T
Duy Tran Khanh d0279af8aa Internal changes
- First changes for tvOS (very WIP) this will be a challenge to use
remote storage as ATV doesn't allow persistent storage (at least
without jailbreak). Low priority for now.
- Change regLog, debugLog to NSLog, NSDebugLog
- Rewrite most of JavaLauncher.m to ObjC
- Update README.md
2022-12-17 21:25:23 +07:00

26 lines
793 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");
}
// NSDebugLog(@"func=%p, next=%p", glDrawArrays, glDrawArrays_real);
// NSDebugLog(@"glDrawArrays mode=%p", mode);
if (mode == GL_TRIANGLE_FAN) {
// NSDebugLog(@"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);
}
}