From c277ae7aff96fa42f50383ba4479045a8be70c19 Mon Sep 17 00:00:00 2001 From: Dominic Masters Date: Sun, 22 Mar 2026 18:14:56 -0500 Subject: [PATCH] DOlphin shader prog --- cmake/targets/linux.cmake | 1 - src/duskdolphin/display/CMakeLists.txt | 3 ++- src/duskdolphin/display/shader/CMakeLists.txt | 10 ++++++++++ src/duskdolphin/display/shader/shaderdolphin.c | 11 +++++++++++ src/duskdolphin/display/shader/shaderdolphin.h | 17 +++++++++++++++++ .../display/shader/shaderplatform.h | 18 ++++++++++++++++++ .../display/shader/shaderunlitdolphin.c | 11 +++++++++++ 7 files changed, 69 insertions(+), 2 deletions(-) create mode 100644 src/duskdolphin/display/shader/CMakeLists.txt create mode 100644 src/duskdolphin/display/shader/shaderdolphin.c create mode 100644 src/duskdolphin/display/shader/shaderdolphin.h create mode 100644 src/duskdolphin/display/shader/shaderplatform.h create mode 100644 src/duskdolphin/display/shader/shaderunlitdolphin.c diff --git a/cmake/targets/linux.cmake b/cmake/targets/linux.cmake index bec0a02..f83d136 100644 --- a/cmake/targets/linux.cmake +++ b/cmake/targets/linux.cmake @@ -29,7 +29,6 @@ target_compile_definitions(${DUSK_LIBRARY_TARGET_NAME} PUBLIC DUSK_SDL2 DUSK_OPENGL DUSK_LINUX - DUSK_OPENGL_LEGACY DUSK_DISPLAY_SIZE_DYNAMIC DUSK_DISPLAY_WIDTH_DEFAULT=640 DUSK_DISPLAY_HEIGHT_DEFAULT=480 diff --git a/src/duskdolphin/display/CMakeLists.txt b/src/duskdolphin/display/CMakeLists.txt index c52ff4f..914771b 100644 --- a/src/duskdolphin/display/CMakeLists.txt +++ b/src/duskdolphin/display/CMakeLists.txt @@ -14,4 +14,5 @@ target_sources(${DUSK_LIBRARY_TARGET_NAME} add_subdirectory(camera) add_subdirectory(framebuffer) add_subdirectory(mesh) -add_subdirectory(texture) \ No newline at end of file +add_subdirectory(texture) +add_subdirectory(shader) \ No newline at end of file diff --git a/src/duskdolphin/display/shader/CMakeLists.txt b/src/duskdolphin/display/shader/CMakeLists.txt new file mode 100644 index 0000000..ac6648b --- /dev/null +++ b/src/duskdolphin/display/shader/CMakeLists.txt @@ -0,0 +1,10 @@ +# Copyright (c) 2026 Dominic Masters +# +# This software is released under the MIT License. +# https://opensource.org/licenses/MIT + +# Sources +target_sources(${DUSK_LIBRARY_TARGET_NAME} + PUBLIC + shaderdolphin.c +) \ No newline at end of file diff --git a/src/duskdolphin/display/shader/shaderdolphin.c b/src/duskdolphin/display/shader/shaderdolphin.c new file mode 100644 index 0000000..f79c390 --- /dev/null +++ b/src/duskdolphin/display/shader/shaderdolphin.c @@ -0,0 +1,11 @@ +/** + * Copyright (c) 2026 Dominic Masters + * + * This software is released under the MIT License. + * https://opensource.org/licenses/MIT + */ + +#include "shadergl.h" +#include "util/memory.h" +#include "util/string.h" +#include "display/shader/shaderunlit.h" diff --git a/src/duskdolphin/display/shader/shaderdolphin.h b/src/duskdolphin/display/shader/shaderdolphin.h new file mode 100644 index 0000000..04f1c74 --- /dev/null +++ b/src/duskdolphin/display/shader/shaderdolphin.h @@ -0,0 +1,17 @@ +/** + * Copyright (c) 2026 Dominic Masters + * + * This software is released under the MIT License. + * https://opensource.org/licenses/MIT + */ + +#pragma once +#include "error/error.h" + +typedef struct { + void *empty; +} shaderdolphin_t; + +typedef struct { + void *empty; +} shaderdefinitiondolphin_t; \ No newline at end of file diff --git a/src/duskdolphin/display/shader/shaderplatform.h b/src/duskdolphin/display/shader/shaderplatform.h new file mode 100644 index 0000000..5e7eb35 --- /dev/null +++ b/src/duskdolphin/display/shader/shaderplatform.h @@ -0,0 +1,18 @@ +/** + * Copyright (c) 2026 Dominic Masters + * + * This software is released under the MIT License. + * https://opensource.org/licenses/MIT + */ + +#pragma once +#include "shaderdolphin.h" + +typedef shaderdolphin_t shaderplatform_t; +typedef shaderdefinitiondolphin_t shaderdefinitionplatform_t; + +#define shaderInitPlatform shaderInitDolphin +#define shaderBindPlatform shaderBindDolphin +#define shaderSetMatrixPlatform shaderSetMatrixDolphin +// #define shaderSetTexturePlatform shaderSetTextureDolphin +#define shaderDisposePlatform shaderDisposeDolphin \ No newline at end of file diff --git a/src/duskdolphin/display/shader/shaderunlitdolphin.c b/src/duskdolphin/display/shader/shaderunlitdolphin.c new file mode 100644 index 0000000..c9f68fc --- /dev/null +++ b/src/duskdolphin/display/shader/shaderunlitdolphin.c @@ -0,0 +1,11 @@ +/** + * Copyright (c) 2026 Dominic Masters + * + * This software is released under the MIT License. + * https://opensource.org/licenses/MIT + */ + +#include "display/shader/shaderunlit.h" + +shaderdefinition_t SHADER_UNLIT_DEFINITION = { +}; \ No newline at end of file