Skip to content

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
  • Loading branch information
SolDev69 committed May 20, 2024
1 parent 74934e8 commit 671b0bd
Show file tree
Hide file tree
Showing 11 changed files with 211 additions and 211 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1687691695196
1716170694497
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1692525087345
1716170694527
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1703946470579
1716170694562
22 changes: 11 additions & 11 deletions app_pojavlauncher/src/main/jni/ctxbridges/gl_bridge.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,10 @@ void gl_make_current(gl_render_window_t* bundle) {
return;
}
bool hasSetMainWindow = false;
if(pojav_environ->mainWindowBundle == NULL) {
pojav_environ->mainWindowBundle = (basic_render_window_t*)bundle;
__android_log_print(ANDROID_LOG_INFO, g_LogTag, "Main window bundle is now %p", pojav_environ->mainWindowBundle);
pojav_environ->mainWindowBundle->newNativeSurface = pojav_environ->pojavWindow;
if(solcraft_environ->mainWindowBundle == NULL) {
solcraft_environ->mainWindowBundle = (basic_render_window_t*)bundle;
__android_log_print(ANDROID_LOG_INFO, g_LogTag, "Main window bundle is now %p", solcraft_environ->mainWindowBundle);
solcraft_environ->mainWindowBundle->newNativeSurface = solcraft_environ->pojavWindow;
hasSetMainWindow = true;
}
__android_log_print(ANDROID_LOG_INFO, g_LogTag, "Making current, surface=%p, nativeSurface=%p, newNativeSurface=%p", bundle->surface, bundle->nativeSurface, bundle->newNativeSurface);
Expand All @@ -131,9 +131,9 @@ void gl_make_current(gl_render_window_t* bundle) {
currentBundle = bundle;
}else {
if(hasSetMainWindow) {
pojav_environ->mainWindowBundle->newNativeSurface = NULL;
gl_swap_surface((gl_render_window_t*)pojav_environ->mainWindowBundle);
pojav_environ->mainWindowBundle = NULL;
solcraft_environ->mainWindowBundle->newNativeSurface = NULL;
gl_swap_surface((gl_render_window_t*)solcraft_environ->mainWindowBundle);
solcraft_environ->mainWindowBundle = NULL;
}
__android_log_print(ANDROID_LOG_ERROR, g_LogTag, "eglMakeCurrent returned with error: %04x", eglGetError_p());
}
Expand All @@ -159,15 +159,15 @@ void gl_swap_buffers() {
}

void gl_setup_window() {
if(pojav_environ->mainWindowBundle != NULL) {
if(solcraft_environ->mainWindowBundle != NULL) {
__android_log_print(ANDROID_LOG_INFO, g_LogTag, "Main window bundle is not NULL, changing state");
pojav_environ->mainWindowBundle->state = STATE_RENDERER_NEW_WINDOW;
pojav_environ->mainWindowBundle->newNativeSurface = pojav_environ->pojavWindow;
solcraft_environ->mainWindowBundle->state = STATE_RENDERER_NEW_WINDOW;
solcraft_environ->mainWindowBundle->newNativeSurface = solcraft_environ->pojavWindow;
}
}

void gl_swap_interval(int swapInterval) {
if(pojav_environ->force_vsync) swapInterval = 1;
if(solcraft_environ->force_vsync) swapInterval = 1;

eglSwapInterval_p(g_EglDisplay, swapInterval);
}
20 changes: 10 additions & 10 deletions app_pojavlauncher/src/main/jni/ctxbridges/osm_bridge.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,16 @@ void osm_make_current(osm_render_window_t* bundle) {
}
bool hasSetMainWindow = false;
currentBundle = bundle;
if(pojav_environ->mainWindowBundle == NULL) {
pojav_environ->mainWindowBundle = (basic_render_window_t*) bundle;
__android_log_print(ANDROID_LOG_INFO, g_LogTag, "Main window bundle is now %p", pojav_environ->mainWindowBundle);
pojav_environ->mainWindowBundle->newNativeSurface = pojav_environ->pojavWindow;
if(solcraft_environ->mainWindowBundle == NULL) {
solcraft_environ->mainWindowBundle = (basic_render_window_t*) bundle;
__android_log_print(ANDROID_LOG_INFO, g_LogTag, "Main window bundle is now %p", solcraft_environ->mainWindowBundle);
solcraft_environ->mainWindowBundle->newNativeSurface = solcraft_environ->pojavWindow;
hasSetMainWindow = true;
}
if(bundle->nativeSurface == NULL) {
//prepare the buffer for our first render!
osm_swap_surfaces(bundle);
if(hasSetMainWindow) pojav_environ->mainWindowBundle->state = STATE_RENDERER_ALIVE;
if(hasSetMainWindow) solcraft_environ->mainWindowBundle->state = STATE_RENDERER_ALIVE;
}
osm_set_no_render_buffer(&bundle->buffer);
osm_apply_current_ll();
Expand All @@ -129,15 +129,15 @@ void osm_swap_buffers() {
}

void osm_setup_window() {
if(pojav_environ->mainWindowBundle != NULL) {
if(solcraft_environ->mainWindowBundle != NULL) {
__android_log_print(ANDROID_LOG_INFO, g_LogTag, "Main window bundle is not NULL, changing state");
pojav_environ->mainWindowBundle->state = STATE_RENDERER_NEW_WINDOW;
pojav_environ->mainWindowBundle->newNativeSurface = pojav_environ->pojavWindow;
solcraft_environ->mainWindowBundle->state = STATE_RENDERER_NEW_WINDOW;
solcraft_environ->mainWindowBundle->newNativeSurface = solcraft_environ->pojavWindow;
}
}

void osm_swap_interval(int swapInterval) {
if(pojav_environ->mainWindowBundle != NULL && pojav_environ->mainWindowBundle->nativeSurface != NULL) {
setNativeWindowSwapInterval(pojav_environ->mainWindowBundle->nativeSurface, swapInterval);
if(solcraft_environ->mainWindowBundle != NULL && solcraft_environ->mainWindowBundle->nativeSurface != NULL) {
setNativeWindowSwapInterval(solcraft_environ->mainWindowBundle->nativeSurface, swapInterval);
}
}
4 changes: 2 additions & 2 deletions app_pojavlauncher/src/main/jni/ctxbridges/osmesa_loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ void (*glReadPixels_p) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum
void dlsym_OSMesa() {
char* main_osm_libname = getenv("POJAVEXEC_OSMESA");
char* main_path = NULL;
if(pojav_environ->config_renderer == RENDERER_VK_ZINK) {
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(pojav_environ->config_renderer == RENDERER_VIRGL) {
} else if(solcraft_environ->config_renderer == RENDERER_VIRGL) {
if(asprintf(&main_path, "%s/libOSMesa_znL.so", getenv("POJAV_NATIVEDIR")) == -1) {
abort();
}
Expand Down
Loading

0 comments on commit 671b0bd

Please sign in to comment.