1
0
Fork 0

Add files

This commit is contained in:
Austin Morlan 2022-08-01 16:11:10 -07:00
parent ead20d7930
commit 682d87540f
Signed by: austin
GPG Key ID: FD6B27654AF5E348
1596 changed files with 697416 additions and 0 deletions

212
CMakeLists.txt Normal file
View File

@ -0,0 +1,212 @@
cmake_minimum_required(VERSION 3.16)
###########################################################
# COMPILER CONFIGURATION
###########################################################
set(CMAKE_C_COMPILER "clang" CACHE STRING "C compiler" FORCE)
set(CMAKE_CXX_COMPILER "clang++" CACHE STRING "C++ compiler" FORCE)
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O2")
set(DEPENDENCY_WARNINGS "-w")
set(PROJECT_WARNINGS
-Werror
-W -Wall -Wextra -Wshadow
-Wno-unused-result -Wno-unused-function -Wno-implicit-fallthrough)
set(PROJECT_PROPERTIES
C_STANDARD 99
C_STANDARD_REQUIRED 99
C_EXTENSIONS OFF)
if(UNIX)
set(PROJECT_PROPERTIES ${PROJECT_PROPERTIES} LINK_FLAGS "-Wl,-rpath,./")
endif()
###########################################################
# PROJECT
###########################################################
set(PROJECT obolos)
project(${PROJECT})
set(BIN ${PROJECT})
set(GAME game)
###########################################################
# DIRECTORIES
###########################################################
set(3RD_PARTY_DIR ${CMAKE_SOURCE_DIR}/code/3rd_party)
set(SRC_DIR ${CMAKE_SOURCE_DIR}/code/src)
set(ASSET_DIR ${CMAKE_SOURCE_DIR}/assets/processed)
set(SHADER_DIR ${CMAKE_SOURCE_DIR}/code/shaders)
set(SCRIPTS_DIR ${CMAKE_SOURCE_DIR}/tools/scripts)
set(PACKAGE_DIR ${CMAKE_BINARY_DIR}/package)
###########################################################
# 3RD PARTY LIBRARIES
###########################################################
# glad
add_subdirectory(${3RD_PARTY_DIR}/glad EXCLUDE_FROM_ALL)
# SDL
set(SDL_SHARED ON CACHE BOOL "" FORCE)
set(SDL_STATIC OFF CACHE BOOL "" FORCE)
add_subdirectory(${3RD_PARTY_DIR}/sdl-2.0.20 EXCLUDE_FROM_ALL)
set_target_properties(SDL2 PROPERTIES COMPILE_FLAGS ${DEPENDENCY_WARNINGS})
set_target_properties(SDL2main PROPERTIES COMPILE_FLAGS ${DEPENDENCY_WARNINGS})
###########################################################
# ASSETS
###########################################################
# Copy processed assets and shaders to build directory
add_custom_target(
invalidate_assets ALL
COMMAND ${CMAKE_COMMAND} -E touch
${ASSET_DIR}
COMMAND ${CMAKE_COMMAND} -E touch
${SHADER_DIR})
add_custom_command(
TARGET invalidate_assets POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory ${ASSET_DIR}/ ${CMAKE_BINARY_DIR}
COMMAND ${CMAKE_COMMAND} -E copy_directory ${SHADER_DIR} ${CMAKE_BINARY_DIR}/shaders)
###########################################################
# TARGETS
###########################################################
add_executable(${BIN})
add_library(${GAME} SHARED)
###########################################################
# BUILD CONFIGURATIONS
###########################################################
set(BIN_SRCS ${SRC_DIR}/main.c)
set(GAME_SRCS ${SRC_DIR}/all.c)
set(BIN_LIBS glad SDL2)
set(GAME_LIBS glad SDL2)
if(WIN32)
set(BIN_LIBS
${BIN_LIBS}
mingw32
SDL2main)
endif()
if (CMAKE_BUILD_TYPE STREQUAL "Release")
add_compile_definitions(BUILD_RELEASE)
set(GAME_SRCS ${GAME_SRCS} ${SRC_DIR}/engine/glsl.inc)
add_custom_command(
PRE_BUILD
OUTPUT ${SRC_DIR}/engine/glsl.inc
COMMAND
${SCRIPTS_DIR}/header_generator.sh
${SRC_DIR}/engine/glsl.inc # output
${SHADER_DIR}/geo.glsl # input
${SHADER_DIR}/screen.glsl # input
${SHADER_DIR}/text.glsl # input
DEPENDS
${SHADER_DIR}/geo.glsl
${SHADER_DIR}/screen.glsl
${SHADER_DIR}/text.glsl)
add_custom_command(
TARGET ${GAME}
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E rm ${SRC_DIR}/engine/glsl.inc)
elseif(CMAKE_BUILD_TYPE STREQUAL "Debug")
add_compile_definitions(BUILD_DEBUG)
# Required for a valid language server compilation database to be generated with unity builds
if (CMAKE_EXPORT_COMPILE_COMMANDS)
file(GLOB GAME_SRCS
${SRC_DIR}/all.c
${SRC_DIR}/engine/*.c
${SRC_DIR}/game/*.c)
target_compile_options(
${GAME}
PRIVATE
-include ${SRC_DIR}/all.c)
endif()
else()
message(FATAL_ERROR "No build configuration selected")
endif()
###########################################################
# GAME LIBRARY
###########################################################
set_target_properties(${GAME} PROPERTIES ${PROJECT_PROPERTIES})
target_sources(
${GAME}
PRIVATE
${GAME_SRCS})
target_link_libraries(
${GAME}
PRIVATE
${GAME_LIBS})
target_compile_options(
${GAME}
PRIVATE
${PROJECT_WARNINGS})
###########################################################
# EXECUTABLE
###########################################################
set_target_properties(${BIN} PROPERTIES ${PROJECT_PROPERTIES})
target_sources(
${BIN}
PRIVATE
${BIN_SRCS})
target_link_libraries(
${BIN}
PRIVATE
${BIN_LIBS})
target_compile_options(
${BIN}
PRIVATE
${PROJECT_WARNINGS})
add_custom_target(
run
COMMAND ${BIN}
DEPENDS ${BIN} ${GAME} ${ENGINE}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
###########################################################
# INSTALL
###########################################################
install(
TARGETS ${BIN} ${GAME} ${ENGINE} ${BIN_LIBS} ${GAME_LIBS} ${ENGINE_LIBS}
CONFIGURATIONS Release
RUNTIME DESTINATION ${PACKAGE_DIR}
LIBRARY DESTINATION ${PACKAGE_DIR})
install(
DIRECTORY ${ASSET_DIR}/
CONFIGURATIONS Release
DESTINATION ${PACKAGE_DIR})

Binary file not shown.

BIN
assets/export/sfx/coin.wav Normal file

Binary file not shown.

BIN
assets/export/sfx/enemy.wav Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 174 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 443 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

BIN
assets/processed/data.bin Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

BIN
assets/source/sfx/coin.aup3 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

8
code/3rd_party/glad/CMakeLists.txt vendored Normal file
View File

@ -0,0 +1,8 @@
cmake_minimum_required(VERSION 3.16)
project(glad)
add_library(glad SHARED)
target_sources(glad PRIVATE src/gl.c)
target_include_directories(glad PUBLIC include)

View File

@ -0,0 +1,311 @@
#ifndef __khrplatform_h_
#define __khrplatform_h_
/*
** Copyright (c) 2008-2018 The Khronos Group Inc.
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and/or associated documentation files (the
** "Materials"), to deal in the Materials without restriction, including
** without limitation the rights to use, copy, modify, merge, publish,
** distribute, sublicense, and/or sell copies of the Materials, and to
** permit persons to whom the Materials are furnished to do so, subject to
** the following conditions:
**
** The above copyright notice and this permission notice shall be included
** in all copies or substantial portions of the Materials.
**
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/
/* Khronos platform-specific types and definitions.
*
* The master copy of khrplatform.h is maintained in the Khronos EGL
* Registry repository at https://github.com/KhronosGroup/EGL-Registry
* The last semantic modification to khrplatform.h was at commit ID:
* 67a3e0864c2d75ea5287b9f3d2eb74a745936692
*
* Adopters may modify this file to suit their platform. Adopters are
* encouraged to submit platform specific modifications to the Khronos
* group so that they can be included in future versions of this file.
* Please submit changes by filing pull requests or issues on
* the EGL Registry repository linked above.
*
*
* See the Implementer's Guidelines for information about where this file
* should be located on your system and for more details of its use:
* http://www.khronos.org/registry/implementers_guide.pdf
*
* This file should be included as
* #include <KHR/khrplatform.h>
* by Khronos client API header files that use its types and defines.
*
* The types in khrplatform.h should only be used to define API-specific types.
*
* Types defined in khrplatform.h:
* khronos_int8_t signed 8 bit
* khronos_uint8_t unsigned 8 bit
* khronos_int16_t signed 16 bit
* khronos_uint16_t unsigned 16 bit
* khronos_int32_t signed 32 bit
* khronos_uint32_t unsigned 32 bit
* khronos_int64_t signed 64 bit
* khronos_uint64_t unsigned 64 bit
* khronos_intptr_t signed same number of bits as a pointer
* khronos_uintptr_t unsigned same number of bits as a pointer
* khronos_ssize_t signed size
* khronos_usize_t unsigned size
* khronos_float_t signed 32 bit floating point
* khronos_time_ns_t unsigned 64 bit time in nanoseconds
* khronos_utime_nanoseconds_t unsigned time interval or absolute time in
* nanoseconds
* khronos_stime_nanoseconds_t signed time interval in nanoseconds
* khronos_boolean_enum_t enumerated boolean type. This should
* only be used as a base type when a client API's boolean type is
* an enum. Client APIs which use an integer or other type for
* booleans cannot use this as the base type for their boolean.
*
* Tokens defined in khrplatform.h:
*
* KHRONOS_FALSE, KHRONOS_TRUE Enumerated boolean false/true values.
*
* KHRONOS_SUPPORT_INT64 is 1 if 64 bit integers are supported; otherwise 0.
* KHRONOS_SUPPORT_FLOAT is 1 if floats are supported; otherwise 0.
*
* Calling convention macros defined in this file:
* KHRONOS_APICALL
* KHRONOS_APIENTRY
* KHRONOS_APIATTRIBUTES
*
* These may be used in function prototypes as:
*
* KHRONOS_APICALL void KHRONOS_APIENTRY funcname(
* int arg1,
* int arg2) KHRONOS_APIATTRIBUTES;
*/
#if defined(__SCITECH_SNAP__) && !defined(KHRONOS_STATIC)
# define KHRONOS_STATIC 1
#endif
/*-------------------------------------------------------------------------
* Definition of KHRONOS_APICALL
*-------------------------------------------------------------------------
* This precedes the return type of the function in the function prototype.
*/
#if defined(KHRONOS_STATIC)
/* If the preprocessor constant KHRONOS_STATIC is defined, make the
* header compatible with static linking. */
# define KHRONOS_APICALL
#elif defined(_WIN32)
# define KHRONOS_APICALL __declspec(dllimport)
#elif defined (__SYMBIAN32__)
# define KHRONOS_APICALL IMPORT_C
#elif defined(__ANDROID__)
# define KHRONOS_APICALL __attribute__((visibility("default")))
#else
# define KHRONOS_APICALL
#endif
/*-------------------------------------------------------------------------
* Definition of KHRONOS_APIENTRY
*-------------------------------------------------------------------------
* This follows the return type of the function and precedes the function
* name in the function prototype.
*/
#if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__SCITECH_SNAP__)
/* Win32 but not WinCE */
# define KHRONOS_APIENTRY __stdcall
#else
# define KHRONOS_APIENTRY
#endif
/*-------------------------------------------------------------------------
* Definition of KHRONOS_APIATTRIBUTES
*-------------------------------------------------------------------------
* This follows the closing parenthesis of the function prototype arguments.
*/
#if defined (__ARMCC_2__)
#define KHRONOS_APIATTRIBUTES __softfp
#else
#define KHRONOS_APIATTRIBUTES
#endif
/*-------------------------------------------------------------------------
* basic type definitions
*-----------------------------------------------------------------------*/
#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__GNUC__) || defined(__SCO__) || defined(__USLC__)
/*
* Using <stdint.h>
*/
#include <stdint.h>
typedef int32_t khronos_int32_t;
typedef uint32_t khronos_uint32_t;
typedef int64_t khronos_int64_t;
typedef uint64_t khronos_uint64_t;
#define KHRONOS_SUPPORT_INT64 1
#define KHRONOS_SUPPORT_FLOAT 1
/*
* To support platform where unsigned long cannot be used interchangeably with
* inptr_t (e.g. CHERI-extended ISAs), we can use the stdint.h intptr_t.
* Ideally, we could just use (u)intptr_t everywhere, but this could result in
* ABI breakage if khronos_uintptr_t is changed from unsigned long to
* unsigned long long or similar (this results in different C++ name mangling).
* To avoid changes for existing platforms, we restrict usage of intptr_t to
* platforms where the size of a pointer is larger than the size of long.
*/
#if defined(__SIZEOF_LONG__) && defined(__SIZEOF_POINTER__)
#if __SIZEOF_POINTER__ > __SIZEOF_LONG__
#define KHRONOS_USE_INTPTR_T
#endif
#endif
#elif defined(__VMS ) || defined(__sgi)
/*
* Using <inttypes.h>
*/
#include <inttypes.h>
typedef int32_t khronos_int32_t;
typedef uint32_t khronos_uint32_t;
typedef int64_t khronos_int64_t;
typedef uint64_t khronos_uint64_t;
#define KHRONOS_SUPPORT_INT64 1
#define KHRONOS_SUPPORT_FLOAT 1
#elif defined(_WIN32) && !defined(__SCITECH_SNAP__)
/*
* Win32
*/
typedef __int32 khronos_int32_t;
typedef unsigned __int32 khronos_uint32_t;
typedef __int64 khronos_int64_t;
typedef unsigned __int64 khronos_uint64_t;
#define KHRONOS_SUPPORT_INT64 1
#define KHRONOS_SUPPORT_FLOAT 1
#elif defined(__sun__) || defined(__digital__)
/*
* Sun or Digital
*/
typedef int khronos_int32_t;
typedef unsigned int khronos_uint32_t;
#if defined(__arch64__) || defined(_LP64)
typedef long int khronos_int64_t;
typedef unsigned long int khronos_uint64_t;
#else
typedef long long int khronos_int64_t;
typedef unsigned long long int khronos_uint64_t;
#endif /* __arch64__ */
#define KHRONOS_SUPPORT_INT64 1
#define KHRONOS_SUPPORT_FLOAT 1
#elif 0
/*
* Hypothetical platform with no float or int64 support
*/
typedef int khronos_int32_t;
typedef unsigned int khronos_uint32_t;
#define KHRONOS_SUPPORT_INT64 0
#define KHRONOS_SUPPORT_FLOAT 0
#else
/*
* Generic fallback
*/
#include <stdint.h>
typedef int32_t khronos_int32_t;
typedef uint32_t khronos_uint32_t;
typedef int64_t khronos_int64_t;
typedef uint64_t khronos_uint64_t;
#define KHRONOS_SUPPORT_INT64 1
#define KHRONOS_SUPPORT_FLOAT 1
#endif
/*
* Types that are (so far) the same on all platforms
*/
typedef signed char khronos_int8_t;
typedef unsigned char khronos_uint8_t;
typedef signed short int khronos_int16_t;
typedef unsigned short int khronos_uint16_t;
/*
* Types that differ between LLP64 and LP64 architectures - in LLP64,
* pointers are 64 bits, but 'long' is still 32 bits. Win64 appears
* to be the only LLP64 architecture in current use.
*/
#ifdef KHRONOS_USE_INTPTR_T
typedef intptr_t khronos_intptr_t;
typedef uintptr_t khronos_uintptr_t;
#elif defined(_WIN64)
typedef signed long long int khronos_intptr_t;
typedef unsigned long long int khronos_uintptr_t;
#else
typedef signed long int khronos_intptr_t;
typedef unsigned long int khronos_uintptr_t;
#endif
#if defined(_WIN64)
typedef signed long long int khronos_ssize_t;
typedef unsigned long long int khronos_usize_t;
#else
typedef signed long int khronos_ssize_t;
typedef unsigned long int khronos_usize_t;
#endif
#if KHRONOS_SUPPORT_FLOAT
/*
* Float type
*/
typedef float khronos_float_t;
#endif
#if KHRONOS_SUPPORT_INT64
/* Time types
*
* These types can be used to represent a time interval in nanoseconds or
* an absolute Unadjusted System Time. Unadjusted System Time is the number
* of nanoseconds since some arbitrary system event (e.g. since the last
* time the system booted). The Unadjusted System Time is an unsigned
* 64 bit value that wraps back to 0 every 584 years. Time intervals
* may be either signed or unsigned.
*/
typedef khronos_uint64_t khronos_utime_nanoseconds_t;
typedef khronos_int64_t khronos_stime_nanoseconds_t;
#endif
/*
* Dummy value used to pad enum types to 32 bits.
*/
#ifndef KHRONOS_MAX_ENUM
#define KHRONOS_MAX_ENUM 0x7FFFFFFF
#endif
/*
* Enumerated boolean type
*
* Values other than zero should be considered to be true. Therefore
* comparisons should not be made against KHRONOS_TRUE.
*/
typedef enum {
KHRONOS_FALSE = 0,
KHRONOS_TRUE = 1,
KHRONOS_BOOLEAN_ENUM_FORCE_SIZE = KHRONOS_MAX_ENUM
} khronos_boolean_enum_t;
#endif /* __khrplatform_h_ */

2350
code/3rd_party/glad/include/glad/gl.h vendored Normal file

File diff suppressed because it is too large Load Diff

1059
code/3rd_party/glad/src/gl.c vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
<!--- Provide a general summary of your changes in the Title above -->
## Description
<!--- Describe your changes in detail -->
## Existing Issue(s)
<!--- If it fixes an open issue, please link to the issue here. -->

View File

@ -0,0 +1,14 @@
name: Build (Android)
on: [push, pull_request]
jobs:
android:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: nttld/setup-ndk@v1
with:
ndk-version: r21e
- name: Build
run: ./build-scripts/androidbuildlibs.sh

View File

@ -0,0 +1,16 @@
name: Build (Emscripten)
on: [push, pull_request]
jobs:
emscripten:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: mymindstorm/setup-emsdk@v10
with:
version: 2.0.27
- name: Configure CMake
run: emcmake cmake -B build
- name: Build
run: cmake --build build/

View File

@ -0,0 +1,20 @@
name: Build (iOS/tvOS)
on: [push, pull_request]
jobs:
Build:
name: ${{ matrix.platform.name }}
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
platform:
- { name: iOS, target: Static Library-iOS, sdk: iphoneos }
- { name: tvOS, target: Static Library-tvOS, sdk: appletvos }
steps:
- uses: actions/checkout@v2
- name: Build
run: xcodebuild -project Xcode/SDL/SDL.xcodeproj -target '${{ matrix.platform.target }}' -configuration Release -sdk ${{ matrix.platform.sdk }} clean build

View File

@ -0,0 +1,88 @@
name: Build
on: [push, pull_request]
jobs:
Build:
name: ${{ matrix.platform.name }}
runs-on: ${{ matrix.platform.os }}
defaults:
run:
shell: ${{ matrix.platform.shell }}
strategy:
fail-fast: false
matrix:
platform:
- { name: Windows (x64), os: windows-latest, shell: pwsh, flags: -A x64 }
- { name: Windows (x86), os: windows-latest, shell: pwsh, flags: -A Win32 }
- { name: Windows (clang-cl x64), os: windows-latest, shell: pwsh, flags: -T ClangCL -A x64 }
- { name: Windows (clang-cl x86), os: windows-latest, shell: pwsh, flags: -T ClangCL -A Win32 }
- { name: Windows (ARM64), os: windows-latest, shell: pwsh, flags: -A ARM64 }
- { name: Windows (mingw32), os: windows-latest, shell: 'msys2 {0}', msystem: mingw32, msys-env: mingw-w64-i686 }
- { name: Windows (mingw64), os: windows-latest, shell: 'msys2 {0}', msystem: mingw64, msys-env: mingw-w64-x86_64 }
- { name: Linux, os: ubuntu-20.04, shell: sh, flags: -GNinja }
- { name: MacOS, os: macos-latest, shell: sh }
steps:
- name: Set up MSYS2
if: matrix.platform.shell == 'msys2 {0}'
uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.platform.msystem }}
install: >-
${{ matrix.platform.msys-env }}-gcc
${{ matrix.platform.msys-env }}-cmake
${{ matrix.platform.msys-env }}-ninja
${{ matrix.platform.msys-env }}-pkg-config
- name: Setup Linux dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install wayland-protocols \
pkg-config \
ninja-build \
libasound2-dev \
libdbus-1-dev \
libegl1-mesa-dev \
libgl1-mesa-dev \
libgles2-mesa-dev \
libglu1-mesa-dev \
libibus-1.0-dev \
libpulse-dev \
libsdl2-2.0-0 \
libsndio-dev \
libudev-dev \
libwayland-dev \
libwayland-client++0 \
wayland-scanner++ \
libwayland-cursor++0 \
libx11-dev \
libxcursor-dev \
libxext-dev \
libxi-dev \
libxinerama-dev \
libxkbcommon-dev \
libxrandr-dev \
libxss-dev \
libxt-dev \
libxv-dev \
libxxf86vm-dev \
libdrm-dev \
libgbm-dev\
libpulse-dev \
libpango1.0-dev
sudo apt install meson
git clone --depth 1 https://gitlab.gnome.org/jadahl/libdecor.git --branch 0.1.0
cd libdecor
meson build --buildtype release -Ddemo=false -Ddbus=disabled
ninja -C build
sudo meson install -C build
- uses: actions/checkout@v2
- name: Configure CMake
run: cmake -B build -DSDL_TEST=ON ${{ matrix.platform.flags }}
- name: Build
run: cmake --build build/

