1
0
Fork 0
engine-work
Austin Morlan 4 months ago
parent ead20d7930
commit 682d87540f
Signed by: austin
GPG Key ID: FD6B27654AF5E348
  1. 212
      CMakeLists.txt
  2. BIN
      assets/export/music/ambience.wav
  3. BIN
      assets/export/sfx/coin.wav
  4. BIN
      assets/export/sfx/enemy.wav
  5. BIN
      assets/export/sfx/eyeball.wav
  6. BIN
      assets/export/sfx/footstep_1.wav
  7. BIN
      assets/export/sfx/footstep_2.wav
  8. BIN
      assets/export/sfx/powerup.wav
  9. BIN
      assets/export/sfx/safe_zone.wav
  10. BIN
      assets/export/textures/coin.png
  11. BIN
      assets/export/textures/eyeball.png
  12. BIN
      assets/export/textures/maze.png
  13. BIN
      assets/export/textures/numeral.png
  14. BIN
      assets/export/textures/pedestal.png
  15. BIN
      assets/export/textures/skull.png
  16. BIN
      assets/export/textures/skybox.png
  17. BIN
      assets/export/textures/spirit.png
  18. BIN
      assets/processed/data.bin
  19. BIN
      assets/source/models/coin.blend
  20. BIN
      assets/source/models/eyeball.blend
  21. BIN
      assets/source/models/level.blend
  22. BIN
      assets/source/models/maze.blend
  23. BIN
      assets/source/models/numeral.blend
  24. BIN
      assets/source/models/pedestal.blend
  25. BIN
      assets/source/models/skull.blend
  26. BIN
      assets/source/models/spirit.blend
  27. 1
      assets/source/music/ambience/ambience.1bd
  28. BIN
      assets/source/music/ambience/ambience.aup3
  29. BIN
      assets/source/sfx/coin.aup3
  30. BIN
      assets/source/sfx/enemy.aup3
  31. BIN
      assets/source/sfx/eyeball.aup3
  32. BIN
      assets/source/sfx/footstep.aup3
  33. BIN
      assets/source/sfx/powerup.aup3
  34. BIN
      assets/source/sfx/safe_zone.aup3
  35. BIN
      assets/source/textures/coin.xcf
  36. BIN
      assets/source/textures/eyeball.xcf
  37. BIN
      assets/source/textures/maze.xcf
  38. BIN
      assets/source/textures/numeral.xcf
  39. BIN
      assets/source/textures/pedestal.xcf
  40. BIN
      assets/source/textures/skull.xcf
  41. BIN
      assets/source/textures/skybox.xcf
  42. BIN
      assets/source/textures/spirit.xcf
  43. 8
      code/3rd_party/glad/CMakeLists.txt
  44. 311
      code/3rd_party/glad/include/KHR/khrplatform.h
  45. 2350
      code/3rd_party/glad/include/glad/gl.h
  46. 1059
      code/3rd_party/glad/src/gl.c
  47. 7
      code/3rd_party/sdl-2.0.20/.github/PULL_REQUEST_TEMPLATE.md
  48. 14
      code/3rd_party/sdl-2.0.20/.github/workflows/android.yml
  49. 16
      code/3rd_party/sdl-2.0.20/.github/workflows/emscripten.yml
  50. 20
      code/3rd_party/sdl-2.0.20/.github/workflows/ios.yml
  51. 88
      code/3rd_party/sdl-2.0.20/.github/workflows/main.yml
  52. 26
      code/3rd_party/sdl-2.0.20/.github/workflows/os2.yml
  53. 18
      code/3rd_party/sdl-2.0.20/.github/workflows/psp.yaml
  54. 28
      code/3rd_party/sdl-2.0.20/.github/workflows/riscos.yml
  55. 23
      code/3rd_party/sdl-2.0.20/.github/workflows/vita.yaml
  56. 178
      code/3rd_party/sdl-2.0.20/.gitignore
  57. 123
      code/3rd_party/sdl-2.0.20/Android.mk
  58. 16
      code/3rd_party/sdl-2.0.20/BUGS.txt
  59. 2970
      code/3rd_party/sdl-2.0.20/CMakeLists.txt
  60. 53
      code/3rd_party/sdl-2.0.20/CREDITS.txt
  61. 41
      code/3rd_party/sdl-2.0.20/INSTALL.txt
  62. 18
      code/3rd_party/sdl-2.0.20/LICENSE.txt
  63. 258
      code/3rd_party/sdl-2.0.20/Makefile.in
  64. 61
      code/3rd_party/sdl-2.0.20/Makefile.minimal
  65. 282
      code/3rd_party/sdl-2.0.20/Makefile.os2
  66. 64
      code/3rd_party/sdl-2.0.20/Makefile.pandora
  67. 117
      code/3rd_party/sdl-2.0.20/Makefile.psp
  68. 88
      code/3rd_party/sdl-2.0.20/Makefile.wiz
  69. 13
      code/3rd_party/sdl-2.0.20/README-SDL.txt
  70. 17
      code/3rd_party/sdl-2.0.20/README.md
  71. 119
      code/3rd_party/sdl-2.0.20/SDL2.spec.in
  72. 119
      code/3rd_party/sdl-2.0.20/SDL2Config.cmake
  73. 10
      code/3rd_party/sdl-2.0.20/TODO.txt
  74. 34
      code/3rd_party/sdl-2.0.20/VisualC-WinRT/SDL-UWP.sln
  75. 598
      code/3rd_party/sdl-2.0.20/VisualC-WinRT/SDL-UWP.vcxproj
  76. 822
      code/3rd_party/sdl-2.0.20/VisualC-WinRT/SDL-UWP.vcxproj.filters
  77. 327
      code/3rd_party/sdl-2.0.20/VisualC/SDL.sln
  78. 614
      code/3rd_party/sdl-2.0.20/VisualC/SDL/SDL.vcxproj
  79. 1323
      code/3rd_party/sdl-2.0.20/VisualC/SDL/SDL.vcxproj.filters
  80. 161
      code/3rd_party/sdl-2.0.20/VisualC/SDLmain/SDLmain.vcxproj
  81. 176
      code/3rd_party/sdl-2.0.20/VisualC/SDLtest/SDLtest.vcxproj
  82. 4
      code/3rd_party/sdl-2.0.20/VisualC/clean.sh
  83. 219
      code/3rd_party/sdl-2.0.20/VisualC/tests/checkkeys/checkkeys.vcxproj
  84. 278
      code/3rd_party/sdl-2.0.20/VisualC/tests/controllermap/controllermap.vcxproj
  85. 230
      code/3rd_party/sdl-2.0.20/VisualC/tests/loopwave/loopwave.vcxproj
  86. 204
      code/3rd_party/sdl-2.0.20/VisualC/tests/testatomic/testatomic.vcxproj
  87. 231
      code/3rd_party/sdl-2.0.20/VisualC/tests/testautomation/testautomation.vcxproj
  88. 210
      code/3rd_party/sdl-2.0.20/VisualC/tests/testdraw2/testdraw2.vcxproj
  89. 204
      code/3rd_party/sdl-2.0.20/VisualC/tests/testfile/testfile.vcxproj
  90. 278
      code/3rd_party/sdl-2.0.20/VisualC/tests/testgamecontroller/testgamecontroller.vcxproj
  91. 210
      code/3rd_party/sdl-2.0.20/VisualC/tests/testgesture/testgesture.vcxproj
  92. 214
      code/3rd_party/sdl-2.0.20/VisualC/tests/testgl2/testgl2.vcxproj
  93. 210
      code/3rd_party/sdl-2.0.20/VisualC/tests/testgles2/testgles2.vcxproj
  94. 204
      code/3rd_party/sdl-2.0.20/VisualC/tests/testjoystick/testjoystick.vcxproj
  95. 225
      code/3rd_party/sdl-2.0.20/VisualC/tests/testoverlay2/testoverlay2.vcxproj
  96. 232
      code/3rd_party/sdl-2.0.20/VisualC/tests/testplatform/testplatform.vcxproj
  97. 204
      code/3rd_party/sdl-2.0.20/VisualC/tests/testpower/testpower.vcxproj
  98. 248
      code/3rd_party/sdl-2.0.20/VisualC/tests/testrendertarget/testrendertarget.vcxproj
  99. 204
      code/3rd_party/sdl-2.0.20/VisualC/tests/testrumble/testrumble.vcxproj
  100. 248
      code/3rd_party/sdl-2.0.20/VisualC/tests/testscale/testscale.vcxproj
  101. Some files were not shown because too many files have changed in this diff Show More

@ -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.

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.

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

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.

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.

@ -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)

@ -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_ */

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -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. -->

@ -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

@ -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/

@ -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

@ -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/

@ -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

@ -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

@ -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

@ -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

@ -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/

@ -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)

@ -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.

File diff suppressed because it is too large Load Diff

@ -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>

@ -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