Compare commits
198 Commits
b4c0efa748
..
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 3a8adac185 | |||
| 3f9f154939 | |||
| ecd6571785 | |||
| ff82f59fdf | |||
| 963ccc4ec8 | |||
| 4c158f25f0 | |||
| 6a984b40d9 | |||
| 74d55cb087 | |||
| 8f277c4d08 | |||
| 3366008d59 | |||
| e49683eb7b | |||
| d04e231f4d | |||
| 198ed44bbf | |||
| 7fe5419b02 | |||
| 6aa530daea | |||
| 4f4ec3cfd5 | |||
| e5cc22cb95 | |||
| b9eb121663 | |||
| f72ca9def5 | |||
| 70fac5bd72 | |||
| ab79875263 | |||
| 3a012fc564 | |||
| bd727a6505 | |||
| da801d1937 | |||
| 1b03990f92 | |||
| d2b472548f | |||
| 0c7ec7299e | |||
| f564c14354 | |||
| 08b8b397e2 | |||
| e6fa28a18f | |||
| 1ff65cd811 | |||
| f3dcd26ce7 | |||
| 18c1b3639c | |||
| e7ad1d36ba | |||
| aaa5b2078b | |||
| f8f82bc653 | |||
| 8bc6f68b3b | |||
| fa9190b0e5 | |||
| 7cb6dbc3e6 | |||
| 59cb6fb6c1 | |||
| 3d85440aac | |||
| 2adf75973a | |||
| 7fa5294e02 | |||
| 91a4a2079b | |||
| 2af0361ac5 | |||
| 7e1894984c | |||
| 53a7ed7890 | |||
| 6305d0b096 | |||
| ae9571d270 | |||
| ba39a0e5eb | |||
| 4ec664c8db | |||
| 07af9deb6a | |||
| 6dc54f9ef6 | |||
| 6ac2b1fde0 | |||
| 85d1832a0c | |||
| b549728a24 | |||
| 9dd37f6d40 | |||
| 8a5caf5c0d | |||
| 05b19704f8 | |||
| 1daf4d79f1 | |||
| 3b7d593f4e | |||
| 538849e607 | |||
| d4c3f59921 | |||
| 617a4fbfb6 | |||
| 5a1ea421f6 | |||
| 0d3bfaf12d | |||
| 5a77a4aacb | |||
| c3c0f8adf7 | |||
| a5c0db824b | |||
| 434abdc9a7 | |||
| dcd40b6394 | |||
| 8633cff3cb | |||
| ec34b2df61 | |||
| 883e13cdf5 | |||
| ad651462df | |||
| 6283160467 | |||
| c806c1a67d | |||
| 6efb964399 | |||
| 932d5f629d | |||
| 14728d17f5 | |||
| 90d167857e | |||
| 3630965ff5 | |||
| 9763955288 | |||
| d32b99e814 | |||
| 41048fc43e | |||
| 3bf7cf7a17 | |||
| 832c23f85c | |||
| 716f5fc11c | |||
| 36d69e7fa0 | |||
| 59f61591e1 | |||
| ebffc3f32d | |||
| d3be9552c9 | |||
| e5d90533dd | |||
| e19a13c354 | |||
| 9480d4e2a7 | |||
| e129469b08 | |||
| db55a510a6 | |||
| 382ef67895 | |||
| 914cbf13f4 | |||
| 06ddce6f81 | |||
| 31c4bde4bf | |||
| 1db5440767 | |||
| 9810331253 | |||
| 6f9108d563 | |||
| f7915b63c7 | |||
| 0575989142 | |||
| bec0f06e59 | |||
| d71daba073 | |||
| b48b5f0339 | |||
| 3f380adb0a | |||
| ea47ade7b3 | |||
| a7635a0abf | |||
| 2292c049b7 | |||
| 5aba854534 | |||
| f33ce18429 | |||
| e774305829 | |||
| 4c84899084 | |||
| ea31729a74 | |||
| 002bbcd097 | |||
| dc7c424d7f | |||
| fe1561d8c8 | |||
| d9bf936f0d | |||
| 19e75d3807 | |||
| d5b01e9f40 | |||
| 3a2b156951 | |||
| e87a66b984 | |||
| 944c00b89e | |||
| 5ac98b6203 | |||
| fc88859eaf | |||
| cdf6cf00a8 | |||
| 5b6d83ed90 | |||
| 6a7f54ca5a | |||
| 09b1f3943a | |||
| 8d7a4e9a4a | |||
| fd11d177c1 | |||
| e2a4eec761 | |||
| 65d79b8985 | |||
| 98844b6094 | |||
| 31823101a5 | |||
| 45ca42df99 | |||
| 1220cf6e7a | |||
| f1ffbbcfda | |||
| ad37f333ae | |||
| 93708f37b8 | |||
| 4b3ca3e673 | |||
| 755befb89d | |||
| ce90ecdaea | |||
| 592e1f39f3 | |||
| b9a52da265 | |||
| 57f6926d6f | |||
| 0043563f7d | |||
| 2ad30458bf | |||
| e77086601b | |||
| 5016f906ea | |||
| 88da989ad7 | |||
| d80ffe7c79 | |||
| ebddc0dfe2 | |||
| 0d875d23ae | |||
| 611c1afcb6 | |||
| 1b75448163 | |||
| 7b9db0b16b | |||
| 3c02064f2b | |||
| 08e3dfd9d3 | |||
| 1c8a65e8ad | |||
| 2d583d8f72 | |||
| 095f94b098 | |||
| a872bede2c | |||
| 526316a928 | |||
| 5b29a2bd5b | |||
| 920f93ea7a | |||
| 97ff0726c9 | |||
| 2d5b36bbef | |||
| a3ca31948b | |||
| 59c55ac092 | |||
| f4418d94d9 | |||
| b1e657abc3 | |||
| 3e32ebd62b | |||
| 2e2572a769 | |||
| f2b992a39d | |||
| a6a6761e9f | |||
| c70a9a245b | |||
| 85d653db29 | |||
| 74e0d78a4c | |||
| e6a5a00dcb | |||
| 9a06173a7c | |||
| 61713bb10f | |||
| 5058054f3c | |||
| 5cf457561c | |||
| 61bef68b40 | |||
| 5ce2942e71 | |||
| c7a9c2f78f | |||
| efc6477180 | |||
| b603d997cf | |||
| 70a9074415 | |||
| 1f91eb9cf1 | |||
| ce923a77fb | |||
| 0f6bfcdc4b | |||
| d416f6d36e |
@@ -0,0 +1 @@
|
||||
assets/shader/*.dep
|
||||
@@ -0,0 +1,154 @@
|
||||
cmake_minimum_required(VERSION 3.25)
|
||||
|
||||
project(mikemon VERSION 0.1 LANGUAGES CXX C)
|
||||
set(CMAKE_C_STANDARD 23)
|
||||
set(CMAKE_C_EXTENSIONS OFF)
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
set(CMAKE_DISABLE_PRECOMPILE_HEADERS ON)
|
||||
|
||||
option(TRACY_ENABLE "Enable Tracy profiling" OFF)
|
||||
|
||||
# glm
|
||||
add_subdirectory(libs/glm)
|
||||
target_compile_definitions(glm PUBLIC GLM_FORCE_SWIZZLE GLM_FORCE_XYZW_ONLY)
|
||||
|
||||
# SDL
|
||||
set(SDL_SHARED OFF)
|
||||
set(SDL_STATIC ON)
|
||||
add_subdirectory(libs/SDL3)
|
||||
|
||||
# wgpu
|
||||
add_subdirectory(libs/wgpu)
|
||||
|
||||
# SDL3_mixer
|
||||
set(BUILD_SHARED_LIBS ${SDL_SHARED})
|
||||
set(SDLMIXER_DEPS_SHARED OFF)
|
||||
set(SDLMIXER_VENDORED ON)
|
||||
set(SDLMIXER_OPUS ON)
|
||||
set(SDLMIXER_VORBIS_VORBISFILE OFF)
|
||||
set(SDLMIXER_AIFF OFF)
|
||||
set(SDLMIXER_WAVE OFF)
|
||||
set(SDLMIXER_VOC OFF)
|
||||
set(SDLMIXER_AU OFF)
|
||||
set(SDLMIXER_FLAC OFF)
|
||||
set(SDLMIXER_GME OFF)
|
||||
set(SDLMIXER_MOD OFF)
|
||||
set(SDLMIXER_MP3 OFF)
|
||||
set(SDLMIXER_MIDI OFF)
|
||||
set(SDLMIXER_WAVPACK OFF)
|
||||
add_subdirectory(libs/SDL3_mixer)
|
||||
|
||||
# Dear ImGui
|
||||
add_library(imgui STATIC
|
||||
libs/imgui/imgui.cpp
|
||||
libs/imgui/imgui_draw.cpp
|
||||
libs/imgui/imgui_demo.cpp
|
||||
libs/imgui/imgui_tables.cpp
|
||||
libs/imgui/imgui_widgets.cpp
|
||||
libs/imgui/backends/imgui_impl_sdl3.cpp
|
||||
|
||||
libs/dcimgui/dcimgui.cpp
|
||||
libs/dcimgui/dcimgui_internal.cpp
|
||||
libs/dcimgui/backends/dcimgui_impl_sdl3.cpp
|
||||
)
|
||||
target_include_directories(imgui PUBLIC
|
||||
libs/imgui
|
||||
libs/dcimgui
|
||||
libs/imgui/backends
|
||||
)
|
||||
target_link_libraries(imgui PRIVATE SDL3::SDL3)
|
||||
|
||||
# Dear ImGui WGPU backend
|
||||
add_library(imgui_wgpu STATIC
|
||||
libs/imgui/backends/imgui_impl_wgpu.cpp
|
||||
libs/dcimgui/backends/dcimgui_impl_wgpu.cpp
|
||||
)
|
||||
target_include_directories(imgui_wgpu PUBLIC
|
||||
libs/imgui/backends
|
||||
libs/dcimgui/backends
|
||||
)
|
||||
target_link_libraries(imgui_wgpu PRIVATE imgui wgpu)
|
||||
target_compile_definitions(imgui_wgpu PRIVATE IMGUI_IMPL_WEBGPU_BACKEND_WGPU=1)
|
||||
|
||||
# Dear ImGui SDLGPU backend
|
||||
add_library(imgui_sdlgpu STATIC
|
||||
libs/imgui/backends/imgui_impl_sdlgpu3.cpp
|
||||
libs/dcimgui/backends/dcimgui_impl_sdlgpu3.cpp
|
||||
)
|
||||
target_include_directories(imgui_sdlgpu PUBLIC
|
||||
libs/imgui/backends
|
||||
libs/dcimgui/backends
|
||||
)
|
||||
target_link_libraries(imgui_sdlgpu PRIVATE imgui SDL3::SDL3)
|
||||
|
||||
# stb_image
|
||||
add_library(stb_image STATIC libs/stb/stb_image.c)
|
||||
target_include_directories(stb_image INTERFACE libs/stb)
|
||||
|
||||
# tracy
|
||||
option(TRACY_ONLY_LOCALHOST "" ON)
|
||||
add_subdirectory(libs/tracy)
|
||||
|
||||
# shaders
|
||||
find_program(SLANGC_EXECUTABLE slangc)
|
||||
set(SHADERS_SPV "")
|
||||
set(SHADERS_WGSL "")
|
||||
|
||||
function(add_shader name)
|
||||
if(SLANGC_EXECUTABLE)
|
||||
add_custom_command(OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/src/shaders/spirv/${name}.spv" DEPFILE "${CMAKE_CURRENT_BINARY_DIR}/${name}-spv.dep" COMMAND "${SLANGC_EXECUTABLE}" -depfile "${CMAKE_CURRENT_BINARY_DIR}/${name}-spv.dep" "${CMAKE_CURRENT_SOURCE_DIR}/src/shaders/src/${name}.slang" -o "${CMAKE_CURRENT_SOURCE_DIR}/src/shaders/spirv/${name}.spv" -target spirv -profile spirv_1_0)
|
||||
add_custom_command(OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/src/shaders/wgsl/${name}.wgsl" DEPFILE "${CMAKE_CURRENT_BINARY_DIR}/${name}-wgsl.dep" COMMAND "${SLANGC_EXECUTABLE}" -depfile "${CMAKE_CURRENT_BINARY_DIR}/${name}-wgsl.dep" "${CMAKE_CURRENT_SOURCE_DIR}/src/shaders/src/${name}.slang" -o "${CMAKE_CURRENT_SOURCE_DIR}/src/shaders/wgsl/${name}.wgsl" -target wgsl -D__wgsl__)
|
||||
endif()
|
||||
|
||||
set(SHADERS_SPV ${SHADERS_SPV} "${CMAKE_CURRENT_SOURCE_DIR}/src/shaders/spirv/${name}.spv" PARENT_SCOPE)
|
||||
set(SHADERS_WGSL ${SHADERS_WGSL} "${CMAKE_CURRENT_SOURCE_DIR}/src/shaders/wgsl/${name}.wgsl" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
add_shader(character)
|
||||
add_shader(character_shadow)
|
||||
add_shader(world)
|
||||
add_shader(placeable)
|
||||
add_shader(grid)
|
||||
|
||||
add_custom_target(shaders-spv DEPENDS ${SHADERS_SPV})
|
||||
add_custom_target(shaders-wgsl DEPENDS ${SHADERS_WGSL})
|
||||
|
||||
# game
|
||||
add_executable(mikemon
|
||||
src/smol-atlas.cpp
|
||||
src/change_directory.c
|
||||
src/renderer_wgpu.c
|
||||
src/main.cpp
|
||||
)
|
||||
target_link_libraries(mikemon
|
||||
PRIVATE
|
||||
glm
|
||||
SDL3::SDL3
|
||||
SDL3_mixer::SDL3_mixer
|
||||
stb_image
|
||||
imgui
|
||||
imgui_wgpu
|
||||
TracyClient
|
||||
wgpu
|
||||
)
|
||||
add_dependencies(mikemon shaders-wgsl)
|
||||
|
||||
add_executable(mikemon-sdlgpu
|
||||
src/smol-atlas.cpp
|
||||
src/change_directory.c
|
||||
src/renderer_sdlgpu.c
|
||||
src/main.cpp
|
||||
)
|
||||
target_link_libraries(mikemon-sdlgpu
|
||||
PRIVATE
|
||||
glm
|
||||
SDL3::SDL3
|
||||
SDL3_mixer::SDL3_mixer
|
||||
stb_image
|
||||
imgui
|
||||
imgui_sdlgpu
|
||||
TracyClient
|
||||
wgpu
|
||||
)
|
||||
add_dependencies(mikemon-sdlgpu shaders-spv)
|
||||
@@ -0,0 +1,12 @@
|
||||
# Mikemon
|
||||
|
||||
A not-so-little monster RPG inspired by the biggest of its kind in the late 2000s and early 2010s.
|
||||
|
||||
## CMAKE
|
||||
|
||||
```
|
||||
cmake -G Ninja -B build
|
||||
cmake --build build --parallel
|
||||
```
|
||||
|
||||
|
||||
|
After Width: | Height: | Size: 7.8 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 448 B |
|
After Width: | Height: | Size: 689 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 5.3 KiB |
|
After Width: | Height: | Size: 239 B |
|
After Width: | Height: | Size: 2.5 KiB |
|
After Width: | Height: | Size: 2.5 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 373 B |
|
After Width: | Height: | Size: 583 B |
|
After Width: | Height: | Size: 601 B |
|
After Width: | Height: | Size: 528 B |
|
After Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 768 KiB |
@@ -0,0 +1,16 @@
|
||||
#ifndef WORLDS_H
|
||||
#define WORLDS_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif // __cplusplus
|
||||
|
||||
static const char *world_names[] = {
|
||||
"map",
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif // __cplusplus
|
||||
|
||||
#endif // WORLDS_H
|
||||
|
After Width: | Height: | Size: 44 KiB |
|
After Width: | Height: | Size: 27 KiB |
|
After Width: | Height: | Size: 44 KiB |
|
After Width: | Height: | Size: 27 KiB |
@@ -0,0 +1,4 @@
|
||||
Marker file version: 1
|
||||
Time format: Samples
|
||||
loop_start 2580480
|
||||
loop_end 4976640
|
||||
@@ -1,24 +0,0 @@
|
||||
struct PixelShaderInput {
|
||||
float4 pos : SV_POSITION;
|
||||
float4 uvst : COORDINATES;
|
||||
uint tile_type : TILE_TYPE;
|
||||
};
|
||||
|
||||
struct PixelShaderOutput {
|
||||
float4 color : SV_TARGET;
|
||||
};
|
||||
|
||||
Texture2DArray<float4> tex1 : register(t0);
|
||||
|
||||
SamplerState texture_sampler : register(s0);
|
||||
|
||||
PixelShaderOutput main(PixelShaderInput input) {
|
||||
PixelShaderOutput output;
|
||||
|
||||
#if 1
|
||||
output.color = tex1.Sample(texture_sampler, float3(input.uvst.xy, input.tile_type));
|
||||
#else
|
||||
output.color = float4(1, 0, 1, 1);
|
||||
#endif
|
||||
return output;
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
struct VertexShaderInput {
|
||||
// Per Vertex
|
||||
float4 pos : VERTEX_POSITION;
|
||||
float4 uvst : COORDINATES;
|
||||
uint vid : SV_VertexID;
|
||||
|
||||
// Per Instance
|
||||
float4 pos_size : INSTANCE_POSITION_SIZE;
|
||||
uint tile_type : TILE_TYPE;
|
||||
};
|
||||
|
||||
struct VertexShaderOutput {
|
||||
float4 pos : SV_POSITION;
|
||||
float4 uvst : COORDINATES;
|
||||
uint tile_type : TILE_TYPE;
|
||||
};
|
||||
|
||||
|
||||
VertexShaderOutput main(VertexShaderInput input) {
|
||||
VertexShaderOutput output;
|
||||
|
||||
float2 rect_pos = input.pos_size.xy;
|
||||
float2 rect_size = input.pos_size.zw;
|
||||
|
||||
float3x3 coord_sys = {
|
||||
2, 0, -1,
|
||||
0, -2, 1,
|
||||
0, 0, 1
|
||||
};
|
||||
|
||||
input.pos_size.xy = mul(coord_sys, float3(input.pos_size.xy, 1)).xy;
|
||||
|
||||
float3x3 pos = {
|
||||
1, 0, input.pos_size.x,
|
||||
0, 1, input.pos_size.y,
|
||||
0, 0, 1
|
||||
};
|
||||
|
||||
float3x3 size = {
|
||||
rect_size.x, 0, 0,
|
||||
0, rect_size.y, 0,
|
||||
0, 0, 1
|
||||
};
|
||||
|
||||
output.pos.xy = mul(pos, mul(size, input.pos.xyz)).xy;
|
||||
//output.pos.xy = mul(pos, input.pos.xyz).xy;
|
||||
output.pos.zw = float2(0, 1);
|
||||
|
||||
output.uvst = input.uvst;
|
||||
output.tile_type = input.tile_type;
|
||||
|
||||
return output;
|
||||
}
|
||||
|
After Width: | Height: | Size: 206 B |
|
After Width: | Height: | Size: 114 B |
|
After Width: | Height: | Size: 191 B |
|
After Width: | Height: | Size: 465 B |
|
After Width: | Height: | Size: 484 B |
|
After Width: | Height: | Size: 337 B |
|
After Width: | Height: | Size: 411 B |
|
After Width: | Height: | Size: 490 B |
|
After Width: | Height: | Size: 523 B |
|
After Width: | Height: | Size: 522 B |
|
After Width: | Height: | Size: 133 B |
|
After Width: | Height: | Size: 195 B |
|
After Width: | Height: | Size: 265 B |
|
After Width: | Height: | Size: 323 B |
|
After Width: | Height: | Size: 156 B |
|
After Width: | Height: | Size: 113 B |
|
After Width: | Height: | Size: 354 B |
|
After Width: | Height: | Size: 420 B |
|
After Width: | Height: | Size: 422 B |
|
After Width: | Height: | Size: 441 B |
|
After Width: | Height: | Size: 439 B |
|
After Width: | Height: | Size: 428 B |
|
After Width: | Height: | Size: 382 B |
|
After Width: | Height: | Size: 361 B |
|
After Width: | Height: | Size: 561 B |
|
After Width: | Height: | Size: 487 B |
|
After Width: | Height: | Size: 505 B |
|
After Width: | Height: | Size: 570 B |
|
After Width: | Height: | Size: 433 B |
|
After Width: | Height: | Size: 533 B |
|
After Width: | Height: | Size: 260 B |
|
After Width: | Height: | Size: 111 B |
|
After Width: | Height: | Size: 397 B |
|
After Width: | Height: | Size: 465 B |
|
After Width: | Height: | Size: 467 B |
|
After Width: | Height: | Size: 300 B |
|
After Width: | Height: | Size: 346 B |
|
After Width: | Height: | Size: 7.5 KiB |
|
After Width: | Height: | Size: 31 KiB |
|
After Width: | Height: | Size: 67 KiB |
@@ -0,0 +1,91 @@
|
||||
---
|
||||
AlignConsecutiveMacros: Consecutive
|
||||
AlignConsecutiveAssignments: None
|
||||
AlignConsecutiveBitFields: None
|
||||
AlignConsecutiveDeclarations: None
|
||||
AlignEscapedNewlines: Right
|
||||
AlignOperands: Align
|
||||
AlignTrailingComments: true
|
||||
|
||||
AllowAllArgumentsOnNextLine: true
|
||||
AllowAllParametersOfDeclarationOnNextLine: true
|
||||
AllowShortEnumsOnASingleLine: true
|
||||
AllowShortBlocksOnASingleLine: Never
|
||||
AllowShortCaseLabelsOnASingleLine: false
|
||||
AllowShortFunctionsOnASingleLine: All
|
||||
AllowShortIfStatementsOnASingleLine: Never
|
||||
AllowShortLoopsOnASingleLine: false
|
||||
|
||||
AlwaysBreakAfterDefinitionReturnType: None
|
||||
AlwaysBreakAfterReturnType: None
|
||||
AlwaysBreakBeforeMultilineStrings: false
|
||||
AlwaysBreakTemplateDeclarations: MultiLine
|
||||
|
||||
# Custom brace breaking
|
||||
BreakBeforeBraces: Custom
|
||||
BraceWrapping:
|
||||
AfterCaseLabel: true
|
||||
AfterClass: true
|
||||
AfterControlStatement: Never
|
||||
AfterEnum: true
|
||||
AfterFunction: true
|
||||
AfterNamespace: true
|
||||
AfterObjCDeclaration: true
|
||||
AfterStruct: true
|
||||
AfterUnion: true
|
||||
AfterExternBlock: false
|
||||
BeforeElse: false
|
||||
BeforeWhile: false
|
||||
IndentBraces: false
|
||||
SplitEmptyFunction: true
|
||||
SplitEmptyRecord: true
|
||||
|
||||
# Make the closing brace of container literals go to a new line
|
||||
Cpp11BracedListStyle: false
|
||||
|
||||
# Never format includes
|
||||
IncludeBlocks: Preserve
|
||||
# clang-format version 4.0 through 12.0:
|
||||
#SortIncludes: false
|
||||
# clang-format version 13.0+:
|
||||
#SortIncludes: Never
|
||||
|
||||
# No length limit, in case it breaks macros, you can
|
||||
# disable it with /* clang-format off/on */ comments
|
||||
ColumnLimit: 0
|
||||
|
||||
IndentWidth: 4
|
||||
ContinuationIndentWidth: 4
|
||||
IndentCaseLabels: false
|
||||
IndentCaseBlocks: false
|
||||
IndentGotoLabels: true
|
||||
IndentPPDirectives: None
|
||||
IndentExternBlock: NoIndent
|
||||
|
||||
PointerAlignment: Right
|
||||
SpaceAfterCStyleCast: false
|
||||
SpacesInCStyleCastParentheses: false
|
||||
SpacesInConditionalStatement: false
|
||||
SpacesInContainerLiterals: true
|
||||
SpaceBeforeAssignmentOperators: true
|
||||
SpaceBeforeCaseColon: false
|
||||
SpaceBeforeParens: ControlStatements
|
||||
SpaceAroundPointerQualifiers: Default
|
||||
SpaceInEmptyBlock: false
|
||||
SpaceInEmptyParentheses: false
|
||||
|
||||
UseCRLF: false
|
||||
UseTab: Never
|
||||
|
||||
ForEachMacros:
|
||||
[
|
||||
"spa_list_for_each",
|
||||
"spa_list_for_each_safe",
|
||||
"wl_list_for_each",
|
||||
"wl_list_for_each_safe",
|
||||
"wl_array_for_each",
|
||||
"udev_list_entry_foreach",
|
||||
]
|
||||
|
||||
---
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
---
|
||||
Checks: >
|
||||
-*,
|
||||
bugprone-assert-side-effect,
|
||||
bugprone-assignment-in-if-condition,
|
||||
bugprone-bool-pointer-implicit-conversion,
|
||||
bugprone-dangling-handle,
|
||||
bugprone-dynamic-static-initializers,
|
||||
bugprone-infinite-loop,
|
||||
bugprone-integer-division,
|
||||
bugprone-macro-repeated-side-effects,
|
||||
bugprone-misplaced-operator-in-strlen-in-alloc,
|
||||
bugprone-misplaced-pointer-arithmetic-in-alloc,
|
||||
bugprone-misplaced-widening-cast,
|
||||
bugprone-not-null-terminated-result,
|
||||
bugprone-posix-return,
|
||||
bugprone-redundant-branch-condition,
|
||||
bugprone-string-literal-with-embedded-nul,
|
||||
bugprone-suspicious-memset-usage,
|
||||
bugprone-suspicious-semicolon,
|
||||
bugprone-suspicious-string-compare,
|
||||
bugprone-too-small-loop-variable,
|
||||
bugprone-unused-return-value,
|
||||
cert-err33-c,
|
||||
clang-analyzer-core.*,
|
||||
clang-analyzer-valist.*,
|
||||
clang-analyzer-unix.Malloc,
|
||||
clang-diagnostic-*,
|
||||
google-readability-casting,
|
||||
misc-misleading-bidirectional,
|
||||
misc-misleading-identifier,
|
||||
misc-misplaced-const,
|
||||
misc-redundant-expression,
|
||||
objc-*,
|
||||
performance-type-promotion-in-math-fn,
|
||||
readability-avoid-const-params-in-decls,
|
||||
readability-braces-around-statements,
|
||||
readability-const-return-type,
|
||||
readability-duplicate-include,
|
||||
readability-inconsistent-declaration-parameter-name,
|
||||
readability-misplaced-array-index,
|
||||
readability-non-const-parameter,
|
||||
readability-redundant-control-flow,
|
||||
readability-redundant-declaration,
|
||||
readability-redundant-function-ptr-dereference,
|
||||
readability-redundant-preprocessor,
|
||||
readability-simplify-boolean-expr
|
||||
|
||||
CheckOptions:
|
||||
- key: bugprone-assert-side-effect.AssertMacros
|
||||
value: "SDL_assert, SDL_assert_release, SDL_assert_paranoid, SDL_assert_always, SDL_COMPILE_TIME_ASSERT"
|
||||
- key: bugprone-misplaced-widening-cast.CheckImplicitCasts
|
||||
value: true
|
||||
- key: bugprone-not-null-terminated-result.WantToUseSafeFunctions
|
||||
value: false # Do not recommend _s functions
|
||||
|
||||
FormatStyle: "file"
|
||||
HeaderFilterRegex: "*.h$"
|
||||
WarningsAsErrors: ""
|
||||
@@ -0,0 +1,69 @@
|
||||
# For format see editorconfig.org
|
||||
# Copyright 2022 Collabora Ltd.
|
||||
# SPDX-License-Identifier: Zlib
|
||||
|
||||
root = true
|
||||
|
||||
[*.{c,cc,cg,cpp,gradle,h,java,m,metal,pl,py,S,sh,txt}]
|
||||
indent_size = 4
|
||||
indent_style = space
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[*.{html,js,json,m4,yml,yaml,vcxproj,vcxproj.filters}]
|
||||
indent_size = 2
|
||||
indent_style = space
|
||||
trim_tailing_whitespace = true
|
||||
|
||||
[*.xml]
|
||||
indent_size = 4
|
||||
indent_style = space
|
||||
|
||||
[{CMakeLists.txt,cmake/*.cmake}]
|
||||
indent_size = 2
|
||||
indent_style = space
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[{cmake/cmake_uninstall.cmake.in,test/CMakeLists.txt,cmake/SDL3Config.cmake.in}]
|
||||
indent_size = 4
|
||||
indent_style = space
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[{Makefile.*,*.mk,*.sln,*.pbxproj,*.plist}]
|
||||
indent_size = 8
|
||||
indent_style = tab
|
||||
tab_width = 8
|
||||
|
||||
[src/joystick/controller_type.*]
|
||||
indent_style = tab
|
||||
|
||||
[src/joystick/hidapi/steam/*.h]
|
||||
indent_style = tab
|
||||
|
||||
[src/libm/*.c]
|
||||
indent_style = tab
|
||||
|
||||
[src/test/SDL_test_{crc32,md5,random}.c]
|
||||
indent_size = 2
|
||||
indent_style = space
|
||||
|
||||
[src/video/yuv2rgb/*.{c,h}]
|
||||
indent_style = tab
|
||||
|
||||
[wayland-protocols/*.xml]
|
||||
indent_size = 2
|
||||
indent_style = space
|
||||
|
||||
[*.{markdown,md}]
|
||||
indent_size = 4
|
||||
indent_style = space
|
||||
# Markdown syntax treats tabs as 4 spaces
|
||||
tab_width = 4
|
||||
|
||||
[{*.bat,*.rc}]
|
||||
end_of_line = crlf
|
||||
|
||||
[*.cocci]
|
||||
insert_final_newline = true
|
||||
@@ -0,0 +1 @@
|
||||
683181b47cfabd293e3ea409f838915b8297a4fd
|
||||
@@ -0,0 +1,41 @@
|
||||
projectfullname = Simple Directmedia Layer
|
||||
projectshortname = SDL
|
||||
incsubdir = include/SDL3
|
||||
wikisubdir =
|
||||
readmesubdir = docs
|
||||
apiprefixregex = (SDL_|SDLK_|[US]int\d+)
|
||||
mainincludefname = SDL3/SDL.h
|
||||
versionfname = include/SDL3/SDL_version.h
|
||||
versionmajorregex = \A\#define\s+SDL_MAJOR_VERSION\s+(\d+)\Z
|
||||
versionminorregex = \A\#define\s+SDL_MINOR_VERSION\s+(\d+)\Z
|
||||
versionmicroregex = \A\#define\s+SDL_MICRO_VERSION\s+(\d+)\Z
|
||||
apipropertyregex = \A\s*\#\s*define\s+SDL_PROP_
|
||||
selectheaderregex = \ASDL.*?\.h\Z
|
||||
projecturl = https://libsdl.org/
|
||||
wikiurl = https://wiki.libsdl.org
|
||||
bugreporturl = https://github.com/libsdl-org/sdlwiki/issues/new
|
||||
warn_about_missing = 0
|
||||
#wikipreamble = (This is the documentation for SDL3, which is the current stable version. [SDL2](https://wiki.libsdl.org/SDL2/) was the previous version!)
|
||||
wikiheaderfiletext = Defined in [<SDL3/%fname%>](https://github.com/libsdl-org/SDL/blob/main/include/SDL3/%fname%)
|
||||
|
||||
manpageheaderfiletext = Defined in SDL3/%fname%
|
||||
manpagesymbolfilterregex = \A[US]int\d+\Z
|
||||
|
||||
# All SDL_test_* headers become undefined categories, everything else just converts like SDL_audio.h -> Audio
|
||||
# A handful of others we fix up in the header itself with /* WIKI CATEGORY: x */ comments.
|
||||
headercategoryeval = s/\ASDL_test_?.*?\.h\Z//; s/\ASDL_?(.*?)\.h\Z/$1/; ucfirst();
|
||||
|
||||
quickrefenabled = 1
|
||||
quickrefcategoryorder = Init,Hints,Error,Version,Properties,Log,Video,Events,Keyboard,Mouse,Touch,Gamepad,Joystick,Haptic,Audio,Time,Timer,Render,SharedObject,Thread,Mutex,Atomic,Filesystem,IOStream,AsyncIO,Storage,Pixels,Surface,Blendmode,Rect,Camera,Clipboard,Dialog,Tray,Messagebox,GPU,Vulkan,Metal,Platform,Power,Sensor,Process,Bits,Endian,Assert,CPUInfo,Intrinsics,Locale,System,Misc,GUID,Main,Stdinc
|
||||
quickreftitle = SDL3 API Quick Reference
|
||||
quickrefurl = https://libsdl.org/
|
||||
quickrefdesc = The latest version of this document can be found at https://wiki.libsdl.org/SDL3/QuickReference
|
||||
quickrefmacroregex = \A(SDL_PLATFORM_.*|SDL_.*_INTRINSICS|SDL_Atomic...Ref|SDL_assert.*?|SDL_COMPILE_TIME_ASSERT|SDL_arraysize|SDL_Swap[BL]E\d\d|SDL_[a-z]+_cast)\Z
|
||||
|
||||
envvarenabled = 1
|
||||
envvartitle = SDL3 Environment Variables
|
||||
envvardesc = SDL3 can be controlled by the user, externally, with environment variables. They are all operate exactly like the [hints you can get and set programmatically](CategoryHints), but named without the `_HINT` part (so `"SDL_HINT_A"` would be environment variable `"SDL_A"`).\n\nThis list matches the latest in SDL3's revision control.
|
||||
envvarsymregex = \ASDL_HINT_(.*)\Z
|
||||
envvarsymreplace = SDL_$1
|
||||
|
||||
|
||||
@@ -0,0 +1,145 @@
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
###########################
|
||||
#
|
||||
# SDL shared library
|
||||
#
|
||||
###########################
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_MODULE := SDL3
|
||||
|
||||
LOCAL_C_INCLUDES := $(LOCAL_PATH)/include $(LOCAL_PATH)/include/build_config $(LOCAL_PATH)/src
|
||||
|
||||
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
|
||||
|
||||
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/camera/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/camera/android/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/camera/dummy/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/core/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/core/android/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/cpuinfo/*.c) \
|
||||
$(LOCAL_PATH)/src/dialog/SDL_dialog.c \
|
||||
$(LOCAL_PATH)/src/dialog/SDL_dialog_utils.c \
|
||||
$(LOCAL_PATH)/src/dialog/android/SDL_androiddialog.c \
|
||||
$(wildcard $(LOCAL_PATH)/src/dynapi/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/events/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/io/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/io/generic/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/gpu/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/gpu/vulkan/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/haptic/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/haptic/android/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/haptic/dummy/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/haptic/hidapi/*.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/dummy/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/joystick/hidapi/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/joystick/steam/*.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/main/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/main/generic/*.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/process/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/process/dummy/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/filesystem/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/filesystem/android/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/filesystem/posix/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/sensor/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/sensor/android/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/sensor/dummy/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/render/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/render/*/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/stdlib/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/storage/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/storage/generic/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/thread/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/thread/pthread/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/time/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/time/unix/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/timer/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/timer/unix/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/tray/dummy/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/tray/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/video/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/video/android/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/video/yuv2rgb/*.c))
|
||||
|
||||
LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES
|
||||
LOCAL_CFLAGS += \
|
||||
-Wall -Wextra \
|
||||
-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_CXXFLAGS += -std=gnu++11
|
||||
|
||||
LOCAL_LDLIBS := -ldl -lGLESv1_CM -lGLESv2 -lOpenSLES -llog -landroid
|
||||
|
||||
LOCAL_LDFLAGS := -Wl,--no-undefined -Wl,--no-undefined-version -Wl,--version-script=$(LOCAL_PATH)/src/dynapi/SDL_dynapi.sym
|
||||
|
||||
ifeq ($(NDK_DEBUG),1)
|
||||
cmd-strip :=
|
||||
endif
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
|
||||
|
||||
###########################
|
||||
#
|
||||
# SDL_test static library
|
||||
#
|
||||
###########################
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_C_INCLUDES := $(LOCAL_PATH)/include $(LOCAL_PATH)/src
|
||||
|
||||
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
|
||||
|
||||
LOCAL_MODULE := SDL3_test
|
||||
|
||||
LOCAL_MODULE_FILENAME := libSDL3_test
|
||||
|
||||
LOCAL_SRC_FILES := \
|
||||
$(subst $(LOCAL_PATH)/,, \
|
||||
$(wildcard $(LOCAL_PATH)/src/test/*.c))
|
||||
|
||||
LOCAL_LDLIBS :=
|
||||
|
||||
LOCAL_LDFLAGS :=
|
||||
|
||||
LOCAL_EXPORT_LDLIBS :=
|
||||
|
||||
include $(BUILD_STATIC_LIBRARY)
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
|
||||
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/
|
||||
|
||||
or on Discord:
|
||||
|
||||
https://discord.com/invite/BwpFGBWsv8
|
||||
|
||||
Bug reports are welcome here, but we really appreciate if you use the issue tracker, as bugs discussed on the mailing list or Discord may be forgotten or missed.
|
||||
|
||||