Files
questshock/android/gl4es-patches/01-android-cmake-subdirectory.patch
ml d2dc58391b
build / build (push) Successful in 2m26s
Add controller input and a laser-pointer-driven menu quad
- xr_input.c/h: an OpenXR action set (aim pose, trigger/select click, a
  menu-toggle button) plus ray/quad hit-testing, and a visible
  laser-pointer line drawn from the controller toward the hit point.
- xr_menu.c/h + MenuOverlay.java: a second composition-layer quad,
  toggled by a controller button, showing an off-screen, never-attached
  Android View tree (one "Keyboard" button so far) driven by synthetic
  touch events computed from the laser ray's hit UV.
- Migrate gl4es from a prebuilt binary baked into the Docker build-image
  to a vendored source snapshot (android/gl4es-src/) compiled from
  source at APK build time via CMake add_subdirectory(), patched through
  a new android/gl4es-patches/ (mirrors the existing engine-patches/
  pattern). This was needed to track down and fix a bug hit while
  building the menu: gl4es's fixed-pipeline emulation (fpe.c) was
  unconditionally substituting its own shader onto the menu's draw call
  (fpe_ReleventState() always sets alphafunc to a nonzero sentinel, so
  its fpe_IsEmpty() check could never see the state as empty), making
  the menu quad show the game's own rendering instead of its own
  content. Fixed by routing the menu's blit through a real
  glBlitFramebuffer() call instead of a shader-based draw, which gl4es's
  fpe.c has nothing to intercept - documented in README.md's new
  "Debugging notes" section.
- Renumber android/engine-patches/ to close the gap left by removing an
  unrelated diagnostic-only patch, and strip investigation-journal
  comments and dead diagnostic code (temporary tracing, env-var probes)
  left over from finding the bug above.
- Restructure README.md into numbered sections, document every
  engine/gl4es patch, add Android Studio dev/testing-cycle instructions,
  and generalize Quest-specific wording to any OpenXR headset. Update
  NOTICE.txt to match (gl4es is now vendored/patched source, not a
  prebuilt binary; add the OpenXR-SDK loader).
2026-08-02 06:27:49 +02:00

48 lines
2.3 KiB
Diff

diff -ru a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt 2026-07-31 13:25:14.739711912 +0200
+++ b/CMakeLists.txt 2026-07-31 13:25:29.283619378 +0200
@@ -2,11 +2,22 @@
project(gl4es LANGUAGES C)
+# questshock: on Android this project is add_subdirectory()'d straight into
+# the engine's own CMake configure (see android/engine-patches/
+# 02-android-opengl-es.patch), not built standalone - CMAKE_SOURCE_DIR then
+# points at the *outer* project's root, not here, so writing there would
+# scatter build output outside this project entirely. Leaving these unset
+# for Android just falls back to CMake's normal per-target build-tree
+# output, which AGP's own native-build packaging finds regardless of path;
+# link_directories() is also unneeded there since the GL/EGL targets link
+# each other by CMake target name, not by search path.
+if(NOT ANDROID)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/lib)
link_directories(${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
+endif()
option(PANDORA "Set to ON if targeting an OpenPandora device" ${PANDORA})
option(PYRA "Set to ON if targeting an Dragonbox Pyra device" ${PYRA})
diff -ru a/src/CMakeLists.txt b/src/CMakeLists.txt
--- a/src/CMakeLists.txt 2026-07-31 13:25:14.747711861 +0200
+++ b/src/CMakeLists.txt 2026-07-31 13:25:44.043526054 +0200
@@ -220,7 +220,16 @@
target_link_libraries(GL ${log-lib})
endif()
- if(CMAKE_SHARED_LIBRARY_SUFFIX MATCHES ".so")
+ # questshock: on Android, AGP's native-build packaging only bundles a
+ # jniLibs .so whose *filename* literally ends in ".so" (and the dynamic
+ # linker resolves NEEDED entries by embedded SONAME, which CMake derives
+ # from this same filename) - versioning it to "libGL.so.1" like the
+ # desktop build does would need a separate patchelf rename step, which
+ # only build-image's Docker environment could guarantee has this tool.
+ # Skipping the override on Android instead so CMake's own default
+ # SHARED library naming (plain "libGL.so", correct SONAME included)
+ # already comes out right with no extra step.
+ if(CMAKE_SHARED_LIBRARY_SUFFIX MATCHES ".so" AND NOT ANDROID)
set_target_properties(GL PROPERTIES SUFFIX ".so.1")
endif()
install(TARGETS GL