View File

@ -0,0 +1,26 @@
name: Build (OS/2)
on: [push, pull_request]
jobs:
os2:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Cache OpenWatcom
uses: actions/cache@v2
env:
cache-name: cache-openwatcom
with:
path: ~/openwatcom
key: ${{ runner.os }}-build-${{ env.cache-name }}
- name: Download OpenWatcom if not cached
run: if [ ! -d ~/openwatcom/binl64 ]; then wget --no-verbose 'https://github.com/open-watcom/open-watcom-v2/releases/download/Current-build/open-watcom-2_0-c-linux-x64' -O ~/ow.zip && mkdir -p ~/openwatcom && cd ~/openwatcom && unzip ~/ow.zip && chmod -R a+rx ~/openwatcom ; fi
shell: bash
- name: Build
run: WATCOM="$HOME/openwatcom" build-scripts/os2-buildbot.sh
shell: bash

View File

@ -0,0 +1,18 @@
name: Build (Sony Playstation Portable)
on: [push, pull_request]
jobs:
psp:
runs-on: ubuntu-latest
container: pspdev/pspdev:latest
steps:
- uses: actions/checkout@v2
- name: Setup dependencies
run: |
apk update
apk add cmake gmp mpc1 mpfr4 make
- name: Configure CMake
run: cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=$PSPDEV/psp/share/pspdev.cmake -DSDL_TEST=ON
- name: Build
run: cmake --build build

