### Install BulletRobotics Headers (CMake) Source: https://github.com/dark-basic-software-limited/gamegurumax/blob/main/GameGuru Core/SDK/BULLET/bullet-3.19/Extras/BulletRobotics/CMakeLists.txt This CMake command installs all header files from the examples directory into the include/bullet directory of the installation prefix. This makes the library's API accessible to users. ```cmake INSTALL ( DIRECTORY ${CMAKE_SOURCE_DIR}/examples/ DESTINATION include/bullet FILES_MATCHING PATTERN "*.h*" ) ``` -------------------------------- ### Configure Persistent Storage with html5fs Source: https://github.com/dark-basic-software-limited/gamegurumax/blob/main/GameGuru Core/SDK/RecastContrib/SDL/docs/README-nacl.md This example demonstrates how to mount a persistent HTML5 filesystem at the '/save/' directory, allowing applications to save data. It requires the 'unlimitedStorage' permission to be added to the manifest.json file. ```bash mount("", "/save", "html5fs", 0, "type=PERSISTENT"); ``` ```json "permissions": [ "unlimitedStorage" ] ``` -------------------------------- ### Install Raspbian Build Dependencies Source: https://github.com/dark-basic-software-limited/gamegurumax/blob/main/GameGuru Core/SDK/RecastContrib/SDL/docs/README-raspberrypi.md Installs necessary development libraries for building on Raspbian, including udev, ALSA, and D-Bus. It also ensures the presence of Raspberry Pi-specific libraries for EGL and OpenGL ES. ```bash sudo apt-get install libudev-dev libasound2-dev libdbus-1-dev sudo apt-get install libraspberrypi0 libraspberrypi-bin libraspberrypi-dev ``` -------------------------------- ### Cross-Compile SDL for Raspbian: Chroot and Install Dependencies Source: https://github.com/dark-basic-software-limited/gamegurumax/blob/main/GameGuru Core/SDK/RecastContrib/SDL/docs/README-raspberrypi.md Enters the Raspbian sysroot using chroot to install necessary development libraries within the cross-compilation environment. It also applies a workaround by commenting out lines in ld.so.preload. ```bash sudo chroot $SYSROOT apt-get install libudev-dev libasound2-dev libdbus-1-dev libraspberrypi0 libraspberrypi-bin libraspberrypi-dev libx11-dev libxext-dev libxrandr-dev libxcursor-dev libxi-dev libxinerama-dev libxxf86vm-dev libxss-dev exit ``` -------------------------------- ### Install BulletRobotics Library (CMake) Source: https://github.com/dark-basic-software-limited/gamegurumax/blob/main/GameGuru Core/SDK/BULLET/bullet-3.19/Extras/BulletRobotics/CMakeLists.txt This CMake command installs the compiled BulletRobotics library, archive, and import library to their respective destinations within the installation prefix, typically lib/ and lib/ (for archives). ```cmake INSTALL(TARGETS BulletRobotics LIBRARY DESTINATION lib${LIB_SUFFIX} ARCHIVE DESTINATION lib${LIB_SUFFIX} ) ``` -------------------------------- ### Generate and Install pkg-config File (CMake) Source: https://github.com/dark-basic-software-limited/gamegurumax/blob/main/GameGuru Core/SDK/BULLET/bullet-3.19/Extras/BulletRobotics/CMakeLists.txt This CMake command configures a bullet_robotics.pc file for pkg-config, used on non-MSVC systems. It then installs this file to the specified PKGCONFIG_INSTALL_PREFIX, allowing other projects to easily find and link against the BulletRobotics library. ```cmake IF(NOT MSVC) CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/bullet_robotics.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/bullet_robotics.pc @ONLY) INSTALL( FILES ${CMAKE_CURRENT_BINARY_DIR}/bullet_robotics.pc DESTINATION ${PKGCONFIG_INSTALL_PREFIX} ) ENDIF(NOT MSVC) ``` -------------------------------- ### Cross-Compile SDL for Raspbian: Mount System Root Source: https://github.com/dark-basic-software-limited/gamegurumax/blob/main/GameGuru Core/SDK/RecastContrib/SDL/docs/README-raspberrypi.md Mounts the Raspbian system image to create a sysroot for cross-compilation. This involves using kpartx to map partitions, mounting the relevant partition, and copying its contents to a sysroot directory. It also installs QEMU for user-mode emulation. ```bash export SYSROOT=/opt/rpi-sysroot sudo kpartx -a -v .img sudo mount -o loop /dev/mapper/loop0p2 /mnt sudo cp -r /mnt $SYSROOT sudo apt-get install qemu binfmt-support qemu-user-static sudo cp /usr/bin/qemu-arm-static $SYSROOT/usr/bin sudo mount --bind /dev $SYSROOT/dev sudo mount --bind /proc $SYSROOT/proc sudo mount --bind /sys $SYSROOT/sys ``` -------------------------------- ### Cross-Compile SDL for Raspbian: Configure and Build SDL Source: https://github.com/dark-basic-software-limited/gamegurumax/blob/main/GameGuru Core/SDK/RecastContrib/SDL/docs/README-raspberrypi.md Configures and builds the SDL library for Raspberry Pi using the cross-compilation toolchain. It sets up environment variables for the compiler and linker, specifies the sysroot, and configures build options for a minimal SDL installation. ```bash export CC="/opt/rpi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc --sysroot=$SYSROOT -I$SYSROOT/opt/vc/include -I$SYSROOT/usr/include -I$SYSROOT/opt/vc/include/interface/vcos/pthreads -I$SYSROOT/opt/vc/include/interface/vmcs_host/linux" cd mkdir -p build;cd build LDFLAGS="-L$SYSROOT/opt/vc/lib" ../configure --with-sysroot=$SYSROOT --host=arm-raspberry-linux-gnueabihf --prefix=$PWD/rpi-sdl2-installed --disable-pulseaudio --disable-esd make make install ``` -------------------------------- ### Create Application Bundle Structure with Makefile.am (Autoconf) Source: https://github.com/dark-basic-software-limited/gamegurumax/blob/main/GameGuru Core/SDK/RecastContrib/SDL/docs/README-macosx.md An example rule for a Makefile.am file to automatically create a Mac OS X application bundle (.app). This rule sets up the necessary directory structure and installs the executable within the bundle. ```makefile bundle_contents = APP_NAME.app/Contents APP_NAME_bundle: EXE_NAME mkdir -p $(bundle_contents)/MacOS mkdir -p $(bundle_contents)/Resources echo "APPL????" > $(bundle_contents)/PkgInfo $(INSTALL_PROGRAM) $< $(bundle_contents)/MacOS/ ``` -------------------------------- ### Cross-Compile SDL for Raspbian: Fix Installation Paths Source: https://github.com/dark-basic-software-limited/gamegurumax/blob/main/GameGuru Core/SDK/RecastContrib/SDL/docs/README-raspberrypi.md Modifies configuration files to ensure that the installed SDL libraries and tools use standard system paths (/usr/local) when deployed to the Raspberry Pi. This is achieved using a Perl script to perform find-and-replace operations. ```bash perl -w -pi -e "s#$PWD/rpi-sdl2-installed#/usr/local#g;" ./rpi-sdl2-installed/lib/libSDL2.la ./rpi-sdl2-installed/lib/pkgconfig/sdl2.pc ./rpi-sdl2-installed/bin/sdl2-config ``` -------------------------------- ### Configure SDL for Native Client (NaCl) Source: https://github.com/dark-basic-software-limited/gamegurumax/blob/main/GameGuru Core/SDK/RecastContrib/SDL/docs/README-nacl.md This command configures the SDL build for Native Client using the PNaCl toolchain. It specifies the host architecture and the installation destination. Ensure the environment variables are set correctly before running this command. ```bash configure --host=pnacl --prefix some/install/destination ``` -------------------------------- ### Symbolic Stack Trace Conversion with addr2line Source: https://github.com/dark-basic-software-limited/gamegurumax/blob/main/GameGuru Core/SDK/RecastContrib/SDL/docs/README-android.md This example demonstrates how to use 'addr2line' to convert raw addresses from a crash log into human-readable function and line number information. It requires the debug version of your library. ```bash arm-eabi-addr2line -C -f -e obj/local/armeabi/libmain.so ``` -------------------------------- ### Simple Camera Implementation (C++) Source: https://github.com/dark-basic-software-limited/gamegurumax/blob/main/GameGuru Core/SDK/BULLET/bullet-3.19/Extras/BulletRobotics/CMakeLists.txt This snippet includes the C++ source file for a SimpleCamera class, likely used in the OpenGLWindow example. It provides basic camera controls for navigation and viewing within a 3D environment. ```c++ #include "../../examples/OpenGLWindow/SimpleCamera.cpp" ``` -------------------------------- ### Tiny Renderer Example (C++) Source: https://github.com/dark-basic-software-limited/gamegurumax/blob/main/GameGuru Core/SDK/BULLET/bullet-3.19/Extras/BulletRobotics/CMakeLists.txt This snippet includes the C++ source files for the TinyRenderer example. It provides a basic software renderer implementation, likely used for visualization and debugging purposes within the Bullet Robotics project. ```c++ #include "../../examples/TinyRenderer/geometry.cpp" #include "../../examples/TinyRenderer/model.cpp" #include "../../examples/TinyRenderer/tgaimage.cpp" #include "../../examples/TinyRenderer/our_gl.cpp" #include "../../examples/TinyRenderer/TinyRenderer.cpp" ``` -------------------------------- ### Install Application Bundles with Makefile.am (Autoconf) Source: https://github.com/dark-basic-software-limited/gamegurumax/blob/main/GameGuru Core/SDK/RecastContrib/SDL/docs/README-macosx.md An additional rule for Makefile.am to install the created application bundles into the Applications directory. This hook ensures that the .app bundles are correctly placed for distribution. ```makefile install-exec-hook: APP_NAME_bundle rm -rf $(DESTDIR)$(prefix)/Applications/APP_NAME.app mkdir -p $(DESTDIR)$(prefix)/Applications/ cp -r $< /$(DESTDIR)$(prefix)Applications/ ``` -------------------------------- ### Configure Keyboard Layout (Bash) Source: https://github.com/dark-basic-software-limited/gamegurumax/blob/main/GameGuru Core/SDK/RecastContrib/SDL/docs/README-raspberrypi.md This command reconfigures the keyboard layout on Raspbian systems, ensuring SDL uses the same layout as the kernel. ```bash sudo dpkg-reconfigure keyboard-configuration ``` -------------------------------- ### Enable HDMI Audio Output (Configuration) Source: https://github.com/dark-basic-software-limited/gamegurumax/blob/main/GameGuru Core/SDK/RecastContrib/SDL/docs/README-raspberrypi.md To enable audio output over HDMI when ALSA is working but no sound is present, add 'hdmi_drive=2' to the config.txt file and reboot. ```config hdmi_drive=2 ``` -------------------------------- ### Add User to Input Group (Bash) Source: https://github.com/dark-basic-software-limited/gamegurumax/blob/main/GameGuru Core/SDK/RecastContrib/SDL/docs/README-raspberrypi.md This command adds the current user to the 'input' group, which may be necessary for certain input device permissions. ```bash sudo usermod -aG input `whoami` ``` -------------------------------- ### Create Basic SDL WinRT Application in C++ Source: https://github.com/dark-basic-software-limited/gamegurumax/blob/main/GameGuru Core/SDK/RecastContrib/SDL/docs/README-winrt.md This C++ code snippet demonstrates how to create a minimal SDL application for Windows Runtime. It initializes SDL video, retrieves display mode information, creates a fullscreen window and renderer, and enters a loop that clears the screen with green and presents it. This serves as a basic test case for SDL/WinRT setup. ```cpp #include int main(int argc, char **argv) { SDL_DisplayMode mode; SDL_Window * window = NULL; SDL_Renderer * renderer = NULL; SDL_Event evt; if (SDL_Init(SDL_INIT_VIDEO) != 0) { return 1; } if (SDL_GetCurrentDisplayMode(0, &mode) != 0) { return 1; } if (SDL_CreateWindowAndRenderer(mode.w, mode.h, SDL_WINDOW_FULLSCREEN, &window, &renderer) != 0) { return 1; } while (1) { while (SDL_PollEvent(&evt)) { } SDL_SetRenderDrawColor(renderer, 0, 255, 0, 255); SDL_RenderClear(renderer); SDL_RenderPresent(renderer); } } ``` -------------------------------- ### Windows Icon Hints Source: https://github.com/dark-basic-software-limited/gamegurumax/blob/main/GameGuru Core/SDK/RecastContrib/SDL/WhatsNew.txt Hints to specify custom icon resource IDs for SDL windows on Windows. ```APIDOC ## Windows Icon Hints ### Description These hints allow you to specify custom icon resource IDs for SDL windows on Windows platforms. This enables the use of application-defined icons in the window title bar and taskbar. ### Method N/A (Hint Group) ### Endpoint N/A (Hint Group) ### Hints - **SDL_HINT_WINDOWS_INTRESOURCE_ICON**: Specifies the resource ID for the main window icon. - **SDL_HINT_WINDOWS_INTRESOURCE_ICON_SMALL**: Specifies the resource ID for the small window icon. ### Parameters #### Query Parameters - **[Hint Name]** (integer) - Optional - The resource ID of the icon. ### Request Example ```json { "hint": "SDL_HINT_WINDOWS_INTRESOURCE_ICON", "value": "101" } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the success of the operation. #### Response Example ```json { "status": "success" } ``` ``` -------------------------------- ### Build GameGuruMax with Emconfigure Source: https://github.com/dark-basic-software-limited/gamegurumax/blob/main/GameGuru Core/SDK/RecastContrib/SDL/docs/README-emscripten.md This snippet shows how to build GameGuruMax using 'emconfigure' and 'emmake'. It involves creating a build directory, configuring the project with specific Emscripten flags, and then executing the make command. ```bash $ mkdir build $ cd build $ emconfigure ../configure --host=asmjs-unknown-emscripten --disable-assembly --disable-threads --disable-cpuinfo CFLAGS="-O2" $ emmake make ``` -------------------------------- ### Cross-Compile SDL for Raspbian: Clone Toolchain Source: https://github.com/dark-basic-software-limited/gamegurumax/blob/main/GameGuru Core/SDK/RecastContrib/SDL/docs/README-raspberrypi.md Clones the Raspberry Pi cross-compilation tools from GitHub to a specified directory. This is the first step in setting up an environment to build software for the Raspberry Pi on a different architecture, like x86. ```bash sudo git clone --depth 1 https://github.com/raspberrypi/tools /opt/rpi-tools ``` -------------------------------- ### Create Valgrind Wrapper Script for Android Source: https://github.com/dark-basic-software-limited/gamegurumax/blob/main/GameGuru Core/SDK/RecastContrib/SDL/docs/README-android.md This shell script acts as a wrapper to launch an Android application under Valgrind. It sets the temporary directory, specifies the Valgrind executable path, configures logging, and then executes the application with Valgrind. ```bash #!/system/bin/sh export TMPDIR=/data/data/org.libsdl.app exec /data/local/Inst/bin/valgrind --log-file=/sdcard/valgrind.log --error-limit=no $* ``` -------------------------------- ### Conditional Installation of Bullet2FileLoader (CMake) Source: https://github.com/dark-basic-software-limited/gamegurumax/blob/main/GameGuru Core/SDK/BULLET/bullet-3.19/src/Bullet3Serialize/Bullet2FileLoader/CMakeLists.txt This CMake snippet handles the conditional installation of the Bullet2FileLoader library. It checks if libraries should be installed and includes platform-specific logic for macOS framework builds, as well as general installation paths for runtime, library, and header files. ```cmake IF (INSTALL_LIBS) IF (NOT INTERNAL_CREATE_DISTRIBUTABLE_MSVC_PROJECTFILES) #FILES_MATCHING requires CMake 2.6 IF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.5) IF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK) INSTALL(TARGETS Bullet2FileLoader DESTINATION .) ELSE (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK) INSTALL(TARGETS Bullet2FileLoader runtime DESTINATION bin LIBRARY DESTINATION lib${LIB_SUFFIX} ARCHIVE DESTINATION lib${LIB_SUFFIX}) INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DESTINATION ${INCLUDE_INSTALL_DIR} FILES_MATCHING PATTERN "*.h" PATTERN ".svn" EXCLUDE PATTERN "CMakeFiles" EXCLUDE) ENDIF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK) ENDIF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.5) IF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK) SET_TARGET_PROPERTIES(Bullet2FileLoader PROPERTIES FRAMEWORK true) SET_TARGET_PROPERTIES(Bullet2FileLoader PROPERTIES PUBLIC_HEADER "${Bullet2FileLoader_HDRS}") ENDIF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK) ENDIF (NOT INTERNAL_CREATE_DISTRIBUTABLE_MSVC_PROJECTFILES) ENDIF (INSTALL_LIBS) ``` -------------------------------- ### Push and Execute Valgrind Wrapper on Android Device Source: https://github.com/dark-basic-software-limited/gamegurumax/blob/main/GameGuru Core/SDK/RecastContrib/SDL/docs/README-android.md These commands use ADB (Android Debug Bridge) to transfer the wrapper script to the Android device, make it executable, and then configure Android to use this script for launching a specific application package. ```bash adb push start_valgrind_app /data/local ``` ```bash adb shell chmod 755 /data/local/start_valgrind_app ``` ```bash adb shell setprop wrap.org.libsdl.app "logwrapper /data/local/start_valgrind_app" ``` -------------------------------- ### SDL_Init with Function Pointers (C) Source: https://github.com/dark-basic-software-limited/gamegurumax/blob/main/GameGuru Core/SDK/RecastContrib/SDL/docs/README-dynapi.md Demonstrates how SDL_Init is implemented using a jump table of function pointers. The initial call to SDL_Init invokes a default function that sets up the jump table by calling SDL_InitDynamicAPI(). Subsequent calls use the function pointer from the jump table. ```c UInt32 SDL_Init(Uint32 flags) { return jump_table.SDL_Init(flags); } Uint32 SDL_Init_DEFAULT(Uint32 flags) { SDL_InitDynamicAPI(); return jump_table.SDL_Init(flags); } ``` -------------------------------- ### Conditional Installation of LinearMath Library in CMake Source: https://github.com/dark-basic-software-limited/gamegurumax/blob/main/GameGuru Core/SDK/BULLET/bullet-3.19/src/LinearMath/CMakeLists.txt This CMake script block handles the conditional installation of the LinearMath library. It checks if installation is enabled and if certain project file generation is disabled, then proceeds to install the library and its headers with platform-specific destinations. ```cmake IF (INSTALL_LIBS) IF (NOT INTERNAL_CREATE_DISTRIBUTABLE_MSVC_PROJECTFILES) #FILES_MATCHING requires CMake 2.6 IF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.5) IF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK) INSTALL(TARGETS LinearMath DESTINATION .) ELSE (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK) INSTALL(TARGETS LinearMath RUNTIME DESTINATION bin LIBRARY DESTINATION lib${LIB_SUFFIX} ARCHIVE DESTINATION lib${LIB_SUFFIX}) INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DESTINATION ${INCLUDE_INSTALL_DIR} FILES_MATCHING PATTERN "*.h" PATTERN ".svn" EXCLUDE PATTERN "CMakeFiles" EXCLUDE) ENDIF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK) ENDIF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.5) IF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK) SET_TARGET_PROPERTIES(LinearMath PROPERTIES FRAMEWORK true) SET_TARGET_PROPERTIES(LinearMath PROPERTIES PUBLIC_HEADER "${LinearMath_HDRS}") ENDIF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK) ENDIF (NOT INTERNAL_CREATE_DISTRIBUTABLE_MSVC_PROJECTFILES) ENDIF (INSTALL_LIBS) ``` -------------------------------- ### CoreBluetooth.framework Integration Source: https://github.com/dark-basic-software-limited/gamegurumax/blob/main/GameGuru Core/SDK/RecastContrib/SDL/docs/README-ios.md Information on enabling HIDAPI for game controllers and the necessary Info.plist configuration. ```APIDOC ## CoreBluetooth.framework Integration ### Description This section covers the use of `SDL_JOYSTICK_HIDAPI` for accessing a wider range of game controllers via Bluetooth on iOS, and the required privacy permissions. ### `SDL_JOYSTICK_HIDAPI` - Disabled by default. - Enables access to more game controller devices. - Requires user permission to interact with Bluetooth hardware. - "Made For iOS" controllers may not require this direct Bluetooth access. ### Info.plist Configuration To use Bluetooth features, you need to link with `CoreBluetooth.framework` and add the following key-value pair to your `Info.plist` file: ```xml NSBluetoothPeripheralUsageDescription MyApp would like to remain connected to nearby bluetooth Game Controllers and Game Pads even when you're not using the app. ``` ``` -------------------------------- ### Install DetourCrowd Library and Headers (CMake) Source: https://github.com/dark-basic-software-limited/gamegurumax/blob/main/GameGuru Core/Guru-WickedMAX/GGRecastDetour/DetourCrowd/CMakeLists.txt This CMake snippet defines the installation rules for the DetourCrowd library and its header files. It specifies the destination directories for runtime, archive, and library files, as well as the component for installation. It also installs header files and platform-specific PDB files for debugging. ```cmake install(TARGETS DetourCrowd RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT library ) file(GLOB INCLUDES Include/*.h) install(FILES ${INCLUDES} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/recastnavigation) if(MSVC) install(FILES "$/DetourCrowd-d.pdb" CONFIGURATIONS "Debug" DESTINATION "lib") endif() ``` -------------------------------- ### Install BulletSoftBody Library using CMake Source: https://github.com/dark-basic-software-limited/gamegurumax/blob/main/GameGuru Core/SDK/BULLET/bullet-3.19/src/BulletSoftBody/CMakeLists.txt This CMake code handles the installation of the BulletSoftBody library. It conditionally installs the library and headers based on the INSTALL_LIBS flag and platform-specific settings, such as framework builds on Apple. It ensures that header files are installed correctly, excluding version control and build-related directories. ```cmake IF (INSTALL_LIBS) IF (NOT INTERNAL_CREATE_DISTRIBUTABLE_MSVC_PROJECTFILES) IF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.5) IF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK) INSTALL(TARGETS BulletSoftBody DESTINATION .) ELSE (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK) INSTALL(TARGETS BulletSoftBody RUNTIME DESTINATION bin ``` -------------------------------- ### Game Center Integration Source: https://github.com/dark-basic-software-limited/gamegurumax/blob/main/GameGuru Core/SDK/RecastContrib/SDL/docs/README-ios.md How to integrate with Game Center using `SDL_iPhoneSetAnimationCallback` for proper event loop handling. ```APIDOC ## Game Center Integration ### Description Integrating with Game Center on iOS may require modifying the application's main loop to yield control to the system's event loop. This is achieved by using a callback function for frame updates. ### `SDL_iPhoneSetAnimationCallback()` #### Description Sets up a function to be called back on the animation callback, allowing the Cocoa event loop to run. #### Parameters - `window` (SDL_Window *) - The SDL window. - `interval` (int) - The interval in milliseconds between callbacks. - `callback` (void (*)(void*)) - The function to be called. - `callbackParam` (void *) - Parameter to pass to the callback function. #### Returns An integer status code. (Specific return codes not detailed in source text). ### Example Usage ```c extern "C" void ShowFrame(void*) { // ... handle events, frame logic, and rendering ... } int main(int argc, char *argv[]) { // ... initialize game ... #if __IPHONEOS__ // Initialize the Game Center for scoring and matchmaking InitGameCenter(); // Set up the game to run in the window animation callback on iOS SDL_iPhoneSetAnimationCallback(window, 1, ShowFrame, NULL); #else while ( running ) { ShowFrame(0); DelayFrame(); } #endif return 0; } ``` ``` -------------------------------- ### Install Bullet3Collision Library (CMake) Source: https://github.com/dark-basic-software-limited/gamegurumax/blob/main/GameGuru Core/SDK/BULLET/bullet-3.19/src/Bullet3Collision/CMakeLists.txt This CMake snippet defines the installation rules for the Bullet3Collision library. It handles different installation paths based on the operating system (Apple) and build type (shared libraries, frameworks). It also specifies how header files should be installed, excluding version control and build-related directories. ```cmake IF (INSTALL_LIBS) IF (NOT INTERNAL_CREATE_DISTRIBUTABLE_MSVC_PROJECTFILES) #FILES_MATCHING requires CMake 2.6 IF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.5) IF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK) INSTALL(TARGETS Bullet3Collision DESTINATION .) ELSE (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK) INSTALL(TARGETS Bullet3Collision RUNTIME DESTINATION bin LIBRARY DESTINATION lib${LIB_SUFFIX} ARCHIVE DESTINATION lib${LIB_SUFFIX}) INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DESTINATION ${INCLUDE_INSTALL_DIR} FILES_MATCHING PATTERN "*.h" PATTERN ".svn" EXCLUDE PATTERN "CMakeFiles" EXCLUDE) ENDIF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK) ENDIF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.5) IF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK) SET_TARGET_PROPERTIES(Bullet3Collision PROPERTIES FRAMEWORK true) SET_TARGET_PROPERTIES(Bullet3Collision PROPERTIES PUBLIC_HEADER "${Bullet3Collision_HDRS}") # Have to list out sub-directories manually: #todo #SET_PROPERTY(SOURCE ${Bullet3CollisionBroadPhase_HDRS} PROPERTY MACOSX_PACKAGE_LOCATION Headers/BroadPhaseCollision) ENDIF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK) ENDIF (NOT INTERNAL_CREATE_DISTRIBUTABLE_MSVC_PROJECTFILES) ENDIF (INSTALL_LIBS) ``` -------------------------------- ### Install DetourTileCache Library and Headers with CMake Source: https://github.com/dark-basic-software-limited/gamegurumax/blob/main/GameGuru Core/Guru-WickedMAX/GGRecastDetour/DetourTileCache/CMakeLists.txt This CMake snippet handles the installation of the DetourTileCache library and its header files. It specifies the destination directories for runtime binaries, archives, and libraries. It also installs header files into the recastnavigation subdirectory and includes platform-specific PDB file installation for Debug configurations on MSVC. ```cmake install(TARGETS DetourTileCache RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT library ) file(GLOB INCLUDES Include/*.h) install(FILES ${INCLUDES} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/recastnavigation) if(MSVC) install(FILES "$/DetourTileCache-d.pdb" CONFIGURATIONS "Debug" DESTINATION "lib") endif() ``` -------------------------------- ### Install BulletCollision Library (CMake) Source: https://github.com/dark-basic-software-limited/gamegurumax/blob/main/GameGuru Core/SDK/BULLET/bullet-3.19/src/BulletCollision/CMakeLists.txt Configures the installation of the BulletCollision library using CMake. It handles platform-specific installation paths for targets, libraries, and headers, with a dependency on CMake version 2.6 or higher. ```cmake IF (NOT INTERNAL_CREATE_DISTRIBUTABLE_MSVC_PROJECTFILES) #INSTALL of other files requires CMake 2.6 IF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.5) IF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK) INSTALL(TARGETS BulletCollision DESTINATION .) ELSE (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK) INSTALL(TARGETS BulletCollision RUNTIME DESTINATION bin LIBRARY DESTINATION lib${LIB_SUFFIX} ARCHIVE DESTINATION lib${LIB_SUFFIX}) INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DESTINATION ${INCLUDE_INSTALL_DIR} FILES_MATCHING PATTERN "*.h" PATTERN ".svn" EXCLUDE PATTERN "CMakeFiles" EXCLUDE) INSTALL(FILES ../btBulletCollisionCommon.h DESTINATION ${INCLUDE_INSTALL_DIR}/BulletCollision) ENDIF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK) ENDIF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.5) IF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK) SET_TARGET_PROPERTIES(BulletCollision PROPERTIES FRAMEWORK true) SET_TARGET_PROPERTIES(BulletCollision PROPERTIES PUBLIC_HEADER "${Root_HDRS}") # Have to list out sub-directories manually: SET_PROPERTY(SOURCE ${BroadphaseCollision_HDRS} PROPERTY MACOSX_PACKAGE_LOCATION Headers/BroadphaseCollision) SET_PROPERTY(SOURCE ${CollisionDispatch_HDRS} PROPERTY MACOSX_PACKAGE_LOCATION Headers/CollisionDispatch) SET_PROPERTY(SOURCE ${CollisionShapes_HDRS} PROPERTY MACOSX_PACKAGE_LOCATION Headers/CollisionShapes) SET_PROPERTY(SOURCE ${Gimpact_HDRS} PROPERTY MACOSX_PACKAGE_LOCATION Headers/Gimpact) SET_PROPERTY(SOURCE ${NarrowPhaseCollision_HDRS} PROPERTY MACOSX_PACKAGE_LOCATION Headers/NarrowPhaseCollision) ENDIF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK) ENDIF (NOT INTERNAL_CREATE_DISTRIBUTABLE_MSVC_PROJECTFILES) ENDIF (INSTALL_LIBS) ``` -------------------------------- ### Install Recast Library Components (CMake) Source: https://github.com/dark-basic-software-limited/gamegurumax/blob/main/GameGuru Core/Guru-WickedMAX/GGRecastDetour/Recast/CMakeLists.txt This CMake code defines the installation rules for the Recast library. It specifies where the runtime, archive, and library files should be installed, along with the component name for the library. ```cmake install(TARGETS Recast RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT library ) ``` -------------------------------- ### Install Recast Header Files (CMake) Source: https://github.com/dark-basic-software-limited/gamegurumax/blob/main/GameGuru Core/Guru-WickedMAX/GGRecastDetour/Recast/CMakeLists.txt This CMake command installs the header files for the Recast library. It finds all header files in the 'Include' directory and installs them into the appropriate include directory for the project, under a 'recastnavigation' subdirectory. ```cmake file(GLOB INCLUDES Include/*.h) install(FILES ${INCLUDES} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/recastnavigation) ``` -------------------------------- ### Checkout Valgrind Source Code Source: https://github.com/dark-basic-software-limited/gamegurumax/blob/main/GameGuru Core/SDK/RecastContrib/SDL/docs/README-android.md This command uses Subversion (SVN) to download the Valgrind source code from its repository. This is the first step to building Valgrind for Android development. ```bash svn co svn://svn.valgrind.org/valgrind/trunk valgrind ``` -------------------------------- ### Build SDL_gfx with Emconfigure Source: https://github.com/dark-basic-software-limited/gamegurumax/blob/main/GameGuru Core/SDK/RecastContrib/SDL/docs/README-emscripten.md Instructions for building the SDL_gfx library with Emscripten. It uses 'EMCONFIGURE_JS=1' and 'emconfigure' with an option to disable MMX, followed by the usual build steps. ```bash $ EMCONFIGURE_JS=1 emconfigure ../configure --disable-mmx build as usual... ``` -------------------------------- ### Install Bullet3Dynamics Library using CMake Source: https://github.com/dark-basic-software-limited/gamegurumax/blob/main/GameGuru Core/SDK/BULLET/bullet-3.19/src/Bullet3Dynamics/CMakeLists.txt This CMake code block handles the installation of the Bullet3Dynamics library. It includes conditional logic for different platforms (Apple) and build types (shared libraries, frameworks), specifying installation destinations for binaries, libraries, and headers. ```cmake IF (INSTALL_LIBS) IF (NOT INTERNAL_CREATE_DISTRIBUTABLE_MSVC_PROJECTFILES) #FILES_MATCHING requires CMake 2.6 IF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.5) IF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK) INSTALL(TARGETS Bullet3Dynamics DESTINATION .) ELSE (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK) INSTALL(TARGETS Bullet3Dynamics RUNTIME DESTINATION bin LIBRARY DESTINATION lib${LIB_SUFFIX} ARCHIVE DESTINATION lib${LIB_SUFFIX}) INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DESTINATION ${INCLUDE_INSTALL_DIR} FILES_MATCHING PATTERN "*.h" PATTERN ".svn" EXCLUDE PATTERN "CMakeFiles" EXCLUDE) ENDIF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK) ENDIF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.5) IF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK) SET_TARGET_PROPERTIES(Bullet3Dynamics PROPERTIES FRAMEWORK true) SET_TARGET_PROPERTIES(Bullet3Dynamics PROPERTIES PUBLIC_HEADER "${Bullet3Dynamics_HDRS}") ENDIF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK) ENDIF (NOT INTERNAL_CREATE_DISTRIBUTABLE_MSVC_PROJECTFILES) ENDIF (INSTALL_LIBS) ``` -------------------------------- ### Build SDL_mixer with Emconfigure Source: https://github.com/dark-basic-software-limited/gamegurumax/blob/main/GameGuru Core/SDK/RecastContrib/SDL/docs/README-emscripten.md Instructions for building the SDL_mixer library using Emscripten. It utilizes 'EMCONFIGURE_JS=1' and 'emconfigure' for JavaScript-specific configuration before proceeding with the standard build process. ```bash $ EMCONFIGURE_JS=1 emconfigure ../configure build as usual... ``` -------------------------------- ### Install Bullet3Geometry Library (CMake) Source: https://github.com/dark-basic-software-limited/gamegurumax/blob/main/GameGuru Core/SDK/BULLET/bullet-3.19/src/Bullet3Geometry/CMakeLists.txt This CMake snippet handles the installation of the Bullet3Geometry library. It includes conditional logic for different platforms (Apple) and build types (shared libraries), specifying runtime, library, and archive destinations. It also installs header files, excluding version control and build-related directories. ```cmake IF (INSTALL_LIBS) IF (NOT INTERNAL_CREATE_DISTRIBUTABLE_MSVC_PROJECTFILES) #FILES_MATCHING requires CMake 2.6 IF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.5) IF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK) INSTALL(TARGETS Bullet3Geometry DESTINATION .) ELSE (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK) INSTALL(TARGETS Bullet3Geometry RUNTIME DESTINATION bin LIBRARY DESTINATION lib${LIB_SUFFIX} ARCHIVE DESTINATION lib${LIB_SUFFIX}) INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DESTINATION ${INCLUDE_INSTALL_DIR} FILES_MATCHING PATTERN "*.h" PATTERN ".svn" EXCLUDE PATTERN "CMakeFiles" EXCLUDE) ENDIF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK) ENDIF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.5) IF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK) SET_TARGET_PROPERTIES(Bullet3Geometry PROPERTIES FRAMEWORK true) SET_TARGET_PROPERTIES(Bullet3Geometry PROPERTIES PUBLIC_HEADER "${Bullet3Geometry_HDRS}") ENDIF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK) ENDIF (NOT INTERNAL_CREATE_DISTRIBUTABLE_MSVC_PROJECTFILES) ENDIF (INSTALL_LIBS) ``` -------------------------------- ### Build SDL with Command Line on Mac OS X Source: https://github.com/dark-basic-software-limited/gamegurumax/blob/main/GameGuru Core/SDK/RecastContrib/SDL/docs/README-macosx.md Standard process to build SDL using the command line on Mac OS X. This involves running the configure script, followed by make and make install. It assumes a standard development environment is set up. ```bash ./configure make sudo make install ``` -------------------------------- ### Install Library Files with CMake Source: https://github.com/dark-basic-software-limited/gamegurumax/blob/main/GameGuru Core/SDK/BULLET/bullet-3.19/Extras/GIMPACTUtils/CMakeLists.txt This CMake code snippet handles the installation of the GIMPACTUtils library and its header files. It includes conditional logic for different platforms (like Apple) and build types (shared vs. static libraries), specifying installation destinations for runtime, library, and archive files, as well as header files. ```cmake IF (INSTALL_EXTRA_LIBS) IF (NOT INTERNAL_CREATE_DISTRIBUTABLE_MSVC_PROJECTFILES) #FILES_MATCHING requires CMake 2.6 IF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.5) IF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK) INSTALL(TARGETS GIMPACTUtils DESTINATION .) ELSE (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK) INSTALL(TARGETS GIMPACTUtils RUNTIME DESTINATION bin LIBRARY DESTINATION lib${LIB_SUFFIX} ARCHIVE DESTINATION lib${LIB_SUFFIX}) INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DESTINATION ${INCLUDE_INSTALL_DIR} FILES_MATCHING PATTERN "*.h" PATTERN ".svn" EXCLUDE PATTERN "CMakeFiles" EXCLUDE) ENDIF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK) ENDIF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.5) IF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK) SET_TARGET_PROPERTIES(GIMPACTUtils PROPERTIES FRAMEWORK true) SET_TARGET_PROPERTIES(GIMPACTUtils PROPERTIES PUBLIC_HEADER "btGImpactConvexDecompositionShape.h") ENDIF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK) ENDIF (NOT INTERNAL_CREATE_DISTRIBUTABLE_MSVC_PROJECTFILES) ENDIF (INSTALL_EXTRA_LIBS) ``` -------------------------------- ### Set DebugUtils Library Properties and Install (CMake) Source: https://github.com/dark-basic-software-limited/gamegurumax/blob/main/GameGuru Core/Guru-WickedMAX/GGRecastDetour/DebugUtils/CMakeLists.txt This snippet sets specific properties for the DebugUtils library, including its SOVERSION and VERSION. It also defines the installation rules for the library's runtime, archive, and library files, along with a component for 'library'. Additionally, it installs header files and platform-specific PDB files for MSVC debug builds. ```cmake set_target_properties(DebugUtils PROPERTIES SOVERSION ${SOVERSION} VERSION ${LIB_VERSION} COMPILE_PDB_OUTPUT_DIRECTORY . COMPILE_PDB_NAME "DebugUtils-d" ) install(TARGETS DebugUtils RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT library ) file(GLOB INCLUDES Include/*.h) install(FILES ${INCLUDES} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/recastnavigation) if(MSVC) install(FILES "$/DebugUtils-d.pdb" CONFIGURATIONS "Debug" DESTINATION "lib") endif() ``` -------------------------------- ### Build SDL Tests with naclbuild.sh Source: https://github.com/dark-basic-software-limited/gamegurumax/blob/main/GameGuru Core/SDK/RecastContrib/SDL/docs/README-nacl.md The naclbuild.sh script automates the process of building SDL tests for Native Client. It requires the path to the Pepper toolchain. The script can build a default test or a specified source file. ```bash ./naclbuild.sh path/to/pepper/toolchain SOURCES=~/sdl/SDL/test/testrendercopyex.c ./naclbuild.sh ~/naclsdk/pepper_35 ``` -------------------------------- ### Build SDL2 Test Case with Emcc Source: https://github.com/dark-basic-software-limited/gamegurumax/blob/main/GameGuru Core/SDK/RecastContrib/SDL/docs/README-emscripten.md This snippet shows how to build a specific SDL2 test case ('testdraw2.c') using 'emcc'. It includes optimization flags, debugging options, and links against necessary SDL2 libraries. ```bash $ cd test/ $ emcc -O2 --js-opts 0 -g4 testdraw2.c -I../include ../build/.libs/libSDL2.a ../build/libSDL2_test.a -o a.html ```