From d170a64a4191f177b62601c6994ad4535abcd96b Mon Sep 17 00:00:00 2001 From: herbglitch Date: Fri, 19 Jan 2024 01:17:19 -0700 Subject: [PATCH] added some opengl files TODO: fix up using glew as optional --- CMakeLists.txt | 40 ++++--------------- cmake/archeus_glfw.cmake | 26 ++++++++++++ cmake/archeus_none.cmake | 2 +- cmake/archeus_opengl.cmake | 20 ++++++++++ .../arc/graphics/{opengl => glfw}/renderer.h | 14 ++----- .../arc/graphics/{opengl => glfw}/window.h | 6 +-- include/arc/graphics/opengl/sprite.h | 4 +- include/arc/graphics/opengl/spritesheet.h | 4 +- include/arc/graphics/opengl/text.h | 14 +++++++ include/arc/input/glfw/keyboard.h | 4 +- include/arc/input/glfw/mouse.h | 4 +- src/engine/engine.c | 16 ++++---- src/graphics/{opengl => glfw}/config.c | 6 +-- src/graphics/{opengl => glfw}/renderer.c | 19 ++++----- src/graphics/{opengl => glfw}/window.c | 4 +- src/graphics/opengl/circle.c | 10 +++++ src/graphics/opengl/line.c | 4 +- src/graphics/opengl/obround.c | 14 +++++++ src/graphics/opengl/rectangle.c | 4 +- src/graphics/opengl/sprite.c | 4 +- src/graphics/opengl/spritesheet.c | 4 +- src/graphics/opengl/text.c | 26 ++++++++++++ src/input/glfw/keyboard.c | 4 +- src/input/glfw/mouse.c | 4 +- 24 files changed, 164 insertions(+), 93 deletions(-) create mode 100644 cmake/archeus_glfw.cmake rename include/arc/graphics/{opengl => glfw}/renderer.h (70%) rename include/arc/graphics/{opengl => glfw}/window.h (86%) create mode 100644 include/arc/graphics/opengl/text.h rename src/graphics/{opengl => glfw}/config.c (66%) rename src/graphics/{opengl => glfw}/renderer.c (84%) rename src/graphics/{opengl => glfw}/window.c (94%) create mode 100644 src/graphics/opengl/circle.c create mode 100644 src/graphics/opengl/obround.c create mode 100644 src/graphics/opengl/text.c diff --git a/CMakeLists.txt b/CMakeLists.txt index cc61735..225a536 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -72,43 +72,19 @@ include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/archeus_sdl2.cmake) sdl2_check_and_init_needed(ARCHEUS_STD_FLAGS ARCHEUS_STD_SOURCES ${ARCHEUS_STD_WINDOW_BACKEND} ${ARCHEUS_STD_INPUT_BACKEND} ${ARCHEUS_STD_GRAPHICS_BACKEND}) # ~ OPENGL ~ # -if(ARCHEUS_STD_GRAPHICS_BACKEND STREQUAL OPENGL) - string(APPEND ARCHEUS_STD_FLAGS "-DARC_OPENGL ") -endif() +include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/archeus_opengl.cmake) +opengl_check_and_init_needed(ARCHEUS_STD_FLAGS ARCHEUS_STD_SOURCES ${ARCHEUS_STD_GRAPHICS_BACKEND}) -if(ARCHEUS_STD_GLFW) - string(APPEND ARCHEUS_STD_FLAGS "-DARC_GLFW ") -endif() +# ~ GLFW ~ # +include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/archeus_glfw.cmake) +glfw_check_and_init_needed(ARCHEUS_STD_FLAGS ARCHEUS_STD_SOURCES ${ARCHEUS_STD_WINDOW_BACKEND} ${ARCHEUS_STD_INPUT_BACKEND}) -if(ARCHEUS_STD_GLEW) - string(APPEND ARCHEUS_STD_FLAGS "-DARC_GLEW ") -endif() +#if(ARCHEUS_STD_GLEW) +# string(APPEND ARCHEUS_STD_FLAGS "-DARC_GLEW ") +#endif() set(CMAKE_C_FLAGS ${ARCHEUS_STD_FLAGS}) -set(ARCHEUS_STD_OPENGL_SOURCES - src/graphics/opengl/config.c - src/graphics/opengl/line.c - src/graphics/opengl/rectangle.c - src/graphics/opengl/renderer.c - src/graphics/opengl/sprite.c - src/graphics/opengl/spritesheet.c - src/graphics/opengl/window.c -) - -set(ARCHEUS_STD_GLFW_SOURCES - src/input/glfw/keyboard.c - src/input/glfw/mouse.c -) - -if(ARCHEUS_STD_OPENGL) - list(APPEND ARCHEUS_STD_SOURCES ${ARCHEUS_STD_OPENGL_SOURCES}) -endif() - -if(ARCHEUS_STD_GLFW) - list(APPEND ARCHEUS_STD_SOURCES ${ARCHEUS_STD_GLFW_SOURCES}) -endif() - if(WIN32 AND NOT MSVC) add_library(archeus_std STATIC ${ARCHEUS_STD_SOURCES}) else() diff --git a/cmake/archeus_glfw.cmake b/cmake/archeus_glfw.cmake new file mode 100644 index 0000000..909eb55 --- /dev/null +++ b/cmake/archeus_glfw.cmake @@ -0,0 +1,26 @@ +set(ARCHEUS_STD_GLFW_WINDOW_SOURCES + src/graphics/glfw/config.c + src/graphics/glfw/renderer.c + src/graphics/glfw/window.c +) + +set(ARCHEUS_STD_GLFW_INPUT_SOURCES + src/input/glfw/keyboard.c + src/input/glfw/mouse.c +) + +function(glfw_check_and_init_needed _ARCHEUS_STD_FLAGS _ARCHEUS_STD_SOURCES ARCHEUS_STD_WINDOW_BACKEND ARCHEUS_STD_INPUT_BACKEND) + #add matching files for the selected backends + if(${ARCHEUS_STD_WINDOW_BACKEND} STREQUAL "GLFW") + string(APPEND ${_ARCHEUS_STD_FLAGS} "-lglfw -DARC_GLFW_WINDOW ") + list(APPEND ${_ARCHEUS_STD_SOURCES} ${ARCHEUS_STD_GLFW_WINDOW_SOURCES}) + endif() + + if(${ARCHEUS_STD_INPUT_BACKEND} STREQUAL "GLFW") + string(APPEND ${_ARCHEUS_STD_FLAGS} "-lglfw -lGLEW -DARC_GLFW_INPUT ") + list(APPEND ${_ARCHEUS_STD_SOURCES} ${ARCHEUS_STD_GLFW_INPUT_SOURCES}) + endif() + + set(${_ARCHEUS_STD_FLAGS} ${${_ARCHEUS_STD_FLAGS}} PARENT_SCOPE) + set(${_ARCHEUS_STD_SOURCES} ${${_ARCHEUS_STD_SOURCES}} PARENT_SCOPE) +endfunction() \ No newline at end of file diff --git a/cmake/archeus_none.cmake b/cmake/archeus_none.cmake index a651a73..6617778 100644 --- a/cmake/archeus_none.cmake +++ b/cmake/archeus_none.cmake @@ -1,4 +1,5 @@ set(ARCHEUS_STD_NONE_WINDOW_SOURCES + src/graphics/none/window.c ) set(ARCHEUS_STD_NONE_INPUT_SOURCES @@ -16,7 +17,6 @@ set(ARCHEUS_STD_NONE_GRAPHICS_SOURCES src/graphics/none/sprite.c src/graphics/none/spritesheet.c src/graphics/none/text.c - src/graphics/none/window.c ) function(none_check_and_init_needed _ARCHEUS_STD_FLAGS _ARCHEUS_STD_SOURCES ARCHEUS_STD_WINDOW_BACKEND ARCHEUS_STD_INPUT_BACKEND ARCHEUS_STD_GRAPHICS_BACKEND) diff --git a/cmake/archeus_opengl.cmake b/cmake/archeus_opengl.cmake index e69de29..37ee242 100644 --- a/cmake/archeus_opengl.cmake +++ b/cmake/archeus_opengl.cmake @@ -0,0 +1,20 @@ +set(ARCHEUS_STD_OPENGL_GRAPHICS_SOURCES + src/graphics/opengl/circle.c + src/graphics/opengl/line.c + src/graphics/opengl/obround.c + src/graphics/opengl/rectangle.c + src/graphics/opengl/sprite.c + src/graphics/opengl/spritesheet.c + src/graphics/opengl/text.c +) + +function(opengl_check_and_init_needed _ARCHEUS_STD_FLAGS _ARCHEUS_STD_SOURCES ARCHEUS_STD_GRAPHICS_BACKEND) + #add matching files for the selected backends + if(${ARCHEUS_STD_GRAPHICS_BACKEND} STREQUAL "OPENGL") + string(APPEND ${_ARCHEUS_STD_FLAGS} "-lGL -DARC_OPENGL_GRAPHICS ") + list(APPEND ${_ARCHEUS_STD_SOURCES} ${ARCHEUS_STD_OPENGL_GRAPHICS_SOURCES}) + endif() + + set(${_ARCHEUS_STD_FLAGS} ${${_ARCHEUS_STD_FLAGS}} PARENT_SCOPE) + set(${_ARCHEUS_STD_SOURCES} ${${_ARCHEUS_STD_SOURCES}} PARENT_SCOPE) +endfunction() \ No newline at end of file diff --git a/include/arc/graphics/opengl/renderer.h b/include/arc/graphics/glfw/renderer.h similarity index 70% rename from include/arc/graphics/opengl/renderer.h rename to include/arc/graphics/glfw/renderer.h index 8a259e5..36cfc3e 100644 --- a/include/arc/graphics/opengl/renderer.h +++ b/include/arc/graphics/glfw/renderer.h @@ -1,27 +1,21 @@ #ifndef ARC_OPENGL_RENDERER_H_ #define ARC_OPENGL_RENDERER_H_ -#ifdef ARC_OPENGL - -#ifdef ARC_GLEW #define GLEW_STATIC #include -#endif // !ARC_GLEW -#ifdef ARC_GLFW +#ifdef ARC_GLFW_WINDOW #include -#endif #include "arc/graphics/renderer.h" #include "arc/graphics/window.h" -#ifdef ARC_GLFW typedef struct ARC_RendererType { GLFWwindow *window; } ARC_RendererType; /** - * @brief struct for info needed to create opengl renderer + * @brief struct for info needed to create glfw renderer * * @note this is what needs to be passed into the data parameter for ARC_Renderer_Create */ @@ -29,8 +23,6 @@ struct ARC_RenderInfo { GLFWwindow *window; }; -#endif // !ARC_GLFW - -#endif // !ARC_OPENGL +#endif // !ARC_GLFW_WINDOW #endif // !ARC_OPENGL_RENDERER_H_ diff --git a/include/arc/graphics/opengl/window.h b/include/arc/graphics/glfw/window.h similarity index 86% rename from include/arc/graphics/opengl/window.h rename to include/arc/graphics/glfw/window.h index 5ce0a73..471eef3 100644 --- a/include/arc/graphics/opengl/window.h +++ b/include/arc/graphics/glfw/window.h @@ -1,12 +1,10 @@ #ifndef ARC_OPENGL_WINDOW_H_ #define ARC_OPENGL_WINDOW_H_ -#ifdef ARC_GLFW +#ifdef ARC_GLFW_WINDOW -#ifdef ARC_GLEW #define GLEW_STATIC #include -#endif // !ARC_GLEW #include "arc/graphics/window.h" #include @@ -24,6 +22,6 @@ struct ARC_WindowInfo { int h; }; -#endif // !ARC_GLFW +#endif // !ARC_GLFW_WINDOW #endif // !ARC_GLFW_WINDOW_H_ diff --git a/include/arc/graphics/opengl/sprite.h b/include/arc/graphics/opengl/sprite.h index 40f4fe9..8895174 100644 --- a/include/arc/graphics/opengl/sprite.h +++ b/include/arc/graphics/opengl/sprite.h @@ -1,13 +1,13 @@ #ifndef ARC_OPENGL_SPRITE_H_ #define ARC_OPENGL_SPRITE_H_ -#ifdef ARC_OPENGL +#ifdef ARC_OPENGL_GRAPHICS #include "arc/graphics/sprite.h" struct ARC_Sprite { }; -#endif // !ARC_OPENGL +#endif // !ARC_OPENGL_GRAPHICS #endif // !ARC_OPENGL_SPRITE_H_ diff --git a/include/arc/graphics/opengl/spritesheet.h b/include/arc/graphics/opengl/spritesheet.h index e523a82..a320d8c 100644 --- a/include/arc/graphics/opengl/spritesheet.h +++ b/include/arc/graphics/opengl/spritesheet.h @@ -1,13 +1,13 @@ #ifndef ARC_OPENGL_SPRITESHEET_H_ #define ARC_OPENGL_SPRITESHEET_H_ -#ifdef ARC_OPENGL +#ifdef ARC_OPENGL_GRAPHICS #include "arc/graphics/spritesheet.h" struct ARC_Spritesheet { }; -#endif // !ARC_OPENGL +#endif // !ARC_OPENGL_GRAPHICS #endif // !ARC_OPENGL_SPRITESHEET_H_ diff --git a/include/arc/graphics/opengl/text.h b/include/arc/graphics/opengl/text.h new file mode 100644 index 0000000..526b4ce --- /dev/null +++ b/include/arc/graphics/opengl/text.h @@ -0,0 +1,14 @@ +#ifndef ARC_OPENGL_TEXT_H_ +#define ARC_OPENGL_TEXT_H_ + +#include "arc/std/string.h" +#include "arc/graphics/color.h" +#include "arc/math/rectangle.h" + +#ifdef ARC_OPENGL_GRAPHICS + +typedef struct ARC_Text {} ARC_Text; + +#endif // !ARC_OPENGL_GRAPHICS + +#endif // !ARC_OPENGL_TEXT_H_ diff --git a/include/arc/input/glfw/keyboard.h b/include/arc/input/glfw/keyboard.h index 932e0b7..451fb65 100644 --- a/include/arc/input/glfw/keyboard.h +++ b/include/arc/input/glfw/keyboard.h @@ -1,7 +1,7 @@ #ifndef ARC_GLFW_KEYBOARD_H_ #define ARC_GLFW_KEYBOARD_H_ -#ifdef ARC_GLFW +#ifdef ARC_GLFW_INPUT #include #include "arc/input/keyboard.h" @@ -16,6 +16,6 @@ struct ARC_KeyboardInfo { GLFWwindow *window; }; -#endif // !ARC_GLFW +#endif // !ARC_GLFW_INPUT #endif // !ARC_GLFW_KEYBOARD_H_ \ No newline at end of file diff --git a/include/arc/input/glfw/mouse.h b/include/arc/input/glfw/mouse.h index f013894..281ae00 100644 --- a/include/arc/input/glfw/mouse.h +++ b/include/arc/input/glfw/mouse.h @@ -1,7 +1,7 @@ #ifndef ARC_GLFW_MOUSE_H_ #define ARC_GLFW_MOUSE_H_ -#ifdef ARC_GLFW +#ifdef ARC_GLFW_INPUT #include #include "arc/input/mouse.h" #include "arc/math/point.h" @@ -20,6 +20,6 @@ struct ARC_MouseInfo { GLFWwindow *window; }; -#endif // !ARC_GLFW +#endif // !ARC_GLFW_INPUT #endif // !ARC_GLFW_MOUSE_H_ \ No newline at end of file diff --git a/src/engine/engine.c b/src/engine/engine.c index 2452ce8..89f3b82 100644 --- a/src/engine/engine.c +++ b/src/engine/engine.c @@ -22,14 +22,12 @@ #include #include #include -#elif ARC_OPENGL -#include "arc/graphics/opengl/window.h" -#include "arc/graphics/opengl/renderer.h" -#ifdef ARC_GLFW +#endif + +#include "arc/graphics/glfw/window.h" +#include "arc/graphics/glfw/renderer.h" #include "arc/input/glfw/mouse.h" #include "arc/input/glfw/keyboard.h" -#endif // ARC_GLFW -#endif void ARC_EngineData_Create(ARC_EngineData **data, ARC_Handler_CleanDataFn cleanfn, ARC_Point windowSize){ *data = (ARC_EngineData *)malloc(sizeof(ARC_EngineData)); @@ -52,7 +50,7 @@ void ARC_EngineData_Create(ARC_EngineData **data, ARC_Handler_CleanDataFn cleanf #ifdef ARC_SDL windowInfo = (ARC_WindowInfo){ "title", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, (*data)->windowSize.x, (*data)->windowSize.y, 0 }; -#elif ARC_GLFW +#elif ARC_GLFW_WINDOW windowInfo = (ARC_WindowInfo){ "title", (*data)->windowSize.x, (*data)->windowSize.y }; #endif // ARC_SDL @@ -64,7 +62,7 @@ void ARC_EngineData_Create(ARC_EngineData **data, ARC_Handler_CleanDataFn cleanf #ifdef ARC_SDL renderInfo = (ARC_RenderInfo){ (SDL_Window *)(*data)->window, -1, SDL_RENDERER_ACCELERATED }; -#elif ARC_GLFW +#elif ARC_GLFW_WINDOW renderInfo = (ARC_RenderInfo){ (GLFWwindow *)(*data)->window }; #endif // ARC_SDL @@ -122,7 +120,7 @@ void ARC_Engine_Run(ARC_EngineData *data){ SDL_PollEvent(data->mouse->event); if(event->type == SDL_QUIT){ data->running = 1; } -#elif ARC_GLFW +#elif ARC_GLFW_WINDOW glfwPollEvents(); data->running = glfwWindowShouldClose((GLFWwindow *)data->window); #endif // ARC_SDL diff --git a/src/graphics/opengl/config.c b/src/graphics/glfw/config.c similarity index 66% rename from src/graphics/opengl/config.c rename to src/graphics/glfw/config.c index 2cf1ad8..b2a138b 100644 --- a/src/graphics/opengl/config.c +++ b/src/graphics/glfw/config.c @@ -1,14 +1,14 @@ -#ifdef ARC_OPENGL +#ifdef ARC_GLFW_WINDOW #include #include "arc/std/config.h" #include "arc/std/string.h" #include "arc/std/errno.h" -#include "arc/graphics/opengl/renderer.h" +#include "arc/graphics/glfw/renderer.h" void ARC_GraphicsConfig_Init(ARC_Config *config, ARC_Renderer *renderer){ } -#endif // ARC_OPENGL \ No newline at end of file +#endif // ARC_OPENGL_GRAPHICS \ No newline at end of file diff --git a/src/graphics/opengl/renderer.c b/src/graphics/glfw/renderer.c similarity index 84% rename from src/graphics/opengl/renderer.c rename to src/graphics/glfw/renderer.c index bec8808..1906fb7 100644 --- a/src/graphics/opengl/renderer.c +++ b/src/graphics/glfw/renderer.c @@ -1,15 +1,13 @@ -#ifdef ARC_OPENGL +#ifdef ARC_GLFW_WINDOW #include "arc/graphics/renderer.h" -#include "arc/graphics/opengl/renderer.h" +#include "arc/graphics/glfw/renderer.h" -#ifdef ARC_GLEW +// #ifdef ARC_GLEW #define GLEW_STATIC #include -#endif // ARC_GLEW +// #endif // ARC_GLEW -#ifdef ARC_GLFW #include -#endif #include "arc/graphics/window.h" #include "arc/std/errno.h" @@ -22,18 +20,17 @@ void ARC_Renderer_Create(ARC_Renderer **renderer, ARC_RenderInfo *info){ return; } -#ifdef ARC_GLFW +// #ifdef ARC_GLEW *renderer = (ARC_Renderer *)malloc(sizeof(ARC_Renderer)); (*renderer)->window = info->window; - glewExperimental = GL_TRUE; if(glewInit() != GLEW_OK){ ARC_DEBUG_ERR("ARC_Renderer_Create(**renderer, info), GLEW failed to init"); glfwTerminate(); arc_errno = ARC_ERRNO_INIT; } -#endif // ARC_GLEW +// #endif // ARC_GLEW glClearColor(0.23f, 0.38f, 0.47f, 1.0f); } @@ -47,9 +44,9 @@ void ARC_Renderer_Clear(ARC_Renderer *renderer){ } void ARC_Renderer_Render(ARC_Renderer *renderer){ -#ifdef ARC_GLFW +// #ifdef ARC_GLEW glfwSwapBuffers(renderer->window); -#endif // ARC_GLEW +// #endif // ARC_GLEW } #endif //ARC_SDL diff --git a/src/graphics/opengl/window.c b/src/graphics/glfw/window.c similarity index 94% rename from src/graphics/opengl/window.c rename to src/graphics/glfw/window.c index 68e165a..f40a10b 100644 --- a/src/graphics/opengl/window.c +++ b/src/graphics/glfw/window.c @@ -1,6 +1,6 @@ -#ifdef ARC_GLFW +#ifdef ARC_GLFW_WINDOW #include "arc/graphics/window.h" -#include "arc/graphics/opengl/window.h" +#include "arc/graphics/glfw/window.h" #include "arc/std/errno.h" #include diff --git a/src/graphics/opengl/circle.c b/src/graphics/opengl/circle.c new file mode 100644 index 0000000..c6dee14 --- /dev/null +++ b/src/graphics/opengl/circle.c @@ -0,0 +1,10 @@ +#ifdef ARC_OPENGL_GRAPHICS + +#include "arc/graphics/circle.h" +#include + +void ARC_Circle_Render(ARC_Circle *circle, ARC_Renderer *renderer, ARC_Color *color){ + printf("OpenGL Backend Selected\n"); +} + +#endif // !ARC_OPENGL_GRAPHICS \ No newline at end of file diff --git a/src/graphics/opengl/line.c b/src/graphics/opengl/line.c index dba479a..d617d6c 100644 --- a/src/graphics/opengl/line.c +++ b/src/graphics/opengl/line.c @@ -1,8 +1,8 @@ -#ifdef ARC_OPENGL +#ifdef ARC_OPENGL_GRAPHICS #include "arc/graphics/line.h" #include void ARC_Line_Render(int32_t *x1, int32_t *y1, int32_t *x2, int32_t *y2, ARC_Renderer *renderer, ARC_Color *color){ } -#endif // ARC_OPENGL \ No newline at end of file +#endif // ARC_OPENGL_GRAPHICS \ No newline at end of file diff --git a/src/graphics/opengl/obround.c b/src/graphics/opengl/obround.c new file mode 100644 index 0000000..b28a16d --- /dev/null +++ b/src/graphics/opengl/obround.c @@ -0,0 +1,14 @@ +#ifdef ARC_OPENGL_GRAPHICS + +#include "arc/graphics/obround.h" +#include + +void ARC_Obround_Render(ARC_Obround *obround, ARC_Renderer *renderer, ARC_Color *color){ + printf("OpenGL Backend Selected\n"); +} + +void ARC_FObround_Render(ARC_FObround *obround, ARC_Renderer *renderer, ARC_Color *color){ + printf("OpenGL Backend Selected\n"); +} + +#endif // ARC_OPENGL_GRAPHICS \ No newline at end of file diff --git a/src/graphics/opengl/rectangle.c b/src/graphics/opengl/rectangle.c index 2a6e4c8..bca8f6f 100644 --- a/src/graphics/opengl/rectangle.c +++ b/src/graphics/opengl/rectangle.c @@ -1,4 +1,4 @@ -#ifdef ARC_OPENGL +#ifdef ARC_OPENGL_GRAPHICS #include "arc/graphics/rectangle.h" #include @@ -8,4 +8,4 @@ void ARC_Rect_Render(ARC_Rect *rect, ARC_Renderer *renderer, ARC_Color *color){ void ARC_Rect_RenderFill(ARC_Rect *rect, ARC_Renderer *renderer, ARC_Color *color){ } -#endif // ARC_OPENGL \ No newline at end of file +#endif // ARC_OPENGL_GRAPHICS \ No newline at end of file diff --git a/src/graphics/opengl/sprite.c b/src/graphics/opengl/sprite.c index 64d3b88..3507c60 100644 --- a/src/graphics/opengl/sprite.c +++ b/src/graphics/opengl/sprite.c @@ -1,4 +1,4 @@ -#ifdef ARC_OPENGL +#ifdef ARC_OPENGL_GRAPHICS #include "arc/graphics/sprite.h" #include "arc/math/point.h" #include "arc/math/rectangle.h" @@ -26,4 +26,4 @@ ARC_Rect *ARC_Sprite_GetBounds(ARC_Sprite *sprite){ return NULL; } -#endif // ARC_OPENGL \ No newline at end of file +#endif // ARC_OPENGL_GRAPHICS \ No newline at end of file diff --git a/src/graphics/opengl/spritesheet.c b/src/graphics/opengl/spritesheet.c index a477045..20513ac 100644 --- a/src/graphics/opengl/spritesheet.c +++ b/src/graphics/opengl/spritesheet.c @@ -1,4 +1,4 @@ -#ifdef ARC_OPENGL +#ifdef ARC_OPENGL_GRAPHICS #include "arc/graphics/spritesheet.h" #include "arc/math/point.h" #include @@ -14,4 +14,4 @@ uint32_t *ARC_Spritesheet_GetTileSize(ARC_Spritesheet *spritesheet){ return NULL; } -#endif // ARC_OPENGL \ No newline at end of file +#endif // ARC_OPENGL_GRAPHICS \ No newline at end of file diff --git a/src/graphics/opengl/text.c b/src/graphics/opengl/text.c new file mode 100644 index 0000000..f5a2284 --- /dev/null +++ b/src/graphics/opengl/text.c @@ -0,0 +1,26 @@ +#ifdef ARC_OPENGL_GRAPHICS + +#include "arc/graphics/text.h" +#include + +void ARC_Text_Create(ARC_Text **text, ARC_String *path, int32_t size, ARC_Color color){ + printf("OpenGL Backend Selected\n"); +} + +void ARC_Text_Destroy(ARC_Text *font){ + printf("OpenGL Backend Selected\n"); +} + +void ARC_Text_SetString(ARC_Text *text, ARC_Renderer *renderer, ARC_String *string){ + printf("OpenGL Backend Selected\n"); +} + +void ARC_Text_Render(ARC_Text *text, ARC_Renderer *renderer){ + printf("OpenGL Backend Selected\n"); +} + +void ARC_Text_SetPos(ARC_Text *text, ARC_Point pos){ + printf("OpenGL Backend Selected\n"); +} + +#endif // !ARC_OPENGL_GRAPHICS \ No newline at end of file diff --git a/src/input/glfw/keyboard.c b/src/input/glfw/keyboard.c index 5ee81b6..30ca4f2 100644 --- a/src/input/glfw/keyboard.c +++ b/src/input/glfw/keyboard.c @@ -1,4 +1,4 @@ -#ifdef ARC_GLFW +#ifdef ARC_GLFW_INPUT #include "arc/input/glfw/keyboard.h" #include "arc/input/keyboard.h" #include "arc/math/point.h" @@ -19,4 +19,4 @@ ARC_KeyboardState ARC_Keyboard_GetState(ARC_Keyboard *keyboard, enum ARC_Keyboar return ARC_KEY_NONE; } -#endif // ARC_GLFW \ No newline at end of file +#endif // ARC_GLFW_INPUT \ No newline at end of file diff --git a/src/input/glfw/mouse.c b/src/input/glfw/mouse.c index 129db7e..f442958 100644 --- a/src/input/glfw/mouse.c +++ b/src/input/glfw/mouse.c @@ -1,4 +1,4 @@ -#ifdef ARC_GLFW +#ifdef ARC_GLFW_INPUT #include "arc/input/glfw/mouse.h" #include "arc/input/mouse.h" #include "arc/math/point.h" @@ -30,4 +30,4 @@ int32_t *ARC_Mouse_GetScrollY(ARC_Mouse *mouse){ return mouse->scrollY; } -#endif // ARC_SDL \ No newline at end of file +#endif // ARC_SDL_INPUT \ No newline at end of file