View File

@ -0,0 +1,28 @@
name: Build (RISC OS)
on: [push, pull_request]
jobs:
autotools:
name: autotools
runs-on: ubuntu-latest
container: riscosdotinfo/riscos-gccsdk-4.7:latest
steps:
- uses: actions/checkout@v2
- name: Configure
run: ./configure --host=arm-unknown-riscos --disable-gcc-atomics
- name: Build
run: make -j`nproc`
cmake:
name: CMake
runs-on: ubuntu-latest
container: riscosdotinfo/riscos-gccsdk-4.7:latest
steps:
- name: Setup dependencies
run: apt-get update && apt-get install -y cmake ninja-build
- uses: actions/checkout@v2
- name: Configure CMake
run: cmake -S. -Bbuild -G Ninja -DCMAKE_TOOLCHAIN_FILE=/home/riscos/env/toolchain-riscos.cmake -DRISCOS=ON -DSDL_GCC_ATOMICS=OFF -DCMAKE_BUILD_TYPE=Release
- name: Build
run: cmake --build build

View File

@ -0,0 +1,23 @@
name: Build (Sony Playstation Vita)
on: [push, pull_request]
defaults:
run:
shell: sh
jobs:
vita:
runs-on: ubuntu-latest
container:
image: vitasdk/vitasdk:latest
steps:
- uses: actions/checkout@v2
- name: Install CMake and GNU Make
run: |
apk update
apk add cmake make
- name: Configure CMake
run: cmake -S. -Bbuild -DCMAKE_TOOLCHAIN_FILE=${VITASDK}/share/vita.toolchain.cmake -DCMAKE_BUILD_TYPE=Release
- name: Build
run: cmake --build build

