Skip to content

Commit

Permalink
attempt fix
Browse files Browse the repository at this point in the history
  • Loading branch information
SolDev69 committed Jan 17, 2025
1 parent df3b130 commit b680d07
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 179 deletions.
35 changes: 0 additions & 35 deletions app_pojavlauncher/src/main/jni/ctxbridges/osmesa_loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <dlfcn.h>
<<<<<<< HEAD
#include "environ/environ.h"
=======
#include "loader_dlopen.h"
>>>>>>> upstream/v3_openjdk
#include "osmesa_loader.h"
#include "renderer_config.h"

Expand All @@ -25,36 +21,6 @@ void (*glClear_p) (GLbitfield mask);
void (*glReadPixels_p) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void * data);
void* (*OSMesaGetProcAddress_p)(const char* funcName);

<<<<<<< HEAD
void dlsym_OSMesa() {
char* main_osm_libname = getenv("POJAVEXEC_OSMESA");
char* main_path = NULL;
if(solcraft_environ->config_renderer == RENDERER_VK_ZINK) {
if(main_osm_libname == NULL) main_osm_libname = "libOSMesa.so";
if(asprintf(&main_path, "%s/%s", getenv("POJAV_NATIVEDIR"), main_osm_libname) == -1) {
abort();
}
free(main_path);
} else if(solcraft_environ->config_renderer == RENDERER_VIRGL) {
if(asprintf(&main_path, "%s/libOSMesa_znL.so", getenv("POJAV_NATIVEDIR")) == -1) {
abort();
}
}
void* dl_handle = NULL;
dl_handle = dlopen(main_path, RTLD_GLOBAL);
if(dl_handle == NULL) abort();
OSMesaMakeCurrent_p = dlsym(dl_handle, "OSMesaMakeCurrent");
OSMesaGetCurrentContext_p = dlsym(dl_handle,"OSMesaGetCurrentContext");
OSMesaCreateContext_p = dlsym(dl_handle, "OSMesaCreateContext");
OSMesaDestroyContext_p = dlsym(dl_handle, "OSMesaDestroyContext");
OSMesaPixelStore_p = dlsym(dl_handle,"OSMesaPixelStore");
glGetString_p = dlsym(dl_handle,"glGetString");
glClearColor_p = dlsym(dl_handle, "glClearColor");
glClear_p = dlsym(dl_handle,"glClear");
glFinish_p = dlsym(dl_handle,"glFinish");
glReadPixels_p = dlsym(dl_handle,"glReadPixels");
}
=======
bool dlsym_OSMesa() {
void* dl_handle = loader_dlopen("libOSMesa.so.8", "libOSMesa.so", RTLD_LOCAL | RTLD_LAZY);
if(dl_handle == NULL) return false;
Expand All @@ -75,4 +41,3 @@ bool dlsym_OSMesa() {
glReadPixels_p = OSMesaGetProcAddress_p("glReadPixels");
return true;
}
>>>>>>> upstream/v3_openjdk
9 changes: 1 addition & 8 deletions app_pojavlauncher/src/main/jni/egl_bridge.c
Original file line number Diff line number Diff line change
Expand Up @@ -399,18 +399,11 @@ int pojavInitOpenGL() {
extern void updateMonitorSize(int width, int height);

EXTERNAL_API int pojavInit() {
<<<<<<< HEAD
ANativeWindow_acquire(solcraft_environ->pojavWindow);
solcraft_environ->savedWidth = ANativeWindow_getWidth(solcraft_environ->pojavWindow);
solcraft_environ->savedHeight = ANativeWindow_getHeight(solcraft_environ->pojavWindow);
ANativeWindow_setBuffersGeometry(solcraft_environ->pojavWindow,solcraft_environ->savedWidth,solcraft_environ->savedHeight,AHARDWAREBUFFER_FORMAT_R8G8B8X8_UNORM);
=======
ANativeWindow_acquire(pojav_environ->pojavWindow);
pojav_environ->savedWidth = ANativeWindow_getWidth(pojav_environ->pojavWindow);
pojav_environ->savedHeight = ANativeWindow_getHeight(pojav_environ->pojavWindow);
ANativeWindow_setBuffersGeometry(pojav_environ->pojavWindow,pojav_environ->savedWidth,pojav_environ->savedHeight,AHARDWAREBUFFER_FORMAT_R8G8B8X8_UNORM);
updateMonitorSize(pojav_environ->savedWidth, pojav_environ->savedHeight);
>>>>>>> upstream/v3_openjdk
updateMonitorSize(solcraft_environ->savedWidth, solcraft_environ->savedHeight);
pojavInitOpenGL();
return 1;
}
Expand Down
Loading

0 comments on commit b680d07

Please sign in to comment.