Conversation
Try
left a comment
There was a problem hiding this comment.
And one bug elephant: project-file generation supposed to be handle in engine, not in opengothic
| } | ||
|
|
||
| void VSwapchain::reset() { | ||
| Tempest::Log::i("VSwapchain::reset() called - possible screen rotation detected"); |
| if(vkCreateWin32SurfaceKHR(instance,&createInfo,nullptr,&ret)!=VK_SUCCESS) | ||
| throw std::system_error(Tempest::GraphicsErrc::NoDevice); | ||
| #elif defined(__ANDROID__) | ||
| ANativeWindow* window = tempest_android_get_native_window(); |
There was a problem hiding this comment.
All other platforms get window handle from hwnd:
ANativeWindow* window = reinterpret_cast<ANativeWindow*>(hwnd)
| Detail::vkAssert(code); | ||
| #else | ||
| if(code==VK_SUBOPTIMAL_KHR) { | ||
| Tempest::Log::i("VSwapchain::present: SUBOPTIMAL - rotation change during present"); |
There was a problem hiding this comment.
rotation?! This part of code is disabled on android.
| #include <condition_variable> | ||
| #include <queue> | ||
|
|
||
| #define LOGI(...) ((void)__android_log_print(ANDROID_LOG_INFO, "Tempest", __VA_ARGS__)) |
There was a problem hiding this comment.
should be Tempest::Log:: not a custom macro
| static std::atomic_bool g_hasWindow{false}; | ||
|
|
||
| // Gamepad state tracking (uses struct from SystemApi) | ||
| static GamepadState g_gamepad; |
There was a problem hiding this comment.
Should not mix things in a single PR. Get it running first - game-pad after as different PR
| set(TEMPEST_BUILD_DIRECTX12 OFF CACHE INTERNAL "") | ||
|
|
||
| # Add android_native_app_glue | ||
| set(ANDROID_NATIVE_APP_GLUE_DIR "${ANDROID_NDK}/sources/android/native_app_glue") |
There was a problem hiding this comment.
Same native_app_glue linked in OpenGothic pr, wasn't it?
|
|
||
| createInfo.preTransform = swapChainSupport.capabilities.currentTransform; | ||
| // Determine the correct transform based on window dimensions for Android | ||
| VkSurfaceTransformFlagBitsKHR selectedTransform = swapChainSupport.capabilities.currentTransform; |
| break; | ||
|
|
||
| case APP_CMD_TERM_WINDOW: | ||
| g_hasWindow.store(false); |
There was a problem hiding this comment.
How termination handled in Android? Is it possible that OS queues APP_CMD_TERM_WINDOW, destroys window, but we may get some swapchain operation, before it is processed?
|
|
||
| static void pushEvent(const AppEvent& evt) { | ||
| std::lock_guard<std::mutex> lock(g_eventMutex); | ||
| g_eventQueue.push(evt); |
There was a problem hiding this comment.
What is a threading model here? How many threads are involved?
| } | ||
|
|
||
| // The application entry point - calls user's main() after setup | ||
| int main(int argc, const char** argv); |
There was a problem hiding this comment.
C11 allows multiple flavors of main function - that just one of them. You need to use dlsym to dynamically acquire address of the main(int,char**) and call it as cdecl - it should be compatible with all other kinds of main
No description provided.