178
code/3rd_party/sdl-2.0.20/.gitignore vendored Normal file
View File

@ -0,0 +1,178 @@
aclocal.m4
autom4te*
config.cache
config.log
config.status
libtool
Makefile
Makefile.rules
sdl2-config
sdl2-config.cmake
sdl2-config-version.cmake
sdl2.pc
SDL2.spec
build
gen
Build
buildbot
*.so
*.so.*
*.dll
*.exe
*.o
*.obj
*.lib
*.a
*.la
*.dSYM
*,e1f
*,ff8
*.lnk
*.err
*.exp
*.map
*.orig
*~
*.swp
*.tmp
*.rej
# for CMake
CMakeFiles/
CMakeCache.txt
cmake_install.cmake
cmake_uninstall.cmake
SDL2ConfigVersion.cmake
.ninja_*
*.ninja
# for CLion
.idea
cmake-build-*
# for Xcode
*.mode1*
*.perspective*
*.pbxuser
(^|/)build($|/)
.DS_Store
xcuserdata
*.xcworkspace
# for Visual C++
.vs
Debug
Release
*.user
*.ncb
*.suo
*.sdf
VisualC/tests/controllermap/axis.bmp
VisualC/tests/controllermap/button.bmp
VisualC/tests/controllermap/controllermap.bmp
VisualC/tests/controllermap/controllermap_back.bmp
VisualC/tests/loopwave/sample.wav
VisualC/tests/testautomation/CompareSurfaces0001_Reference.bmp
VisualC/tests/testautomation/CompareSurfaces0001_TestOutput.bmp
VisualC/tests/testgamecontroller/axis.bmp
VisualC/tests/testgamecontroller/button.bmp
VisualC/tests/testgamecontroller/controllermap.bmp
VisualC/tests/testgamecontroller/controllermap_back.bmp
VisualC/tests/testoverlay2/moose.dat
VisualC/tests/testrendertarget/icon.bmp
VisualC/tests/testrendertarget/sample.bmp
VisualC/tests/testscale/icon.bmp
VisualC/tests/testscale/sample.bmp
VisualC/tests/testsprite2/icon.bmp
VisualC/tests/testyuv/testyuv.bmp
VisualC/visualtest/icon.bmp
VisualC/visualtest/testquit.actions
VisualC/visualtest/testquit.config
VisualC/visualtest/testquit.exe
VisualC/visualtest/testquit.parameters
VisualC/visualtest/testsprite2.exe
VisualC/visualtest/testsprite2_sample.actions
VisualC/visualtest/testsprite2_sample.config
VisualC/visualtest/testsprite2_sample.parameters
# for Android
android-project/local.properties
test/checkkeys
test/checkkeysthreads
test/controllermap
test/loopwave
test/loopwavequeue
test/testatomic
test/testaudiocapture
test/testaudiohotplug
test/testaudioinfo
test/testautomation
test/testbounds
test/testcustomcursor
test/testdisplayinfo
test/testdraw2
test/testdrawchessboard
test/testdropfile
test/testerror
test/testevdev
test/testfile
test/testfilesystem
test/testgamecontroller
test/testgeometry
test/testgesture
test/testgl2
test/testgles
test/testgles2
test/testhaptic
test/testhittesting
test/testhotplug
test/testiconv
test/testime
test/testintersections
test/testjoystick
test/testkeys
test/testloadso
test/testlocale
test/testlock
test/testmessage
test/testmouse
test/testmultiaudio
test/testnative
test/testoverlay2
test/testplatform
test/testpower
test/testqsort
test/testrelative
test/testrendercopyex
test/testrendertarget
test/testresample
test/testrumble
test/testscale
test/testsem
test/testsensor
test/testshader
test/testshape
test/testsprite2
test/testspriteminimal
test/teststreaming
test/testsurround
test/testthread
test/testtimer
test/testurl
test/testver
test/testviewport
test/testvulkan
test/testwm2
test/testyuv
test/torturethread
builddir/
debian/*.debhelper.log
debian/*.substvars
debian/*.tar.gz
debian/.debhelper/
debian/files
debian/libsdl*/
debian/tmp/

