Skip to content

Commit 9c7d4d1

Browse files
authored
Merge pull request #80 from winnerspiros/fix-android-vulkan-startup-crash-1345616918090383590
Fix Android startup crash in VulkanRenderer
2 parents 6ede44b + 46acb04 commit 9c7d4d1

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

osu.Android/Native/vulkan_renderer.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@
1313

1414
static JavaVM* g_vm = nullptr;
1515

16-
jint JNI_OnLoad(JavaVM* vm, void* reserved) {
16+
JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) {
1717
g_vm = vm;
18+
LOGI("JNI_OnLoad called, JVM initialized");
1819
return JNI_VERSION_1_6;
1920
}
2021

@@ -358,9 +359,8 @@ VkExtent2D VulkanRenderer::chooseSwapExtent(const VkSurfaceCapabilitiesKHR& capa
358359
if (capabilities.currentExtent.width != UINT32_MAX) {
359360
return capabilities.currentExtent;
360361
} else {
361-
int width, height;
362-
ANativeWindow_getWidth(window);
363-
ANativeWindow_getHeight(window);
362+
int width = ANativeWindow_getWidth(window);
363+
int height = ANativeWindow_getHeight(window);
364364

365365
VkExtent2D actualExtent = {
366366
static_cast<uint32_t>(width),

0 commit comments

Comments
 (0)