diff --git a/.gitmodules b/.gitmodules index a9e03d70..5381f529 100644 --- a/.gitmodules +++ b/.gitmodules @@ -10,9 +10,3 @@ [submodule "lib/glfw"] path = lib/glfw url = https://github.com/glfw/glfw -[submodule "lib/libzip"] - path = lib/libzip - url = https://github.com/nih-at/libzip -[submodule "lib/zlib"] - path = lib/zlib - url = https://github.com/madler/zlib diff --git a/CMakeLists.txt b/CMakeLists.txt index e9150b63..289d2dd7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,6 +7,8 @@ cmake_minimum_required(VERSION 3.13) set(CMAKE_C_STANDARD 99) set(CMAKE_C_STANDARD_REQUIRED ON) +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED True) # Set some global flags add_compile_definitions( @@ -126,11 +128,6 @@ elseif(TARGET_TYPE STREQUAL game) elseif(TARGET_GAME STREQUAL sandbox) add_compile_definitions( GAME_NAME="Sandbox" - GAME_FILE="sandbox/game.h" - GAME_TYPE=sandboxgame_t - GAME_INIT=sandboxGameInit - GAME_UPDATE=sandboxGameUpdate - GAME_DISPOSE=sandboxGameDispose GAME_VERSION=1.0 ) diff --git a/client/glfwclient/glfwclient.h b/client/glfwclient/glfwclient.h index b2c40748..14937e22 100644 --- a/client/glfwclient/glfwclient.h +++ b/client/glfwclient/glfwclient.h @@ -6,10 +6,10 @@ #pragma once #include #include -#include -#include -#include -#include +#include +#include +#include +#include #define WINDOW_WIDTH_DEFAULT 1280 #define WINDOW_HEIGHT_DEFAULT WINDOW_WIDTH_DEFAULT/16*9 diff --git a/lib/libzip b/lib/libzip deleted file mode 160000 index 945768ec..00000000 --- a/lib/libzip +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 945768eca2ab1f9cc48ee76f0cdf29d30c1f2980 diff --git a/lib/zlib b/lib/zlib deleted file mode 160000 index cacf7f1d..00000000 --- a/lib/zlib +++ /dev/null @@ -1 +0,0 @@ -Subproject commit cacf7f1d4e3d44d871b605da3b647f07d718623f diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5b90ce65..b534e8d3 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -3,9 +3,7 @@ # This software is released under the MIT License. # https://opensource.org/licenses/MIT -# Definitions - -# Libraries +# Dawn Libraries target_link_libraries(${PROJECT_NAME} PUBLIC glad @@ -14,26 +12,25 @@ target_link_libraries(${PROJECT_NAME} duktape ) -# Sources -file(GLOB_RECURSE SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/*.c) -file(GLOB_RECURSE HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/*.h) - -list(FILTER SOURCES EXCLUDE REGEX ".*game\\/.*") -list(FILTER HEADERS EXCLUDE REGEX ".*game\\/.*") +target_include_directories(${PROJECT_NAME} + PUBLIC + ${CMAKE_CURRENT_LIST_DIR} +) +# Dawn Sources +file(GLOB_RECURSE SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/dawn/*.c(pp|xx)) +file(GLOB_RECURSE HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/dawn/*.h(pp|xx)) target_sources(${PROJECT_NAME} PRIVATE ${SOURCES} ${HEADERS} ) -# Includes -target_include_directories(${PROJECT_NAME} - PUBLIC - ${CMAKE_CURRENT_LIST_DIR} -) - -# Sub -if(TARGET_TYPE STREQUAL game) - add_subdirectory(game) -endif() \ No newline at end of file +# Sandbox Game Sources +file(GLOB_RECURSE SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/sandbox/*.c(pp|xx)) +file(GLOB_RECURSE HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/sandbox/*.h(pp|xx)) +target_sources(${PROJECT_NAME} + PRIVATE + ${SOURCES} + ${HEADERS} +) \ No newline at end of file diff --git a/src/display/animation/animation.c b/src/dawn/display/animation/animation.c similarity index 100% rename from src/display/animation/animation.c rename to src/dawn/display/animation/animation.c diff --git a/src/display/animation/animation.h b/src/dawn/display/animation/animation.h similarity index 100% rename from src/display/animation/animation.h rename to src/dawn/display/animation/animation.h diff --git a/src/display/animation/easing.c b/src/dawn/display/animation/easing.c similarity index 100% rename from src/display/animation/easing.c rename to src/dawn/display/animation/easing.c diff --git a/src/display/animation/easing.h b/src/dawn/display/animation/easing.h similarity index 100% rename from src/display/animation/easing.h rename to src/dawn/display/animation/easing.h diff --git a/src/display/animation/queue.c b/src/dawn/display/animation/queue.c similarity index 100% rename from src/display/animation/queue.c rename to src/dawn/display/animation/queue.c diff --git a/src/display/animation/queue.h b/src/dawn/display/animation/queue.h similarity index 100% rename from src/display/animation/queue.h rename to src/dawn/display/animation/queue.h diff --git a/src/display/animation/timeline.c b/src/dawn/display/animation/timeline.c similarity index 100% rename from src/display/animation/timeline.c rename to src/dawn/display/animation/timeline.c diff --git a/src/display/animation/timeline.h b/src/dawn/display/animation/timeline.h similarity index 100% rename from src/display/animation/timeline.h rename to src/dawn/display/animation/timeline.h diff --git a/src/display/bitmapfont.c b/src/dawn/display/bitmapfont.c similarity index 100% rename from src/display/bitmapfont.c rename to src/dawn/display/bitmapfont.c diff --git a/src/display/bitmapfont.h b/src/dawn/display/bitmapfont.h similarity index 100% rename from src/display/bitmapfont.h rename to src/dawn/display/bitmapfont.h diff --git a/src/display/camera.c b/src/dawn/display/camera.c similarity index 100% rename from src/display/camera.c rename to src/dawn/display/camera.c diff --git a/src/display/camera.h b/src/dawn/display/camera.h similarity index 100% rename from src/display/camera.h rename to src/dawn/display/camera.h diff --git a/src/display/font.c b/src/dawn/display/font.c similarity index 100% rename from src/display/font.c rename to src/dawn/display/font.c diff --git a/src/display/font.h b/src/dawn/display/font.h similarity index 100% rename from src/display/font.h rename to src/dawn/display/font.h diff --git a/src/display/framebuffer.c b/src/dawn/display/framebuffer.c similarity index 100% rename from src/display/framebuffer.c rename to src/dawn/display/framebuffer.c diff --git a/src/display/framebuffer.h b/src/dawn/display/framebuffer.h similarity index 100% rename from src/display/framebuffer.h rename to src/dawn/display/framebuffer.h diff --git a/src/display/matrix.c b/src/dawn/display/matrix.c similarity index 100% rename from src/display/matrix.c rename to src/dawn/display/matrix.c diff --git a/src/display/matrix.h b/src/dawn/display/matrix.h similarity index 100% rename from src/display/matrix.h rename to src/dawn/display/matrix.h diff --git a/src/display/primitive/cube.c b/src/dawn/display/primitive/cube.c similarity index 100% rename from src/display/primitive/cube.c rename to src/dawn/display/primitive/cube.c diff --git a/src/display/primitive/cube.h b/src/dawn/display/primitive/cube.h similarity index 100% rename from src/display/primitive/cube.h rename to src/dawn/display/primitive/cube.h diff --git a/src/display/primitive/primitive.c b/src/dawn/display/primitive/primitive.c similarity index 100% rename from src/display/primitive/primitive.c rename to src/dawn/display/primitive/primitive.c diff --git a/src/display/primitive/primitive.h b/src/dawn/display/primitive/primitive.h similarity index 100% rename from src/display/primitive/primitive.h rename to src/dawn/display/primitive/primitive.h diff --git a/src/display/primitive/quad.c b/src/dawn/display/primitive/quad.c similarity index 100% rename from src/display/primitive/quad.c rename to src/dawn/display/primitive/quad.c diff --git a/src/display/primitive/quad.h b/src/dawn/display/primitive/quad.h similarity index 100% rename from src/display/primitive/quad.h rename to src/dawn/display/primitive/quad.h diff --git a/src/display/primitive/skywall.c b/src/dawn/display/primitive/skywall.c similarity index 100% rename from src/display/primitive/skywall.c rename to src/dawn/display/primitive/skywall.c diff --git a/src/display/primitive/skywall.h b/src/dawn/display/primitive/skywall.h similarity index 100% rename from src/display/primitive/skywall.h rename to src/dawn/display/primitive/skywall.h diff --git a/src/display/render.c b/src/dawn/display/render.c similarity index 100% rename from src/display/render.c rename to src/dawn/display/render.c diff --git a/src/display/render.h b/src/dawn/display/render.h similarity index 100% rename from src/display/render.h rename to src/dawn/display/render.h diff --git a/src/display/renderlist.c b/src/dawn/display/renderlist.c similarity index 100% rename from src/display/renderlist.c rename to src/dawn/display/renderlist.c diff --git a/src/display/renderlist.h b/src/dawn/display/renderlist.h similarity index 99% rename from src/display/renderlist.h rename to src/dawn/display/renderlist.h index 3a79e241..3c628414 100644 --- a/src/display/renderlist.h +++ b/src/dawn/display/renderlist.h @@ -9,7 +9,7 @@ #include "../libs.h" #include "framebuffer.h" #include "primitive/primitive.h" -#include "shader/shader.h" +#include "shader.h" #include "camera.h" #include "../engine/engine.h" #include "primitive/quad.h" diff --git a/src/display/shader/shader.c b/src/dawn/display/shader.c similarity index 100% rename from src/display/shader/shader.c rename to src/dawn/display/shader.c diff --git a/src/display/shader/shader.h b/src/dawn/display/shader.h similarity index 97% rename from src/display/shader/shader.h rename to src/dawn/display/shader.h index 5c8638ad..3401f12c 100644 --- a/src/display/shader/shader.h +++ b/src/dawn/display/shader.h @@ -6,11 +6,11 @@ */ #pragma once -#include "../../libs.h" -#include "../matrix.h" -#include "../camera.h" -#include "../texture.h" -#include "../../util/array.h" +#include +#include "matrix.h" +#include "camera.h" +#include "texture.h" +#include "../util/array.h" #define SHADER_UNIFORM_NAME_MAX 24 #define SHADER_UNIFORM_COUNT 16 diff --git a/src/display/spritebatch.c b/src/dawn/display/spritebatch.c similarity index 100% rename from src/display/spritebatch.c rename to src/dawn/display/spritebatch.c diff --git a/src/display/spritebatch.h b/src/dawn/display/spritebatch.h similarity index 100% rename from src/display/spritebatch.h rename to src/dawn/display/spritebatch.h diff --git a/src/display/texture.c b/src/dawn/display/texture.c similarity index 100% rename from src/display/texture.c rename to src/dawn/display/texture.c diff --git a/src/display/texture.h b/src/dawn/display/texture.h similarity index 100% rename from src/display/texture.h rename to src/dawn/display/texture.h diff --git a/src/display/texturescale.h b/src/dawn/display/texturescale.h similarity index 100% rename from src/display/texturescale.h rename to src/dawn/display/texturescale.h diff --git a/src/display/tileset.c b/src/dawn/display/tileset.c similarity index 100% rename from src/display/tileset.c rename to src/dawn/display/tileset.c diff --git a/src/display/tileset.h b/src/dawn/display/tileset.h similarity index 100% rename from src/display/tileset.h rename to src/dawn/display/tileset.h diff --git a/src/engine/client.c b/src/dawn/engine/client.c similarity index 100% rename from src/engine/client.c rename to src/dawn/engine/client.c diff --git a/src/engine/client.h b/src/dawn/engine/client.h similarity index 100% rename from src/engine/client.h rename to src/dawn/engine/client.h diff --git a/src/engine/engine.c b/src/dawn/engine/engine.c similarity index 100% rename from src/engine/engine.c rename to src/dawn/engine/engine.c diff --git a/src/engine/engine.h b/src/dawn/engine/engine.h similarity index 100% rename from src/engine/engine.h rename to src/dawn/engine/engine.h diff --git a/src/engine/thread.c b/src/dawn/engine/thread.c similarity index 100% rename from src/engine/thread.c rename to src/dawn/engine/thread.c diff --git a/src/engine/thread.h b/src/dawn/engine/thread.h similarity index 100% rename from src/engine/thread.h rename to src/dawn/engine/thread.h diff --git a/src/epoch/epoch.c b/src/dawn/epoch/epoch.c similarity index 100% rename from src/epoch/epoch.c rename to src/dawn/epoch/epoch.c diff --git a/src/epoch/epoch.h b/src/dawn/epoch/epoch.h similarity index 100% rename from src/epoch/epoch.h rename to src/dawn/epoch/epoch.h diff --git a/src/file/asset.c b/src/dawn/file/asset.c similarity index 100% rename from src/file/asset.c rename to src/dawn/file/asset.c diff --git a/src/file/asset.h b/src/dawn/file/asset.h similarity index 98% rename from src/file/asset.h rename to src/dawn/file/asset.h index 8f9e4f45..4303b0b4 100644 --- a/src/file/asset.h +++ b/src/dawn/file/asset.h @@ -7,7 +7,7 @@ #pragma once #include "../libs.h" -#include "../display/shader/shader.h" +#include "../display/shader.h" #include "../display/texture.h" #include "../display/font.h" diff --git a/src/file/assetmanager.c b/src/dawn/file/assetmanager.c similarity index 100% rename from src/file/assetmanager.c rename to src/dawn/file/assetmanager.c diff --git a/src/file/assetmanager.h b/src/dawn/file/assetmanager.h similarity index 100% rename from src/file/assetmanager.h rename to src/dawn/file/assetmanager.h diff --git a/src/file/csv.c b/src/dawn/file/csv.c similarity index 100% rename from src/file/csv.c rename to src/dawn/file/csv.c diff --git a/src/file/csv.h b/src/dawn/file/csv.h similarity index 100% rename from src/file/csv.h rename to src/dawn/file/csv.h diff --git a/src/file/loaders/font.c b/src/dawn/file/loaders/font.c similarity index 100% rename from src/file/loaders/font.c rename to src/dawn/file/loaders/font.c diff --git a/src/file/loaders/font.h b/src/dawn/file/loaders/font.h similarity index 100% rename from src/file/loaders/font.h rename to src/dawn/file/loaders/font.h diff --git a/src/file/loaders/item.c b/src/dawn/file/loaders/item.c similarity index 100% rename from src/file/loaders/item.c rename to src/dawn/file/loaders/item.c diff --git a/src/file/loaders/item.h b/src/dawn/file/loaders/item.h similarity index 100% rename from src/file/loaders/item.h rename to src/dawn/file/loaders/item.h diff --git a/src/file/loaders/scaledtexture.c b/src/dawn/file/loaders/scaledtexture.c similarity index 100% rename from src/file/loaders/scaledtexture.c rename to src/dawn/file/loaders/scaledtexture.c diff --git a/src/file/loaders/scaledtexture.h b/src/dawn/file/loaders/scaledtexture.h similarity index 100% rename from src/file/loaders/scaledtexture.h rename to src/dawn/file/loaders/scaledtexture.h diff --git a/src/file/loaders/shader.c b/src/dawn/file/loaders/shader.c similarity index 100% rename from src/file/loaders/shader.c rename to src/dawn/file/loaders/shader.c diff --git a/src/file/loaders/shader.h b/src/dawn/file/loaders/shader.h similarity index 100% rename from src/file/loaders/shader.h rename to src/dawn/file/loaders/shader.h diff --git a/src/file/loaders/texture.c b/src/dawn/file/loaders/texture.c similarity index 100% rename from src/file/loaders/texture.c rename to src/dawn/file/loaders/texture.c diff --git a/src/file/loaders/texture.h b/src/dawn/file/loaders/texture.h similarity index 100% rename from src/file/loaders/texture.h rename to src/dawn/file/loaders/texture.h diff --git a/src/file/types/common.h b/src/dawn/file/types/common.h similarity index 98% rename from src/file/types/common.h rename to src/dawn/file/types/common.h index 32a70b79..9b22c66f 100644 --- a/src/file/types/common.h +++ b/src/dawn/file/types/common.h @@ -7,7 +7,7 @@ #pragma once #include "../../libs.h" -#include "../engine/thread.h" +#include "../../engine/thread.h" #include "texture.h" #include "font.h" #include "shader.h" diff --git a/src/file/types/font.h b/src/dawn/file/types/font.h similarity index 100% rename from src/file/types/font.h rename to src/dawn/file/types/font.h diff --git a/src/file/types/scaledtexture.h b/src/dawn/file/types/scaledtexture.h similarity index 100% rename from src/file/types/scaledtexture.h rename to src/dawn/file/types/scaledtexture.h diff --git a/src/file/types/shader.h b/src/dawn/file/types/shader.h similarity index 88% rename from src/file/types/shader.h rename to src/dawn/file/types/shader.h index 839b4f91..be9d2a5c 100644 --- a/src/file/types/shader.h +++ b/src/dawn/file/types/shader.h @@ -5,7 +5,7 @@ #pragma once #include "../../libs.h" -#include "../../display/shader/shader.h" +#include "../../display/shader.h" typedef struct { shader_t shader; diff --git a/src/file/types/texture.h b/src/dawn/file/types/texture.h similarity index 100% rename from src/file/types/texture.h rename to src/dawn/file/types/texture.h diff --git a/src/file/xml.c b/src/dawn/file/xml.c similarity index 100% rename from src/file/xml.c rename to src/dawn/file/xml.c diff --git a/src/file/xml.h b/src/dawn/file/xml.h similarity index 100% rename from src/file/xml.h rename to src/dawn/file/xml.h diff --git a/src/input/input.c b/src/dawn/input/input.c similarity index 100% rename from src/input/input.c rename to src/dawn/input/input.c diff --git a/src/input/input.h b/src/dawn/input/input.h similarity index 100% rename from src/input/input.h rename to src/dawn/input/input.h diff --git a/src/libs.h b/src/dawn/libs.h similarity index 100% rename from src/libs.h rename to src/dawn/libs.h diff --git a/src/locale/language.c b/src/dawn/locale/language.c similarity index 100% rename from src/locale/language.c rename to src/dawn/locale/language.c diff --git a/src/locale/language.h b/src/dawn/locale/language.h similarity index 100% rename from src/locale/language.h rename to src/dawn/locale/language.h diff --git a/src/physics/aabb.c b/src/dawn/physics/aabb.c similarity index 100% rename from src/physics/aabb.c rename to src/dawn/physics/aabb.c diff --git a/src/physics/aabb.h b/src/dawn/physics/aabb.h similarity index 100% rename from src/physics/aabb.h rename to src/dawn/physics/aabb.h diff --git a/src/physics/sphere.c b/src/dawn/physics/sphere.c similarity index 100% rename from src/physics/sphere.c rename to src/dawn/physics/sphere.c diff --git a/src/physics/sphere.h b/src/dawn/physics/sphere.h similarity index 100% rename from src/physics/sphere.h rename to src/dawn/physics/sphere.h diff --git a/src/physics/vector.c b/src/dawn/physics/vector.c similarity index 100% rename from src/physics/vector.c rename to src/dawn/physics/vector.c diff --git a/src/physics/vector.h b/src/dawn/physics/vector.h similarity index 100% rename from src/physics/vector.h rename to src/dawn/physics/vector.h diff --git a/src/poker/bet.c b/src/dawn/poker/bet.c similarity index 100% rename from src/poker/bet.c rename to src/dawn/poker/bet.c diff --git a/src/poker/bet.h b/src/dawn/poker/bet.h similarity index 100% rename from src/poker/bet.h rename to src/dawn/poker/bet.h diff --git a/src/poker/card.c b/src/dawn/poker/card.c similarity index 100% rename from src/poker/card.c rename to src/dawn/poker/card.c diff --git a/src/poker/card.h b/src/dawn/poker/card.h similarity index 100% rename from src/poker/card.h rename to src/dawn/poker/card.h diff --git a/src/poker/common.h b/src/dawn/poker/common.h similarity index 100% rename from src/poker/common.h rename to src/dawn/poker/common.h diff --git a/src/poker/dealer.c b/src/dawn/poker/dealer.c similarity index 100% rename from src/poker/dealer.c rename to src/dawn/poker/dealer.c diff --git a/src/poker/dealer.h b/src/dawn/poker/dealer.h similarity index 100% rename from src/poker/dealer.h rename to src/dawn/poker/dealer.h diff --git a/src/poker/player.c b/src/dawn/poker/player.c similarity index 100% rename from src/poker/player.c rename to src/dawn/poker/player.c diff --git a/src/poker/player.h b/src/dawn/poker/player.h similarity index 100% rename from src/poker/player.h rename to src/dawn/poker/player.h diff --git a/src/poker/poker.c b/src/dawn/poker/poker.c similarity index 100% rename from src/poker/poker.c rename to src/dawn/poker/poker.c diff --git a/src/poker/poker.h b/src/dawn/poker/poker.h similarity index 100% rename from src/poker/poker.h rename to src/dawn/poker/poker.h diff --git a/src/poker/pot.c b/src/dawn/poker/pot.c similarity index 100% rename from src/poker/pot.c rename to src/dawn/poker/pot.c diff --git a/src/poker/pot.h b/src/dawn/poker/pot.h similarity index 100% rename from src/poker/pot.h rename to src/dawn/poker/pot.h diff --git a/src/poker/turn.c b/src/dawn/poker/turn.c similarity index 100% rename from src/poker/turn.c rename to src/dawn/poker/turn.c diff --git a/src/poker/turn.h b/src/dawn/poker/turn.h similarity index 100% rename from src/poker/turn.h rename to src/dawn/poker/turn.h diff --git a/src/poker/winner.c b/src/dawn/poker/winner.c similarity index 100% rename from src/poker/winner.c rename to src/dawn/poker/winner.c diff --git a/src/poker/winner.h b/src/dawn/poker/winner.h similarity index 100% rename from src/poker/winner.h rename to src/dawn/poker/winner.h diff --git a/src/save/save.c b/src/dawn/save/save.c similarity index 100% rename from src/save/save.c rename to src/dawn/save/save.c diff --git a/src/save/save.h b/src/dawn/save/save.h similarity index 100% rename from src/save/save.h rename to src/dawn/save/save.h diff --git a/src/scene/loadingscene.c b/src/dawn/scene/loadingscene.c similarity index 100% rename from src/scene/loadingscene.c rename to src/dawn/scene/loadingscene.c diff --git a/src/scene/loadingscene.h b/src/dawn/scene/loadingscene.h similarity index 100% rename from src/scene/loadingscene.h rename to src/dawn/scene/loadingscene.h diff --git a/src/scene/scene.c b/src/dawn/scene/scene.c similarity index 100% rename from src/scene/scene.c rename to src/dawn/scene/scene.c diff --git a/src/scene/scene.h b/src/dawn/scene/scene.h similarity index 96% rename from src/scene/scene.h rename to src/dawn/scene/scene.h index 635efc93..872d3094 100644 --- a/src/scene/scene.h +++ b/src/dawn/scene/scene.h @@ -10,7 +10,7 @@ #include "../file/assetmanager.h" #include "../engine/engine.h" #include "../display/renderlist.h" -#include "../display/shader/shader.h" +#include "../display/shader.h" // Forwarder for scene_t typedef struct _scene_t scene_t; diff --git a/src/script/api/asset.c b/src/dawn/script/api/asset.c similarity index 100% rename from src/script/api/asset.c rename to src/dawn/script/api/asset.c diff --git a/src/script/api/asset.d.ts b/src/dawn/script/api/asset.d.ts similarity index 100% rename from src/script/api/asset.d.ts rename to src/dawn/script/api/asset.d.ts diff --git a/src/script/api/asset.h b/src/dawn/script/api/asset.h similarity index 100% rename from src/script/api/asset.h rename to src/dawn/script/api/asset.h diff --git a/src/script/api/display.c b/src/dawn/script/api/display.c similarity index 100% rename from src/script/api/display.c rename to src/dawn/script/api/display.c diff --git a/src/script/api/display.d.ts b/src/dawn/script/api/display.d.ts similarity index 100% rename from src/script/api/display.d.ts rename to src/dawn/script/api/display.d.ts diff --git a/src/script/api/display.h b/src/dawn/script/api/display.h similarity index 100% rename from src/script/api/display.h rename to src/dawn/script/api/display.h diff --git a/src/script/api/epoch.c b/src/dawn/script/api/epoch.c similarity index 100% rename from src/script/api/epoch.c rename to src/dawn/script/api/epoch.c diff --git a/src/script/api/epoch.d.ts b/src/dawn/script/api/epoch.d.ts similarity index 100% rename from src/script/api/epoch.d.ts rename to src/dawn/script/api/epoch.d.ts diff --git a/src/script/api/epoch.h b/src/dawn/script/api/epoch.h similarity index 100% rename from src/script/api/epoch.h rename to src/dawn/script/api/epoch.h diff --git a/src/script/api/global.d.ts b/src/dawn/script/api/global.d.ts similarity index 100% rename from src/script/api/global.d.ts rename to src/dawn/script/api/global.d.ts diff --git a/src/script/api/io.c b/src/dawn/script/api/io.c similarity index 100% rename from src/script/api/io.c rename to src/dawn/script/api/io.c diff --git a/src/script/api/io.d.ts b/src/dawn/script/api/io.d.ts similarity index 100% rename from src/script/api/io.d.ts rename to src/dawn/script/api/io.d.ts diff --git a/src/script/api/io.h b/src/dawn/script/api/io.h similarity index 100% rename from src/script/api/io.h rename to src/dawn/script/api/io.h diff --git a/src/script/scripter.c b/src/dawn/script/scripter.c similarity index 100% rename from src/script/scripter.c rename to src/dawn/script/scripter.c diff --git a/src/script/scripter.h b/src/dawn/script/scripter.h similarity index 100% rename from src/script/scripter.h rename to src/dawn/script/scripter.h diff --git a/src/ui/align.c b/src/dawn/ui/align.c similarity index 100% rename from src/ui/align.c rename to src/dawn/ui/align.c diff --git a/src/ui/align.h b/src/dawn/ui/align.h similarity index 100% rename from src/ui/align.h rename to src/dawn/ui/align.h diff --git a/src/ui/breakpoint.c b/src/dawn/ui/breakpoint.c similarity index 100% rename from src/ui/breakpoint.c rename to src/dawn/ui/breakpoint.c diff --git a/src/ui/breakpoint.h b/src/dawn/ui/breakpoint.h similarity index 100% rename from src/ui/breakpoint.h rename to src/dawn/ui/breakpoint.h diff --git a/src/ui/frame.c b/src/dawn/ui/frame.c similarity index 100% rename from src/ui/frame.c rename to src/dawn/ui/frame.c diff --git a/src/ui/frame.h b/src/dawn/ui/frame.h similarity index 97% rename from src/ui/frame.h rename to src/dawn/ui/frame.h index 9a8b5b02..6ff7ce62 100644 --- a/src/ui/frame.h +++ b/src/dawn/ui/frame.h @@ -7,7 +7,7 @@ #pragma once #include "../libs.h" -#include "../display/shader/shader.h" +#include "../display/shader.h" #include "../display/primitive/primitive.h" #include "../display/primitive/quad.h" #include "../display/font.h" diff --git a/src/ui/framedtextmenu.c b/src/dawn/ui/framedtextmenu.c similarity index 100% rename from src/ui/framedtextmenu.c rename to src/dawn/ui/framedtextmenu.c diff --git a/src/ui/framedtextmenu.h b/src/dawn/ui/framedtextmenu.h similarity index 100% rename from src/ui/framedtextmenu.h rename to src/dawn/ui/framedtextmenu.h diff --git a/src/ui/grid.c b/src/dawn/ui/grid.c similarity index 100% rename from src/ui/grid.c rename to src/dawn/ui/grid.c diff --git a/src/ui/grid.h b/src/dawn/ui/grid.h similarity index 100% rename from src/ui/grid.h rename to src/dawn/ui/grid.h diff --git a/src/ui/image.c b/src/dawn/ui/image.c similarity index 100% rename from src/ui/image.c rename to src/dawn/ui/image.c diff --git a/src/ui/image.h b/src/dawn/ui/image.h similarity index 96% rename from src/ui/image.h rename to src/dawn/ui/image.h index 19cfc82c..9ff5e9b3 100644 --- a/src/ui/image.h +++ b/src/dawn/ui/image.h @@ -9,7 +9,8 @@ #include "../libs.h" #include "../display/primitive/primitive.h" #include "../display/primitive/quad.h" -#include "../display/shader/common.h" +#include "../display/texture.h" +#include "../display/shader.h" typedef struct { texture_t *texture; diff --git a/src/ui/label.c b/src/dawn/ui/label.c similarity index 100% rename from src/ui/label.c rename to src/dawn/ui/label.c diff --git a/src/ui/label.h b/src/dawn/ui/label.h similarity index 97% rename from src/ui/label.h rename to src/dawn/ui/label.h index 9be345f5..565e53d5 100644 --- a/src/ui/label.h +++ b/src/dawn/ui/label.h @@ -5,7 +5,7 @@ #pragma once #include "../libs.h" -#include "../display/shader/shader.h" +#include "../display/shader.h" #include "../display/primitive/primitive.h" #include "../display/font.h" diff --git a/src/ui/menu.c b/src/dawn/ui/menu.c similarity index 100% rename from src/ui/menu.c rename to src/dawn/ui/menu.c diff --git a/src/ui/menu.h b/src/dawn/ui/menu.h similarity index 100% rename from src/ui/menu.h rename to src/dawn/ui/menu.h diff --git a/src/ui/rectangle.c b/src/dawn/ui/rectangle.c similarity index 100% rename from src/ui/rectangle.c rename to src/dawn/ui/rectangle.c diff --git a/src/ui/rectangle.h b/src/dawn/ui/rectangle.h similarity index 94% rename from src/ui/rectangle.h rename to src/dawn/ui/rectangle.h index e84c3a13..29ca7d45 100644 --- a/src/ui/rectangle.h +++ b/src/dawn/ui/rectangle.h @@ -8,7 +8,7 @@ #pragma once #include "../libs.h" #include "../display/texture.h" -#include "../display/shader/shader.h" +#include "../display/shader.h" #include "../display/primitive/primitive.h" #include "../display/primitive/quad.h" diff --git a/src/ui/textmenu.c b/src/dawn/ui/textmenu.c similarity index 100% rename from src/ui/textmenu.c rename to src/dawn/ui/textmenu.c diff --git a/src/ui/textmenu.h b/src/dawn/ui/textmenu.h similarity index 100% rename from src/ui/textmenu.h rename to src/dawn/ui/textmenu.h diff --git a/src/util/array.c b/src/dawn/util/array.c similarity index 100% rename from src/util/array.c rename to src/dawn/util/array.c diff --git a/src/util/array.h b/src/dawn/util/array.h similarity index 100% rename from src/util/array.h rename to src/dawn/util/array.h diff --git a/src/util/dictionary.c b/src/dawn/util/dictionary.c similarity index 100% rename from src/util/dictionary.c rename to src/dawn/util/dictionary.c diff --git a/src/util/dictionary.h b/src/dawn/util/dictionary.h similarity index 100% rename from src/util/dictionary.h rename to src/dawn/util/dictionary.h diff --git a/src/util/dynarray.c b/src/dawn/util/dynarray.c similarity index 100% rename from src/util/dynarray.c rename to src/dawn/util/dynarray.c diff --git a/src/util/dynarray.h b/src/dawn/util/dynarray.h similarity index 100% rename from src/util/dynarray.h rename to src/dawn/util/dynarray.h diff --git a/src/util/flags.h b/src/dawn/util/flags.h similarity index 100% rename from src/util/flags.h rename to src/dawn/util/flags.h diff --git a/src/util/list.c b/src/dawn/util/list.c similarity index 100% rename from src/util/list.c rename to src/dawn/util/list.c diff --git a/src/util/list.h b/src/dawn/util/list.h similarity index 100% rename from src/util/list.h rename to src/dawn/util/list.h diff --git a/src/util/math.h b/src/dawn/util/math.h similarity index 100% rename from src/util/math.h rename to src/dawn/util/math.h diff --git a/src/util/mem.c b/src/dawn/util/mem.c similarity index 100% rename from src/util/mem.c rename to src/dawn/util/mem.c diff --git a/src/util/mem.h b/src/dawn/util/mem.h similarity index 100% rename from src/util/mem.h rename to src/dawn/util/mem.h diff --git a/src/util/rand.h b/src/dawn/util/rand.h similarity index 100% rename from src/util/rand.h rename to src/dawn/util/rand.h diff --git a/src/util/string.c b/src/dawn/util/string.c similarity index 100% rename from src/util/string.c rename to src/dawn/util/string.c diff --git a/src/util/string.h b/src/dawn/util/string.h similarity index 100% rename from src/util/string.h rename to src/dawn/util/string.h diff --git a/src/vn/conversation/talk.c b/src/dawn/vn/conversation/talk.c similarity index 100% rename from src/vn/conversation/talk.c rename to src/dawn/vn/conversation/talk.c diff --git a/src/vn/conversation/talk.h b/src/dawn/vn/conversation/talk.h similarity index 100% rename from src/vn/conversation/talk.h rename to src/dawn/vn/conversation/talk.h diff --git a/src/vn/conversation/vnconversation.c b/src/dawn/vn/conversation/vnconversation.c similarity index 100% rename from src/vn/conversation/vnconversation.c rename to src/dawn/vn/conversation/vnconversation.c diff --git a/src/vn/conversation/vnconversation.h b/src/dawn/vn/conversation/vnconversation.h similarity index 100% rename from src/vn/conversation/vnconversation.h rename to src/dawn/vn/conversation/vnconversation.h diff --git a/src/vn/ui/vntextbox.c b/src/dawn/vn/ui/vntextbox.c similarity index 100% rename from src/vn/ui/vntextbox.c rename to src/dawn/vn/ui/vntextbox.c diff --git a/src/vn/ui/vntextbox.h b/src/dawn/vn/ui/vntextbox.h similarity index 98% rename from src/vn/ui/vntextbox.h rename to src/dawn/vn/ui/vntextbox.h index c8c640d1..6ac5e0b8 100644 --- a/src/vn/ui/vntextbox.h +++ b/src/dawn/vn/ui/vntextbox.h @@ -8,7 +8,7 @@ #pragma once #include "../../libs.h" #include "../../display/primitive/primitive.h" -#include "../../display/shader/shader.h" +#include "../../display/shader.h" #include "../../display/animation/timeline.h" #include "../../display/font.h" #include "../../display/primitive/quad.h" diff --git a/src/vn/vncharacter.c b/src/dawn/vn/vncharacter.c similarity index 100% rename from src/vn/vncharacter.c rename to src/dawn/vn/vncharacter.c diff --git a/src/vn/vncharacter.h b/src/dawn/vn/vncharacter.h similarity index 97% rename from src/vn/vncharacter.h rename to src/dawn/vn/vncharacter.h index e23aaaa1..08fd550d 100644 --- a/src/vn/vncharacter.h +++ b/src/dawn/vn/vncharacter.h @@ -10,7 +10,7 @@ #include "../display/texture.h" #include "../display/tileset.h" #include "../display/primitive/primitive.h" -#include "../display/shader/shader.h" +#include "../display/shader.h" #include "../display/primitive/quad.h" #include "../display/animation/animation.h" #include "../engine/engine.h" diff --git a/src/vn/vnscene.c b/src/dawn/vn/vnscene.c similarity index 100% rename from src/vn/vnscene.c rename to src/dawn/vn/vnscene.c diff --git a/src/vn/vnscene.h b/src/dawn/vn/vnscene.h similarity index 97% rename from src/vn/vnscene.h rename to src/dawn/vn/vnscene.h index 8e550083..b75e5c0e 100644 --- a/src/vn/vnscene.h +++ b/src/dawn/vn/vnscene.h @@ -11,7 +11,7 @@ #include "conversation/vnconversation.h" #include "ui/vntextbox.h" #include "../display/camera.h" -#include "../display/shader/shader.h" +#include "../display/shader.h" #include "../display/animation/timeline.h" #include "../display/animation/easing.h" #include "../util/math.h" diff --git a/src/dawninit.h b/src/dawninit.h new file mode 100644 index 00000000..cc2df130 --- /dev/null +++ b/src/dawninit.h @@ -0,0 +1,9 @@ +/** + * Copyright (c) 2021 Dominic Masters + * + * This software is released under the MIT License. + * https://opensource.org/licenses/MIT + */ + +#pragma once +#include \ No newline at end of file diff --git a/src/display/shader/common.c b/src/display/shader/common.c deleted file mode 100644 index 750f2fbc..00000000 --- a/src/display/shader/common.c +++ /dev/null @@ -1,63 +0,0 @@ -/** - * Copyright (c) 2021 Dominic Masters - * - * This software is released under the MIT License. - * https://opensource.org/licenses/MIT - */ - -#include "common.h" - -void shaderCommonInit(shadercommon_t *shader, char *vert, char *frag) { - shaderInit(&shader->shader, vert, frag); - - shader->uniformProjection = shaderGetUniform( - &shader->shader, SHADER_COMMON_UNIFORM_PROJECTION - ); - shader->uniformView = shaderGetUniform( - &shader->shader, SHADER_COMMON_UNIFORM_VIEW - ); - shader->uniformModel = shaderGetUniform( - &shader->shader, SHADER_COMMON_UNIFORM_MODEL - ); - shader->uniformColor = shaderGetUniform( - &shader->shader, SHADER_COMMON_UNIFORM_COLOR - ); - shader->uniformTexture = shaderGetUniform( - &shader->shader, SHADER_COMMON_UNIFORM_TEXTURE - ); -} - -void shaderCommonUseCamera(shadercommon_t *shader, camera_t *camera) { - shaderUseCamera( - &shader->shader, shader->uniformView, shader->uniformProjection, camera - ); -} - -void shaderCommonUseTexture(shadercommon_t *shader, texture_t *texture) { - shaderUseTexture(&shader->shader, shader->uniformTexture, texture); -} - -void shaderCommonUseColor(shadercommon_t *shader, pixel_t color) { - shaderUseColor(&shader->shader, shader->uniformColor, color); -} - -void shaderCommonUsePosition(shadercommon_t *shader, - float x, float y, float z, - float pitch, float yaw, float roll -) { - shaderUsePosition( - &shader->shader, shader->uniformModel, x, y, z, pitch, yaw, roll - ); -} - -void shaderCommonUsePositionAndScale( - shadercommon_t *shader, - float x, float y, float z, - float pitch, float yaw, float roll, - float scaleX, float scaleY, float scaleZ -) { - shaderUsePositionAndScale( - &shader->shader, shader->uniformView, - x, y, z, pitch, yaw, roll, scaleX, scaleY, scaleZ - ); -} \ No newline at end of file diff --git a/src/display/shader/common.h b/src/display/shader/common.h deleted file mode 100644 index 0cd9084c..00000000 --- a/src/display/shader/common.h +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Copyright (c) 2021 Dominic Masters - * - * This software is released under the MIT License. - * https://opensource.org/licenses/MIT - */ - -#pragma once -#include "shader.h" -#include "../texture.h" - -#define SHADER_COMMON_UNIFORM_PROJECTION "u_Proj" -#define SHADER_COMMON_UNIFORM_VIEW "u_View" -#define SHADER_COMMON_UNIFORM_MODEL "u_Modl" -#define SHADER_COMMON_UNIFORM_COLOR "u_Colr" -#define SHADER_COMMON_UNIFORM_TEXTURE "u_Text" - -typedef struct { - shader_t shader; - shaderuniform_t uniformProjection; - shaderuniform_t uniformView; - shaderuniform_t uniformModel; - shaderuniform_t uniformColor; - shaderuniform_t uniformTexture; -} shadercommon_t; - -void shaderCommonInit(shadercommon_t *shader, char *vert, char *frag); -void shaderCommonUseCamera(shadercommon_t *shader, camera_t *camera); -void shaderCommonUseTexture(shadercommon_t *shader, texture_t *texture); -void shaderCommonUseColor(shadercommon_t *shader, pixel_t color); -void shaderCommonUsePosition(shadercommon_t *shader, - float x, float y, float z, - float pitch, float yaw, float roll -); -void shaderCommonUsePositionAndScale( - shadercommon_t *shader, - float x, float y, float z, - float pitch, float yaw, float roll, - float scaleX, float scaleY, float scaleZ -); \ No newline at end of file diff --git a/src/game/CMakeLists.txt b/src/game/CMakeLists.txt deleted file mode 100644 index 2e28eb7c..00000000 --- a/src/game/CMakeLists.txt +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright (c) 2021 Dominic Msters -# -# This software is released under the MIT License. -# https://opensource.org/licenses/MIT - -# Definitions - -# Libraries - -# Sources -file(GLOB GAME_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/*.c) -file(GLOB GAME_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/*.h) -file(GLOB_RECURSE SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/${TARGET_GAME}/*.c) -file(GLOB_RECURSE HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/${TARGET_GAME}/*.h) - -target_sources(${PROJECT_NAME} - PRIVATE - ${GAME_SOURCES} - ${SOURCES} - ${GAME_HEADERS} - ${HEADERS} -) - -# Includes -target_include_directories(${PROJECT_NAME} - PUBLIC - ${CMAKE_CURRENT_LIST_DIR} -) \ No newline at end of file diff --git a/src/game/dawn/dawngame.c b/src/game/dawn/dawngame.c deleted file mode 100644 index 95b22983..00000000 --- a/src/game/dawn/dawngame.c +++ /dev/null @@ -1,60 +0,0 @@ -/** - * Copyright (c) 2021 Dominic Masters - * - * This software is released under the MIT License. - * https://opensource.org/licenses/MIT - */ - -#include "dawngame.h" - -shader_t shader; -primitive_t cube; -texture_t texture; -renderitem_t items[32]; -int32_t itemCount; - -void _renderTest( - renderlist_t *list, renderpass_t *pass, engine_t *engine, int32_t i -) { - shaderUsePosition(pass->shader, 0,0,0, 0,engine->time.current,0); - shaderUseTexture(pass->shader, &texture); - primitiveDraw(&cube, 0, -1); -} - -bool dawnGameInit(dawngame_t *game) { - renderListInit(&game->renderList, 512, 512); - - // assetShaderLoad(&shader, "shaders/textured.vert", "shaders/textured.frag"); - // assetTextureLoad(&texture, "test_texture.png"); - cubeInit(&cube, 1, 1, 1); - - items[itemCount++].onRender = &_renderTest; - - int32_t passNumber = renderPassAdd(&game->renderList); - renderpass_t *pass = renderListGetPass(&game->renderList, passNumber); - pass->shader = &shader; - - return true; -} - -void dawnGameUpdate(dawngame_t *game) { - camera_t camera; - - cameraPerspective(&camera, 45.0f, 512.0f/512.0f, 0.01f, 100.0f); - cameraLookAt(&camera, 3,3,3, 0,0,0); - - // Render First Pass - renderListRenderPass( - &game->renderList, &game->engine, &camera, 0, items, itemCount - ); - - // Render the list itself. - renderListRender(&game->renderList, &shader); - - // Render that to the backbuffer. - renderListAsBackbuffer(&game->renderList, &game->engine, &shader); -} - -void dawnGameDispose(dawngame_t *game) { - -} \ No newline at end of file diff --git a/src/game/game.h b/src/game/game.h deleted file mode 100644 index 8d80425c..00000000 --- a/src/game/game.h +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) 2021 Dominic Masters -// -// This software is released under the MIT License. -// https://opensource.org/licenses/MIT - -#pragma once -#if !defined(GAME_TYPE) - #error You need to define the GAME_TYPE struct -#elif !defined(GAME_INIT) - #error You need to define the GAME_INIT method -#elif !defined(GAME_UPDATE) - #error You need to define the GAME_UPDATE method -#elif !defined(GAME_DISPOSE) - #error You need to define the GAME_DISPOSE method -#elif !defined(GAME_FILE) - #error You need to define the GAME_FILE string -#endif - -#include "../libs.h" -#include "../engine/engine.h" -#include "../locale/language.h" -#include GAME_FILE - -typedef GAME_TYPE game_t; - -/** - * Initialize the game context. - * - * @return True if successful, otherwise false. - */ -bool gameInit(game_t *game); - -/** - * Tick the main game loop. - * - * @param platformDelta The platform tick delta between the last render. - * @return True if successful, false if safe exit requested.. - */ -bool gameUpdate(game_t *game, float platformDelta); - -/** - * Cleanup the game instance. - */ -void gameDispose(game_t *game); \ No newline at end of file diff --git a/src/game/poker/game.c b/src/game/poker/game.c deleted file mode 100644 index 66d4cfe4..00000000 --- a/src/game/poker/game.c +++ /dev/null @@ -1,21 +0,0 @@ -/** - * Copyright (c) 2021 Dominic Masters - * - * This software is released under the MIT License. - * https://opensource.org/licenses/MIT - */ - -#include "game.h" - -bool pokerGameInit(pokergame_t *game) { - pokerGameSceneInit(&game->gameScene, &game->engine); - return true; -} - -void pokerGameUpdate(pokergame_t *game) { - pokerGameSceneUpdate(&game->gameScene); -} - -void pokerGameDispose(pokergame_t *game) { - pokerGameSceneDispose(&game->gameScene); -} diff --git a/src/game/poker/game.h b/src/game/poker/game.h deleted file mode 100644 index 70732203..00000000 --- a/src/game/poker/game.h +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Copyright (c) 2021 Dominic Masters - * - * This software is released under the MIT License. - * https://opensource.org/licenses/MIT - */ - -#pragma once -#include "../../libs.h" -#include "../../scene/scene.h" -#include "../file/assetmanager.h" -#include "scenes/gamescene.h" - -typedef struct { - /** Game Engine Instance */ - engine_t engine; - - /** Main game scene */ - pokergamescene_t gameScene; -} pokergame_t; - -/** - * Initializes the game state for the poker game. - * - * @param game Game to initialize. - * @returns True if successful, otherwise false. - */ -bool pokerGameInit(pokergame_t *game); - -/** - * Updates the poker game instance. - * @param game Poker game to update for. - */ -void pokerGameUpdate(pokergame_t *game); - -/** - * Disposes a previously initialized poker game instance. - * @param game Game to dispose. - */ -void pokerGameDispose(pokergame_t *game); \ No newline at end of file diff --git a/src/game/poker/scenes/gamescene.c b/src/game/poker/scenes/gamescene.c deleted file mode 100644 index 0425d696..00000000 --- a/src/game/poker/scenes/gamescene.c +++ /dev/null @@ -1,113 +0,0 @@ -/** - * Copyright (c) 2021 Dominic Masters - * - * This software is released under the MIT License. - * https://opensource.org/licenses/MIT - */ - -#include "gamescene.h" - -void _pokerGameSceneLoaded(scene_t *scene) { - pokergamescene_t *gameScene; - char *uniforms[4] = { "u_View", "u_Proj", "u_Model", "u_Text" }; - - gameScene = (pokergamescene_t *)scene->user; - - - shaderGetUniformArray( - &gameScene->shaderWorld->data.shader.shader, gameScene->uniformsWorld, - uniforms, 4 - ); - shaderGetUniformArray( - &gameScene->shaderList->data.shader.shader, gameScene->uniformsList, - uniforms, 4 - ); - - gameScene->passOnly = renderPassAdd( - &scene->renderList, &gameScene->shaderWorld->data.shader.shader - ); -} - -void _pokerGameSceneRender(scene_t *scene) { - camera_t camera; - pokergamescene_t *gameScene; - renderpass_t *pass; - - gameScene = (pokergamescene_t *)scene->user; - pass = sceneUsePass(scene, gameScene->passOnly); - - // Camera - cameraPerspective(&camera, 75, - (float)pass->frame.texture.width / (float)pass->frame.texture.height, - 0.01f, 1000.0f - ); - cameraLookAt(&camera, 3,3,3, 0,0,0); - shaderUseCamera(pass->shader, - gameScene->uniformsWorld[0], gameScene->uniformsWorld[1], &camera - ); - - // Render Skywall - shaderUsePosition(pass->shader, gameScene->uniformsWorld[2], 0,0,0, 0,0,0); - shaderUseTexture(pass->shader, gameScene->uniformsWorld[3], - &gameScene->texturePub->data.scaledTexture.texture - ); - primitiveDraw(&gameScene->skywall, 0, -1); - - // Render Cube - shaderUsePosition(pass->shader, gameScene->uniformsWorld[2], - 0,0,0, scene->engine->time.current,scene->engine->time.current,0 - ); - shaderUseTexture(pass->shader, gameScene->uniformsWorld[3], - &gameScene->textureTest->data.scaledTexture.texture - ); - primitiveDraw(&gameScene->cube, 0, -1); -} - -void pokerGameSceneInit(pokergamescene_t *gameScene, engine_t *engine) { - sceneInit(&gameScene->scene, engine, (void *)gameScene); - gameScene->scene.onLoaded = &_pokerGameSceneLoaded; - gameScene->scene.onRender = &_pokerGameSceneRender; - - // Fonts - gameScene->font = assetManagerLoadFont( - &engine->assetManager, gameScene->scene.assetOwner, - "fonts/opensans/OpenSans-Bold.ttf" - ); - - // Shaders - gameScene->shaderWorld = assetManagerLoadShader( - &engine->assetManager, gameScene->scene.assetOwner, - "shaders/textured.vert", "shaders/textured.frag" - ); - - gameScene->shaderList = assetManagerLoadShader( - &engine->assetManager, gameScene->scene.assetOwner, - "shaders/singlerenderlist.vert", "shaders/singlerenderlist.frag" - ); - - // Textures - gameScene->textureTest = assetManagerLoadScaledTexture( - &engine->assetManager, gameScene->scene.assetOwner, - "textures", "test_texture", 0 - ); - - gameScene->texturePub = assetManagerLoadScaledTexture( - &engine->assetManager, gameScene->scene.assetOwner, - "poker/world", "pub", 0 - ); - - // Cube - cubeInit(&gameScene->cube, 1, 1, 1); - skywallInit(&gameScene->skywall); -} - -void pokerGameSceneUpdate(pokergamescene_t *gameScene) { - sceneUpdateToBackbuffer(&gameScene->scene, - &gameScene->shaderList->data.shader.shader, gameScene->uniformsList, - &gameScene->shaderWorld->data.shader.shader, gameScene->uniformsWorld - ); -} - -void pokerGameSceneDispose(pokergamescene_t *gameScene) { - -} \ No newline at end of file diff --git a/src/game/poker/scenes/gamescene.h b/src/game/poker/scenes/gamescene.h deleted file mode 100644 index ce4b3778..00000000 --- a/src/game/poker/scenes/gamescene.h +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Copyright (c) 2021 Dominic Masters - * - * This software is released under the MIT License. - * https://opensource.org/licenses/MIT - */ - -#pragma once -#include "../../../libs.h" -#include "../../../scene/scene.h" -#include "../../../display/primitive/primitive.h" -#include "../../../display/primitive/cube.h" -#include "../../../display/primitive/skywall.h" -#include "../../../file/assetmanager.h" - -typedef struct { - scene_t scene; - - assetmanageritem_t *font; - - uint8_t passOnly; - - assetmanageritem_t *shaderWorld; - shaderuniform_t uniformsWorld[4]; - - assetmanageritem_t *shaderList; - shaderuniform_t uniformsList[4]; - - assetmanageritem_t *textureTest; - assetmanageritem_t *texturePub; - - primitive_t cube; - primitive_t skywall; -} pokergamescene_t; - -void pokerGameSceneInit(pokergamescene_t *gameScene, engine_t *engine); - -void pokerGameSceneUpdate(pokergamescene_t *gameScene); - -void pokerGameSceneDispose(pokergamescene_t *gameScene); \ No newline at end of file diff --git a/src/game/sandbox/game.c b/src/game/sandbox/game.c deleted file mode 100644 index c77b1ac1..00000000 --- a/src/game/sandbox/game.c +++ /dev/null @@ -1,105 +0,0 @@ -/** - * Copyright (c) 2021 Dominic Masters - * - * This software is released under the MIT License. - * https://opensource.org/licenses/MIT - */ - -#include "game.h" - -bool sandboxGameInit(sandboxgame_t *game) { - uint8_t i; - - // Initialize the scene. - sceneInit(&game->scene, &game->engine); - - // Load Shader - game->shader = assetManagerLoadShader( - &game->engine.assetManager, game->scene.assetOwner, - "shaders/textured.vert", "shaders/textured.frag" - ); - game->shader2 = assetManagerLoadShader( - &game->engine.assetManager, game->scene.assetOwner, - "shaders/test.vert", "shaders/test.frag" - ); - - // Load the texture - game->scaledTexture = assetManagerLoadScaledTexture( - &game->engine.assetManager, game->scene.assetOwner, - "textures", "test_texture" - ); - game->textureScale = assetManagerLoadTextureScale( - &game->engine.assetManager, game->scene.assetOwner, - &game->scaledTexture->data.scaledTexture.scaledTexture, 0 - ); - - // quadInit(&game->quad, 0, 0,0,0,0, 1,1,1,1); - cubeInit(&game->quad, 1, 1, 1); - - i = renderPassAdd(&game->scene.renderList, &game->shader->data.shader.shader); - i = renderPassAdd(&game->scene.renderList, &game->shader->data.shader.shader); - - return true; -} - -void sandboxGameUpdate(sandboxgame_t *game) { - camera_t camera; - float n; - shader_t *shader, *shader2; - - n = assetManagerProgressGet(&game->engine.assetManager); - if(n < 1.0f) return; - - sceneRenderStart(&game->scene); - - // First pass - shader = &game->shader->data.shader.shader; - shader2 = &game->shader2->data.shader.shader; - shaderuniform_t uniView = shaderGetUniform(shader, "u_View"); - shaderuniform_t uniProj = shaderGetUniform(shader, "u_Proj"); - shaderuniform_t uniModel = shaderGetUniform(shader, "u_Modl"); - shaderuniform_t uniColor = shaderGetUniform(shader, "u_Colr"); - shaderuniform_t uniTexture = shaderGetUniform(shader, "u_Text"); - - renderpass_t *pass = renderListRenderPass( - &game->scene.renderList, &game->engine, 0 - ); - cameraPerspective(&camera, 45.0f, - game->engine.render.width/game->engine.render.height, 0.001f, 1000.0f - ); - cameraLookAt(&camera, 3,3,3, 0,0,0); - - shaderUseCamera(pass->shader, uniView, uniProj, &camera); - shaderUseColor(pass->shader, uniColor, PIXEL_COLOR_WHITE); - shaderUseTexture(pass->shader, uniTexture, &game->textureScale->data.scaleTexture.texture); - shaderUsePosition(pass->shader, uniModel, 0,0,0, - game->engine.time.current/2.0f, game->engine.time.current, 0 - ); - primitiveDraw(&game->quad, 0, -1); - - // // Second Pass - pass = renderListRenderPass(&game->scene.renderList, &game->engine, 1); - shaderUsePosition(pass->shader, uniModel, 0,0,0, - -game->engine.time.current/2.0f, -game->engine.time.current, 0 - ); - primitiveDraw(&game->quad, 0, -1); - - // Merge Shader - shaderuniform_t uniTextureSet[2]; - uniTextureSet[0] = shaderGetUniform(shader2, "u_Text0"); - uniTextureSet[1] = shaderGetUniform(shader2, "u_Text1"); - - sceneRenderEnd(&game->scene, shader2, - shaderGetUniform(shader2, "u_View"), - shaderGetUniform(shader2, "u_Proj"), - shaderGetUniform(shader2, "u_Modl"), - uniTextureSet, - shader, uniView, uniProj, uniModel, uniTexture - ); -} - -void sandboxGameDispose(sandboxgame_t *game) { - sceneDispose(&game->scene); - // assetManagerHolderRelease(&game->engine.assetManager, game->assetOwner); - // primitiveDispose(&game->quad); -} \ No newline at end of file diff --git a/src/game/sandbox/game.h b/src/game/sandbox/game.h deleted file mode 100644 index efeb907b..00000000 --- a/src/game/sandbox/game.h +++ /dev/null @@ -1,59 +0,0 @@ -/** - * Copyright (c) 2021 Dominic Masters - * - * This software is released under the MIT License. - * https://opensource.org/licenses/MIT - */ - -#pragma once -#include "../../libs.h" -#include "../../display/camera.h" -#include "../../display/font.h" -#include "../../display/shader/shader.h" -#include "../../display/primitive/primitive.h" -#include "../../display/primitive/quad.h" -#include "../../display/primitive/cube.h" -#include "../../display/scaledtexture.h" -#include "../../file/asset.h" -#include "../../ui/label.h" -#include "../../ui/breakpoint.h" -#include "../../file/assetmanager.h" -#include "../../file/xml.h" -#include "../../engine/engine.h" -#include "../../display/renderlist.h" -#include "../scene/scene.h" - -typedef struct { - engine_t engine; - scene_t scene; - primitive_t quad; - - assetmanageritem_t *shader; - assetmanageritem_t *shader2; - assetmanageritem_t *scaledTexture; - assetmanageritem_t *textureScale; -} sandboxgame_t; - -/** - * Initialize the sandbox scene test game. - * - * @param game Game to initialize. - * @param engine Engine to use during init. - * @return True if successful, otherwise false. - */ -bool sandboxGameInit(sandboxgame_t *game); - -/** - * Update a sandbox scene. - * - * @param game Game to update. - * @param engine Engine to use when updating. - */ -void sandboxGameUpdate(sandboxgame_t *game); - -/** - * Dispose a previously created scene game. - * - * @param game Game to dispose. - */ -void sandboxGameDispose(sandboxgame_t *game); \ No newline at end of file diff --git a/src/game/pokerbackup/actions/action.c b/src/pokerbackup/actions/action.c similarity index 100% rename from src/game/pokerbackup/actions/action.c rename to src/pokerbackup/actions/action.c diff --git a/src/game/pokerbackup/actions/action.h b/src/pokerbackup/actions/action.h similarity index 100% rename from src/game/pokerbackup/actions/action.h rename to src/pokerbackup/actions/action.h diff --git a/src/game/pokerbackup/actions/bet.c b/src/pokerbackup/actions/bet.c similarity index 100% rename from src/game/pokerbackup/actions/bet.c rename to src/pokerbackup/actions/bet.c diff --git a/src/game/pokerbackup/actions/bet.h b/src/pokerbackup/actions/bet.h similarity index 100% rename from src/game/pokerbackup/actions/bet.h rename to src/pokerbackup/actions/bet.h diff --git a/src/game/pokerbackup/actions/flop.c b/src/pokerbackup/actions/flop.c similarity index 100% rename from src/game/pokerbackup/actions/flop.c rename to src/pokerbackup/actions/flop.c diff --git a/src/game/pokerbackup/actions/flop.h b/src/pokerbackup/actions/flop.h similarity index 100% rename from src/game/pokerbackup/actions/flop.h rename to src/pokerbackup/actions/flop.h diff --git a/src/game/pokerbackup/actions/look.c b/src/pokerbackup/actions/look.c similarity index 100% rename from src/game/pokerbackup/actions/look.c rename to src/pokerbackup/actions/look.c diff --git a/src/game/pokerbackup/actions/look.h b/src/pokerbackup/actions/look.h similarity index 100% rename from src/game/pokerbackup/actions/look.h rename to src/pokerbackup/actions/look.h diff --git a/src/game/pokerbackup/actions/restack.c b/src/pokerbackup/actions/restack.c similarity index 100% rename from src/game/pokerbackup/actions/restack.c rename to src/pokerbackup/actions/restack.c diff --git a/src/game/pokerbackup/actions/restack.h b/src/pokerbackup/actions/restack.h similarity index 100% rename from src/game/pokerbackup/actions/restack.h rename to src/pokerbackup/actions/restack.h diff --git a/src/game/pokerbackup/actions/round.c b/src/pokerbackup/actions/round.c similarity index 100% rename from src/game/pokerbackup/actions/round.c rename to src/pokerbackup/actions/round.c diff --git a/src/game/pokerbackup/actions/round.h b/src/pokerbackup/actions/round.h similarity index 100% rename from src/game/pokerbackup/actions/round.h rename to src/pokerbackup/actions/round.h diff --git a/src/game/pokerbackup/actions/start.c b/src/pokerbackup/actions/start.c similarity index 100% rename from src/game/pokerbackup/actions/start.c rename to src/pokerbackup/actions/start.c diff --git a/src/game/pokerbackup/actions/start.h b/src/pokerbackup/actions/start.h similarity index 100% rename from src/game/pokerbackup/actions/start.h rename to src/pokerbackup/actions/start.h diff --git a/src/game/pokerbackup/actions/winner.c b/src/pokerbackup/actions/winner.c similarity index 100% rename from src/game/pokerbackup/actions/winner.c rename to src/pokerbackup/actions/winner.c diff --git a/src/game/pokerbackup/actions/winner.h b/src/pokerbackup/actions/winner.h similarity index 100% rename from src/game/pokerbackup/actions/winner.h rename to src/pokerbackup/actions/winner.h diff --git a/src/game/pokerbackup/characters/characters.c b/src/pokerbackup/characters/characters.c similarity index 100% rename from src/game/pokerbackup/characters/characters.c rename to src/pokerbackup/characters/characters.c diff --git a/src/game/pokerbackup/characters/characters.h b/src/pokerbackup/characters/characters.h similarity index 100% rename from src/game/pokerbackup/characters/characters.h rename to src/pokerbackup/characters/characters.h diff --git a/src/game/pokerbackup/characters/jenny.c b/src/pokerbackup/characters/jenny.c similarity index 100% rename from src/game/pokerbackup/characters/jenny.c rename to src/pokerbackup/characters/jenny.c diff --git a/src/game/pokerbackup/characters/jenny.h b/src/pokerbackup/characters/jenny.h similarity index 100% rename from src/game/pokerbackup/characters/jenny.h rename to src/pokerbackup/characters/jenny.h diff --git a/src/game/pokerbackup/characters/julie.c b/src/pokerbackup/characters/julie.c similarity index 100% rename from src/game/pokerbackup/characters/julie.c rename to src/pokerbackup/characters/julie.c diff --git a/src/game/pokerbackup/characters/julie.h b/src/pokerbackup/characters/julie.h similarity index 100% rename from src/game/pokerbackup/characters/julie.h rename to src/pokerbackup/characters/julie.h diff --git a/src/game/pokerbackup/characters/lucy.c b/src/pokerbackup/characters/lucy.c similarity index 100% rename from src/game/pokerbackup/characters/lucy.c rename to src/pokerbackup/characters/lucy.c diff --git a/src/game/pokerbackup/characters/lucy.h b/src/pokerbackup/characters/lucy.h similarity index 100% rename from src/game/pokerbackup/characters/lucy.h rename to src/pokerbackup/characters/lucy.h diff --git a/src/game/pokerbackup/characters/penny.c b/src/pokerbackup/characters/penny.c similarity index 100% rename from src/game/pokerbackup/characters/penny.c rename to src/pokerbackup/characters/penny.c diff --git a/src/game/pokerbackup/characters/penny.h b/src/pokerbackup/characters/penny.h similarity index 100% rename from src/game/pokerbackup/characters/penny.h rename to src/pokerbackup/characters/penny.h diff --git a/src/game/pokerbackup/characters/sammy.c b/src/pokerbackup/characters/sammy.c similarity index 100% rename from src/game/pokerbackup/characters/sammy.c rename to src/pokerbackup/characters/sammy.c diff --git a/src/game/pokerbackup/characters/sammy.h b/src/pokerbackup/characters/sammy.h similarity index 100% rename from src/game/pokerbackup/characters/sammy.h rename to src/pokerbackup/characters/sammy.h diff --git a/src/game/pokerbackup/game.c b/src/pokerbackup/game.c similarity index 100% rename from src/game/pokerbackup/game.c rename to src/pokerbackup/game.c diff --git a/src/game/pokerbackup/game.h b/src/pokerbackup/game.h similarity index 100% rename from src/game/pokerbackup/game.h rename to src/pokerbackup/game.h diff --git a/src/game/pokerbackup/pokerdiscussion.c b/src/pokerbackup/pokerdiscussion.c similarity index 100% rename from src/game/pokerbackup/pokerdiscussion.c rename to src/pokerbackup/pokerdiscussion.c diff --git a/src/game/pokerbackup/pokerdiscussion.h b/src/pokerbackup/pokerdiscussion.h similarity index 100% rename from src/game/pokerbackup/pokerdiscussion.h rename to src/pokerbackup/pokerdiscussion.h diff --git a/src/game/pokerbackup/pokergame.c b/src/pokerbackup/pokergame.c similarity index 100% rename from src/game/pokerbackup/pokergame.c rename to src/pokerbackup/pokergame.c diff --git a/src/game/pokerbackup/pokergame.h b/src/pokerbackup/pokergame.h similarity index 100% rename from src/game/pokerbackup/pokergame.h rename to src/pokerbackup/pokergame.h diff --git a/src/game/pokerbackup/pokergameaction.h b/src/pokerbackup/pokergameaction.h similarity index 100% rename from src/game/pokerbackup/pokergameaction.h rename to src/pokerbackup/pokergameaction.h diff --git a/src/game/pokerbackup/pokergameassets.c b/src/pokerbackup/pokergameassets.c similarity index 100% rename from src/game/pokerbackup/pokergameassets.c rename to src/pokerbackup/pokergameassets.c diff --git a/src/game/pokerbackup/pokergameassets.h b/src/pokerbackup/pokergameassets.h similarity index 100% rename from src/game/pokerbackup/pokergameassets.h rename to src/pokerbackup/pokergameassets.h diff --git a/src/game/pokerbackup/pokerui.c b/src/pokerbackup/pokerui.c similarity index 100% rename from src/game/pokerbackup/pokerui.c rename to src/pokerbackup/pokerui.c diff --git a/src/game/pokerbackup/pokerui.h b/src/pokerbackup/pokerui.h similarity index 100% rename from src/game/pokerbackup/pokerui.h rename to src/pokerbackup/pokerui.h diff --git a/src/game/pokerbackup/pokerworld.c b/src/pokerbackup/pokerworld.c similarity index 100% rename from src/game/pokerbackup/pokerworld.c rename to src/pokerbackup/pokerworld.c diff --git a/src/game/pokerbackup/pokerworld.h b/src/pokerbackup/pokerworld.h similarity index 100% rename from src/game/pokerbackup/pokerworld.h rename to src/pokerbackup/pokerworld.h diff --git a/src/game/game.c b/src/sandbox/game.c similarity index 65% rename from src/game/game.c rename to src/sandbox/game.c index 8e4a9f70..239c0e37 100644 --- a/src/game/game.c +++ b/src/sandbox/game.c @@ -11,16 +11,15 @@ bool gameInit(game_t *game) { // Init the engine and the rendering pipeline engineInit(&game->engine); - // Send off to the game instance - return GAME_INIT(game); + return true; } -bool gameUpdate(game_t *game, float platformDelta) { +bool gameUpdate(game_t *game, float delta) { // Let the engine do its thing. - engineUpdateStart(&game->engine, platformDelta); + engineUpdateStart(&game->engine, delta); - // Hand off to the game to update - GAME_UPDATE(game); + // + printf("All work and no play makes Dom a sad boy.\n"); // Hand back to the engine. return engineUpdateEnd(&game->engine); @@ -28,7 +27,6 @@ bool gameUpdate(game_t *game, float platformDelta) { void gameDispose(game_t *game) { // Cleanup the game - GAME_DISPOSE(game); engineDispose(&game->engine); } \ No newline at end of file diff --git a/src/game/dawn/dawngame.h b/src/sandbox/game.h similarity index 51% rename from src/game/dawn/dawngame.h rename to src/sandbox/game.h index 4975421a..a628ee10 100644 --- a/src/game/dawn/dawngame.h +++ b/src/sandbox/game.h @@ -6,20 +6,12 @@ */ #pragma once -#include "../../libs.h" -#include "../../engine/engine.h" -#include "../../display/renderlist.h" -#include "../../display/shader.h" -#include "../../display/texture.h" -#include "../../display/primitives/cube.h" -#include "../../display/primitive.h" -#include "../../file/asset.h" -#include "../../util/dynarray.h" +#include +#include typedef struct { engine_t engine; - renderlist_t renderList; -} dawngame_t; +} game_t; /** * Initializes the Dawn Game instance. @@ -27,18 +19,19 @@ typedef struct { * @param game Game to instanciate. * @return True if successful otherwise false. */ -bool dawnGameInit(dawngame_t *game); +bool gameInit(game_t *game); /** * Update the Dawn Game Instance. * * @param game Game to update. + * @param delta The delta of the game to tick by. */ -void dawnGameUpdate(dawngame_t *game); +bool gameUpdate(game_t *game, float delta); /** * Cleanup the dawn game instance. * * @param game Game to dispose. */ -void dawnGameDispose(dawngame_t *game); \ No newline at end of file +void gameDispose(game_t *game); \ No newline at end of file diff --git a/src/shaders/textured.c b/src/shaders/textured.c deleted file mode 100644 index 86395d4f..00000000 --- a/src/shaders/textured.c +++ /dev/null @@ -1,55 +0,0 @@ -/** - * Copyright (c) 2021 Dominic Masters - * - * This software is released under the MIT License. - * https://opensource.org/licenses/MIT - */ - -#include "textured.h" - -void shaderInit(shader_t *shader) { - shader->programCount = 0; - shader->varCount = 0; - - shaderSetInt32(shader, SHADER_KEY_WIDTH, 32); - shaderSetInt32(shader, SHADER_KEY_HEIGHT, 32); - - renderListInit( - &shader->renderList, - shaderGetInt32(shader, SHADER_KEY_WIDTH), - shaderGetInt32(shader, SHADER_KEY_HEIGHT) - ); -} - -// Setters -int32_t shaderSet(shader_t *shader, char *key, uint8_t type) { - int32_t i = dictionaryGetOrAdd( - shader->varNames, key, &shader->varCount, - SHADER_VARIABLE_NAME, shader->varNameBuffer - ); - shader->varTypes[i] = type; - return i; -} - -int32_t shaderSetColor(shader_t *shader, char *key, pixel_t color) { - int32_t i = shaderSet(shader, key, 0x00); - shader->varData[i].color = color; - return i; -} - -void shaderSetInt32(shader_t *shader, char *key, int32_t v) { - int32_t i = shaderSet(shader, key, SHADER_VAR_TYPE_I32); - shader->varData[i].i32 = v; - return i; -} - -// Getters -int32_t shaderGet(shader_t *shader, char *key) { - return dictionaryGetIndex(shader->varNames, key, shader->varCount); -} - -int32_t shaderGetInt32(shader_t *shader, char *key) { - int32_t i = shaderGet(shader, key); - if(i == -1) return 0; - return shader->varData[i].i32; -} \ No newline at end of file diff --git a/src/shaders/textured.h b/src/shaders/textured.h deleted file mode 100644 index e67e4c32..00000000 --- a/src/shaders/textured.h +++ /dev/null @@ -1,68 +0,0 @@ -/** - * Copyright (c) 2021 Dominic Masters - * - * This software is released under the MIT License. - * https://opensource.org/licenses/MIT - */ - -#pragma once -#include "../libs.h" -#include "../display/renderlist.h" -#include "../util/dictionary.h" - -#define SHADER_VARIABLE_COUNT 128 -#define SHADER_VARIABLE_NAME 32 -#define SHADER_PROGRAM_COUNT 8 - -#define SHADER_KEY_WIDTH "width" -#define SHADER_KEY_HEIGHT "height" - -#define SHADER_VAR_TYPE_I32 0x00 - -/** Representation of a shader uniform */ -typedef GLuint shaderuniform_t; - -typedef union { - pixel_t color; - matrix_t matrix; - int32_t i32; -} shadervariabledata_t; - -typedef struct { - /** Pointer to an uploaded vertex shader program */ - GLuint shaderVertex; - - /** Pointer to an uploaded fragment shader program */ - GLuint shaderFrag; - - /** Pointer to an uploaded shader program linked */ - GLuint shaderProgram; - - /** Buffer of chars where we store the uniform names */ - char uniformBuffer[SHADER_UNIFORM_NAME_MAX * SHADER_UNIFORM_COUNT]; - - /** Array of strings (pointers to the above buffer) of the uniform names */ - char *uniformNames[SHADER_UNIFORM_COUNT]; - int32_t uniformCount; - - /** Type of each uniform */ - GLenum types[SHADER_UNIFORM_COUNT]; - - /** Texture Slots (which texture slot for GL to use for each uniform) */ - uint8_t textureSlots[SHADER_UNIFORM_COUNT]; -} shaderprogram_t; - -typedef struct { - renderlist_t renderList; - scene_t *scene; - void *user; - - shaderprogram_t programs[SHADER_PROGRAM_COUNT]; - int32_t programCount; - - char varNameBuffer[SHADER_VARIABLE_COUNT * SHADER_VARIABLE_NAME] - shadervariabledata_t varData[SHADER_VARIABLE_COUNT]; - uint8_t varTypes[SHADER_VARIABLE_COUNT]; - char *varNames[SHADER_VARIABLE_COUNT]; - int32_t varCount; -} shader_t; \ No newline at end of file