123
code/3rd_party/sdl-2.0.20/Android.mk vendored Normal file
View File

@ -0,0 +1,123 @@
LOCAL_PATH := $(call my-dir)
###########################
#
# SDL shared library
#
###########################
include $(CLEAR_VARS)
LOCAL_MODULE := SDL2
LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_C_INCLUDES)
LOCAL_SRC_FILES := \
$(subst $(LOCAL_PATH)/,, \
$(wildcard $(LOCAL_PATH)/src/*.c) \
$(wildcard $(LOCAL_PATH)/src/audio/*.c) \
$(wildcard $(LOCAL_PATH)/src/audio/android/*.c) \
$(wildcard $(LOCAL_PATH)/src/audio/dummy/*.c) \
$(wildcard $(LOCAL_PATH)/src/audio/aaudio/*.c) \
$(wildcard $(LOCAL_PATH)/src/audio/openslES/*.c) \
$(LOCAL_PATH)/src/atomic/SDL_atomic.c.arm \
$(LOCAL_PATH)/src/atomic/SDL_spinlock.c.arm \
$(wildcard $(LOCAL_PATH)/src/core/android/*.c) \
$(wildcard $(LOCAL_PATH)/src/cpuinfo/*.c) \
$(wildcard $(LOCAL_PATH)/src/dynapi/*.c) \
$(wildcard $(LOCAL_PATH)/src/events/*.c) \
$(wildcard $(LOCAL_PATH)/src/file/*.c) \
$(wildcard $(LOCAL_PATH)/src/haptic/*.c) \
$(wildcard $(LOCAL_PATH)/src/haptic/android/*.c) \
$(wildcard $(LOCAL_PATH)/src/hidapi/*.c) \
$(wildcard $(LOCAL_PATH)/src/hidapi/android/*.cpp) \
$(wildcard $(LOCAL_PATH)/src/joystick/*.c) \
$(wildcard $(LOCAL_PATH)/src/joystick/android/*.c) \
$(wildcard $(LOCAL_PATH)/src/joystick/hidapi/*.c) \
$(wildcard $(LOCAL_PATH)/src/joystick/virtual/*.c) \
$(wildcard $(LOCAL_PATH)/src/loadso/dlopen/*.c) \
$(wildcard $(LOCAL_PATH)/src/locale/*.c) \
$(wildcard $(LOCAL_PATH)/src/locale/android/*.c) \
$(wildcard $(LOCAL_PATH)/src/misc/*.c) \
$(wildcard $(LOCAL_PATH)/src/misc/android/*.c) \
$(wildcard $(LOCAL_PATH)/src/power/*.c) \
$(wildcard $(LOCAL_PATH)/src/power/android/*.c) \
$(wildcard $(LOCAL_PATH)/src/filesystem/android/*.c) \
$(wildcard $(LOCAL_PATH)/src/sensor/*.c) \
$(wildcard $(LOCAL_PATH)/src/sensor/android/*.c) \
$(wildcard $(LOCAL_PATH)/src/render/*.c) \
$(wildcard $(LOCAL_PATH)/src/render/*/*.c) \
$(wildcard $(LOCAL_PATH)/src/stdlib/*.c) \
$(wildcard $(LOCAL_PATH)/src/thread/*.c) \
$(wildcard $(LOCAL_PATH)/src/thread/pthread/*.c) \
$(wildcard $(LOCAL_PATH)/src/timer/*.c) \
$(wildcard $(LOCAL_PATH)/src/timer/unix/*.c) \
$(wildcard $(LOCAL_PATH)/src/video/*.c) \
$(wildcard $(LOCAL_PATH)/src/video/android/*.c) \
$(wildcard $(LOCAL_PATH)/src/video/yuv2rgb/*.c) \
$(wildcard $(LOCAL_PATH)/src/test/*.c))
LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES
LOCAL_CFLAGS += \
-Wall -Wextra \
-Wdocumentation \
-Wdocumentation-unknown-command \
-Wmissing-prototypes \
-Wunreachable-code-break \
-Wunneeded-internal-declaration \
-Wmissing-variable-declarations \
-Wfloat-conversion \
-Wshorten-64-to-32 \
-Wunreachable-code-return \
-Wshift-sign-overflow \
-Wstrict-prototypes \
-Wkeyword-macro \
# Warnings we haven't fixed (yet)
LOCAL_CFLAGS += -Wno-unused-parameter -Wno-sign-compare
LOCAL_LDLIBS := -ldl -lGLESv1_CM -lGLESv2 -lOpenSLES -llog -landroid
ifeq ($(NDK_DEBUG),1)
cmd-strip :=
endif
LOCAL_STATIC_LIBRARIES := cpufeatures
include $(BUILD_SHARED_LIBRARY)
###########################
#
# SDL static library
#
###########################
LOCAL_MODULE := SDL2_static
LOCAL_MODULE_FILENAME := libSDL2
LOCAL_LDLIBS :=
LOCAL_EXPORT_LDLIBS := -ldl -lGLESv1_CM -lGLESv2 -llog -landroid
include $(BUILD_STATIC_LIBRARY)
###########################
#
# SDL main static library
#
###########################
include $(CLEAR_VARS)
LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
LOCAL_MODULE := SDL2_main
LOCAL_MODULE_FILENAME := libSDL2main
include $(BUILD_STATIC_LIBRARY)
$(call import-module,android/cpufeatures)

16
code/3rd_party/sdl-2.0.20/BUGS.txt vendored Normal file
View File

@ -0,0 +1,16 @@
Bugs are now managed in the SDL issue tracker, here:
https://github.com/libsdl-org/SDL/issues
You may report bugs there, and search to see if a given issue has already
been reported, discussed, and maybe even fixed.
You may also find help at the SDL forums/mailing list:
https://discourse.libsdl.org/
Bug reports are welcome here, but we really appreciate if you use the issue
tracker, as bugs discussed on the mailing list may be forgotten or missed.

2970
code/3rd_party/sdl-2.0.20/CMakeLists.txt vendored Normal file

File diff suppressed because it is too large Load Diff

53
code/3rd_party/sdl-2.0.20/CREDITS.txt vendored Normal file
View File

@ -0,0 +1,53 @@
Simple DirectMedia Layer CREDITS
Thanks to everyone who made this possible, including:
* Cliff Matthews, for giving me a reason to start this project. :)
-- Executor rocks! *grin*
* Ryan Gordon for helping everybody out and keeping the dream alive. :)
* Gabriel Jacobo for his work on the Android port and generally helping out all around.
* Philipp Wiesemann for his attention to detail reviewing the entire SDL code base and proposes patches.
* Andreas Schiffler for his dedication to unit tests, Visual Studio projects, and managing the Google Summer of Code.
* Mike Sartain for incorporating SDL into Team Fortress 2 and cheering me on at Valve.
* Alfred Reynolds for the game controller API and general (in)sanity
* Jørgen Tjernø for numerous magical Mac OS X fixes.
* Pierre-Loup Griffais for his deep knowledge of OpenGL drivers.
* Julian Winter for the SDL 2.0 website.
* Sheena Smith for many months of great work on the SDL wiki creating the API documentation and style guides.
* Paul Hunkin for his port of SDL to Android during the Google Summer of Code 2010.
* Eli Gottlieb for his work on shaped windows during the Google Summer of Code 2010.
* Jim Grandpre for his work on multi-touch and gesture recognition during
the Google Summer of Code 2010.
* Edgar "bobbens" Simo for his force feedback API development during the
Google Summer of Code 2008.
* Aaron Wishnick for his work on audio resampling and pitch shifting during
the Google Summer of Code 2008.
* Holmes Futrell for his port of SDL to the iPhone and iPod Touch during the
Google Summer of Code 2008.
* Jon Atkins for SDL_image, SDL_mixer and SDL_net documentation.
* Everybody at Loki Software, Inc. for their great contributions!
And a big hand to everyone else who has contributed over the years.
THANKS! :)
-- Sam Lantinga <slouken@libsdl.org>

41
code/3rd_party/sdl-2.0.20/INSTALL.txt vendored Normal file
View File

@ -0,0 +1,41 @@
To compile and install SDL:
1. Windows with Visual Studio:
* Read ./docs/README-visualc.md
Windows with gcc, either native or cross-compiling:
* Read the FAQ at https://wiki.libsdl.org/FAQWindows
* Run './configure; make; make install'
Mac OS X with Xcode:
* Read docs/README-macosx.md
Mac OS X from the command line:
* Run './configure; make; make install'
Linux and other UNIX systems:
* Run './configure; make; make install'
Android:
* Read docs/README-android.md
iOS:
* Read docs/README-ios.md
Using Cmake:
* Read docs/README-cmake.md
2. Look at the example programs in ./test, and check out the online
documentation at https://wiki.libsdl.org/
3. Join the SDL developer discussions, sign up on
https://discourse.libsdl.org/
and go to the development forum
https://discourse.libsdl.org/c/sdl-development/6
4. Sign up for the announcement list through the web interface:
https://www.libsdl.org/mailing-list.php
That's it!
Sam Lantinga <slouken@libsdl.org>

18
code/3rd_party/sdl-2.0.20/LICENSE.txt vendored Normal file
View File

@ -0,0 +1,18 @@
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.

258
code/3rd_party/sdl-2.0.20/Makefile.in vendored Normal file
View File

@ -0,0 +1,258 @@
# Makefile to build and install the SDL library
top_builddir = .
srcdir = @srcdir@
objects = build
gen = gen
prefix = @prefix@
exec_prefix =