LukasBanana / LLGL

Low Level Graphics Library (LLGL) is a thin abstraction layer for the modern graphics APIs OpenGL, Direct3D, Vulkan, and Metal
BSD 3-Clause "New" or "Revised" License
2.03k stars 135 forks source link

Andorid project compile error, needing native_app_glue. #106

Closed jayzhen521 closed 6 months ago

jayzhen521 commented 6 months ago

I tried to run ./GenerateProjectAndroid.sh, an error occurred: image If I cut sinppet from example/CMakeLists.txt and paste to top CMakeLists.txt image to image It works.

Is this an error needing to be fixed or a better way to modify?

LukasBanana commented 6 months ago

I should have removed that file long ago. I have a new file BuildAndroid.bat in my local repository, but I haven't spent any time on it in a while so the Android port never got out of an experimental state. The new batch script was supposed to follow a similar pattern as the other Build* scripts, but if you found a fix to make it work, please feel free to file a PR.

Are you working with Android Studio or what IDE do you generate the project files for with this script?

( I also just realized that there's still my hard coded project path in there 😳 )

jayzhen521 commented 6 months ago

Thank you for your reply!

Are you working with Android Studio or what IDE do you generate the project files for with this script?

I'm using cygwin + androidndk(windows edition) + cmake(windows edition) to create LLGL and LLGL_OpenGL library.

My project mainly contains three layers:

  1. rendering layer(bottom layer)
  2. logic layer(middle layer)
  3. business layer(top layer)

rendering layer can create render context and run rendering command( so business layer don't care about surface creation...) logic layer contains data and operation top layer written in java/kotlin for creating activity, etc.

I found some building errors. They are all small mistakes(It has been able to compile successfully, so far I have not actually run it, it may take a while to process and then test): 1: image It seems that the Surface::ProcessEvents method appears suddenly, and PostQuit(); does not belong to this class either. image

2: image image

3: image It seems POSIXDebug.cpp not needed for Android, so I commented them all out image

4: image Is the function declaration not updated? image

5: image image should be: image

6: image image should be: image with adding head files

7: image adding image

LukasBanana commented 6 months ago

Thanks for the pointers. I can reproduce the issues with MSYS2 (based on Cygwin). I will try to find some time over the weekend to get the Android port back into a better state.

LukasBanana commented 6 months ago

I went ahead and fixed the issues with the commit above. Please open a new ticket for any runtime related issues.