This commit is contained in:
herbglitch 2024-02-08 16:58:56 -07:00
commit 0625a9c825
24 changed files with 174 additions and 106 deletions

View file

@ -73,43 +73,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}) sdl2_check_and_init_needed(ARCHEUS_STD_FLAGS ARCHEUS_STD_SOURCES ${ARCHEUS_STD_WINDOW_BACKEND} ${ARCHEUS_STD_INPUT_BACKEND} ${ARCHEUS_STD_GRAPHICS_BACKEND})
# ~ OPENGL ~ # # ~ OPENGL ~ #
if(ARCHEUS_STD_GRAPHICS_BACKEND STREQUAL OPENGL) include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/archeus_opengl.cmake)
string(APPEND ARCHEUS_STD_FLAGS "-DARC_OPENGL ") opengl_check_and_init_needed(ARCHEUS_STD_FLAGS ARCHEUS_STD_SOURCES ${ARCHEUS_STD_GRAPHICS_BACKEND})
endif()
if(ARCHEUS_STD_GLFW) # ~ GLFW ~ #
string(APPEND ARCHEUS_STD_FLAGS "-DARC_GLFW ") include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/archeus_glfw.cmake)
endif() glfw_check_and_init_needed(ARCHEUS_STD_FLAGS ARCHEUS_STD_SOURCES ${ARCHEUS_STD_WINDOW_BACKEND} ${ARCHEUS_STD_INPUT_BACKEND})
if(ARCHEUS_STD_GLEW) #if(ARCHEUS_STD_GLEW)
string(APPEND ARCHEUS_STD_FLAGS "-DARC_GLEW ") # string(APPEND ARCHEUS_STD_FLAGS "-DARC_GLEW ")
endif() #endif()
set(CMAKE_C_FLAGS ${ARCHEUS_STD_FLAGS}) 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) if(WIN32 AND NOT MSVC)
add_library(archeus_std STATIC ${ARCHEUS_STD_SOURCES}) add_library(archeus_std STATIC ${ARCHEUS_STD_SOURCES})
else() else()

26
cmake/archeus_glfw.cmake Normal file
View file

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

View file

@ -1,4 +1,5 @@
set(ARCHEUS_STD_NONE_WINDOW_SOURCES set(ARCHEUS_STD_NONE_WINDOW_SOURCES
src/graphics/none/window.c
) )
set(ARCHEUS_STD_NONE_INPUT_SOURCES set(ARCHEUS_STD_NONE_INPUT_SOURCES
@ -16,7 +17,6 @@ set(ARCHEUS_STD_NONE_GRAPHICS_SOURCES
src/graphics/none/sprite.c src/graphics/none/sprite.c
src/graphics/none/spritesheet.c src/graphics/none/spritesheet.c
src/graphics/none/text.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) function(none_check_and_init_needed _ARCHEUS_STD_FLAGS _ARCHEUS_STD_SOURCES ARCHEUS_STD_WINDOW_BACKEND ARCHEUS_STD_INPUT_BACKEND ARCHEUS_STD_GRAPHICS_BACKEND)

View file

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

View file

@ -1,27 +1,21 @@
#ifndef ARC_OPENGL_RENDERER_H_ #ifndef ARC_OPENGL_RENDERER_H_
#define ARC_OPENGL_RENDERER_H_ #define ARC_OPENGL_RENDERER_H_
#ifdef ARC_OPENGL
#ifdef ARC_GLEW
#define GLEW_STATIC #define GLEW_STATIC
#include <GL/glew.h> #include <GL/glew.h>
#endif // !ARC_GLEW
#ifdef ARC_GLFW #ifdef ARC_GLFW_WINDOW
#include <GLFW/glfw3.h> #include <GLFW/glfw3.h>
#endif
#include "arc/graphics/renderer.h" #include "arc/graphics/renderer.h"
#include "arc/graphics/window.h" #include "arc/graphics/window.h"
#ifdef ARC_GLFW
typedef struct ARC_RendererType { typedef struct ARC_RendererType {
GLFWwindow *window; GLFWwindow *window;
} ARC_RendererType; } 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 * @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; GLFWwindow *window;
}; };
#endif // !ARC_GLFW #endif // !ARC_GLFW_WINDOW
#endif // !ARC_OPENGL
#endif // !ARC_OPENGL_RENDERER_H_ #endif // !ARC_OPENGL_RENDERER_H_

View file

@ -1,12 +1,10 @@
#ifndef ARC_OPENGL_WINDOW_H_ #ifndef ARC_OPENGL_WINDOW_H_
#define ARC_OPENGL_WINDOW_H_ #define ARC_OPENGL_WINDOW_H_
#ifdef ARC_GLFW #ifdef ARC_GLFW_WINDOW
#ifdef ARC_GLEW
#define GLEW_STATIC #define GLEW_STATIC
#include <GL/glew.h> #include <GL/glew.h>
#endif // !ARC_GLEW
#include "arc/graphics/window.h" #include "arc/graphics/window.h"
#include <GLFW/glfw3.h> #include <GLFW/glfw3.h>
@ -24,6 +22,6 @@ struct ARC_WindowInfo {
int h; int h;
}; };
#endif // !ARC_GLFW #endif // !ARC_GLFW_WINDOW
#endif // !ARC_GLFW_WINDOW_H_ #endif // !ARC_GLFW_WINDOW_H_

View file

@ -1,13 +1,13 @@
#ifndef ARC_OPENGL_SPRITE_H_ #ifndef ARC_OPENGL_SPRITE_H_
#define ARC_OPENGL_SPRITE_H_ #define ARC_OPENGL_SPRITE_H_
#ifdef ARC_OPENGL #ifdef ARC_OPENGL_GRAPHICS
#include "arc/graphics/sprite.h" #include "arc/graphics/sprite.h"
struct ARC_Sprite { struct ARC_Sprite {
}; };
#endif // !ARC_OPENGL #endif // !ARC_OPENGL_GRAPHICS
#endif // !ARC_OPENGL_SPRITE_H_ #endif // !ARC_OPENGL_SPRITE_H_

View file

@ -1,13 +1,13 @@
#ifndef ARC_OPENGL_SPRITESHEET_H_ #ifndef ARC_OPENGL_SPRITESHEET_H_
#define ARC_OPENGL_SPRITESHEET_H_ #define ARC_OPENGL_SPRITESHEET_H_
#ifdef ARC_OPENGL #ifdef ARC_OPENGL_GRAPHICS
#include "arc/graphics/spritesheet.h" #include "arc/graphics/spritesheet.h"
struct ARC_Spritesheet { struct ARC_Spritesheet {
}; };
#endif // !ARC_OPENGL #endif // !ARC_OPENGL_GRAPHICS
#endif // !ARC_OPENGL_SPRITESHEET_H_ #endif // !ARC_OPENGL_SPRITESHEET_H_

View file

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

View file

@ -1,7 +1,7 @@
#ifndef ARC_GLFW_KEYBOARD_H_ #ifndef ARC_GLFW_KEYBOARD_H_
#define ARC_GLFW_KEYBOARD_H_ #define ARC_GLFW_KEYBOARD_H_
#ifdef ARC_GLFW #ifdef ARC_GLFW_INPUT
#include <GLFW/glfw3.h> #include <GLFW/glfw3.h>
#include "arc/input/keyboard.h" #include "arc/input/keyboard.h"
@ -16,6 +16,6 @@ struct ARC_KeyboardInfo {
GLFWwindow *window; GLFWwindow *window;
}; };
#endif // !ARC_GLFW #endif // !ARC_GLFW_INPUT
#endif // !ARC_GLFW_KEYBOARD_H_ #endif // !ARC_GLFW_KEYBOARD_H_

View file

@ -1,7 +1,7 @@
#ifndef ARC_GLFW_MOUSE_H_ #ifndef ARC_GLFW_MOUSE_H_
#define ARC_GLFW_MOUSE_H_ #define ARC_GLFW_MOUSE_H_
#ifdef ARC_GLFW #ifdef ARC_GLFW_INPUT
#include <GLFW/glfw3.h> #include <GLFW/glfw3.h>
#include "arc/input/mouse.h" #include "arc/input/mouse.h"
#include "arc/math/point.h" #include "arc/math/point.h"
@ -20,6 +20,6 @@ struct ARC_MouseInfo {
GLFWwindow *window; GLFWwindow *window;
}; };
#endif // !ARC_GLFW #endif // !ARC_GLFW_INPUT
#endif // !ARC_GLFW_MOUSE_H_ #endif // !ARC_GLFW_MOUSE_H_

View file

@ -18,15 +18,11 @@
#include "arc/graphics/sdl/renderer.h" #include "arc/graphics/sdl/renderer.h"
#include "arc/input/sdl/mouse.h" #include "arc/input/sdl/mouse.h"
#include "arc/input/sdl/keyboard.h" #include "arc/input/sdl/keyboard.h"
#ifdef ARC_SDL
#elif ARC_OPENGL #include "arc/graphics/glfw/window.h"
#include "arc/graphics/opengl/window.h" #include "arc/graphics/glfw/renderer.h"
#include "arc/graphics/opengl/renderer.h"
#ifdef ARC_GLFW
#include "arc/input/glfw/mouse.h" #include "arc/input/glfw/mouse.h"
#include "arc/input/glfw/keyboard.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){ void ARC_EngineData_Create(ARC_EngineData **data, ARC_Handler_CleanDataFn cleanfn, ARC_Point windowSize){
*data = (ARC_EngineData *)malloc(sizeof(ARC_EngineData)); *data = (ARC_EngineData *)malloc(sizeof(ARC_EngineData));
@ -44,14 +40,14 @@ void ARC_EngineData_Create(ARC_EngineData **data, ARC_Handler_CleanDataFn cleanf
(*data)->windowSize = windowSize; (*data)->windowSize = windowSize;
//TEMP //TEMP
#ifdef ARC_SDL #ifdef ARC_SDL
TTF_Init(); // TTF_Init();
Mix_Init(0); // Mix_Init(0);
Mix_OpenAudio(MIX_DEFAULT_FREQUENCY, MIX_DEFAULT_FORMAT, 2, 1024); // Mix_OpenAudio(MIX_DEFAULT_FREQUENCY, MIX_DEFAULT_FORMAT, 2, 1024);
#endif #endif
#ifdef ARC_SDL #ifdef ARC_SDL2_WINDOW
windowInfo = (ARC_WindowInfo){ "title", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, (*data)->windowSize.x, (*data)->windowSize.y, 0 }; 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 }; windowInfo = (ARC_WindowInfo){ "title", (*data)->windowSize.x, (*data)->windowSize.y };
#endif // ARC_SDL #endif // ARC_SDL
@ -61,9 +57,9 @@ void ARC_EngineData_Create(ARC_EngineData **data, ARC_Handler_CleanDataFn cleanf
return; return;
} }
#ifdef ARC_SDL #ifdef ARC_SDL2_WINDOW
renderInfo = (ARC_RenderInfo){ (SDL_Window *)(*data)->window, -1, SDL_RENDERER_ACCELERATED }; renderInfo = (ARC_RenderInfo){ (SDL_Window *)(*data)->window, -1, SDL_RENDERER_ACCELERATED };
#elif ARC_GLFW #elif ARC_GLFW_WINDOW
renderInfo = (ARC_RenderInfo){ (GLFWwindow *)(*data)->window }; renderInfo = (ARC_RenderInfo){ (GLFWwindow *)(*data)->window };
#endif // ARC_SDL #endif // ARC_SDL
@ -73,7 +69,7 @@ void ARC_EngineData_Create(ARC_EngineData **data, ARC_Handler_CleanDataFn cleanf
free(data); free(data);
} }
#ifdef ARC_SDL #ifdef ARC_SDL2_INPUT
SDL_Event *event = (SDL_Event *)malloc(sizeof(SDL_Event)); SDL_Event *event = (SDL_Event *)malloc(sizeof(SDL_Event));
mouseInfo = (ARC_MouseInfo ){ event }; mouseInfo = (ARC_MouseInfo ){ event };
keyboardInfo = (ARC_KeyboardInfo){ event }; keyboardInfo = (ARC_KeyboardInfo){ event };
@ -87,10 +83,10 @@ void ARC_EngineData_Create(ARC_EngineData **data, ARC_Handler_CleanDataFn cleanf
} }
void ARC_EngineData_Destroy(ARC_EngineData *data){ void ARC_EngineData_Destroy(ARC_EngineData *data){
#ifdef ARC_SDL #ifdef ARC_SDL2_INPUT
free(data->mouse->event); free(data->mouse->event);
TTF_Quit(); // TTF_Quit();
Mix_Quit(); // Mix_Quit();
#endif // ARC_SDL #endif // ARC_SDL
ARC_Mouse_Destroy(data->mouse); ARC_Mouse_Destroy(data->mouse);
@ -105,8 +101,7 @@ void ARC_Engine_Run(ARC_EngineData *data){
return; return;
} }
#ifdef ARC_SDL #ifdef ARC_SDL2_INPUT
SDL_Event *event = data->mouse->event; SDL_Event *event = data->mouse->event;
double lastTime = 0, currentTime; double lastTime = 0, currentTime;
data->dt = 0; data->dt = 0;
@ -115,14 +110,14 @@ void ARC_Engine_Run(ARC_EngineData *data){
data->running = 0; data->running = 0;
while(!data->running){ while(!data->running){
#ifdef ARC_SDL #ifdef ARC_SDL2_INPUT
currentTime = SDL_GetTicks(); currentTime = SDL_GetTicks();
data->dt = currentTime - lastTime; data->dt = currentTime - lastTime;
lastTime = currentTime; lastTime = currentTime;
SDL_PollEvent(data->mouse->event); SDL_PollEvent(data->mouse->event);
if(event->type == SDL_QUIT){ data->running = 1; } if(event->type == SDL_QUIT){ data->running = 1; }
#elif ARC_GLFW #elif ARC_GLFW_WINDOW
glfwPollEvents(); glfwPollEvents();
data->running = glfwWindowShouldClose((GLFWwindow *)data->window); data->running = glfwWindowShouldClose((GLFWwindow *)data->window);
#endif // ARC_SDL #endif // ARC_SDL

View file

@ -1,14 +1,14 @@
#ifdef ARC_OPENGL #ifdef ARC_GLFW_WINDOW
#include <stdio.h> #include <stdio.h>
#include "arc/std/config.h" #include "arc/std/config.h"
#include "arc/std/string.h" #include "arc/std/string.h"
#include "arc/std/errno.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){ void ARC_GraphicsConfig_Init(ARC_Config *config, ARC_Renderer *renderer){
} }
#endif // ARC_OPENGL #endif // ARC_OPENGL_GRAPHICS

View file

@ -1,15 +1,13 @@
#ifdef ARC_OPENGL #ifdef ARC_GLFW_WINDOW
#include "arc/graphics/renderer.h" #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 #define GLEW_STATIC
#include <GL/glew.h> #include <GL/glew.h>
#endif // ARC_GLEW // #endif // ARC_GLEW
#ifdef ARC_GLFW
#include <GLFW/glfw3.h> #include <GLFW/glfw3.h>
#endif
#include "arc/graphics/window.h" #include "arc/graphics/window.h"
#include "arc/std/errno.h" #include "arc/std/errno.h"
@ -22,18 +20,17 @@ void ARC_Renderer_Create(ARC_Renderer **renderer, ARC_RenderInfo *info){
return; return;
} }
#ifdef ARC_GLFW // #ifdef ARC_GLEW
*renderer = (ARC_Renderer *)malloc(sizeof(ARC_Renderer)); *renderer = (ARC_Renderer *)malloc(sizeof(ARC_Renderer));
(*renderer)->window = info->window; (*renderer)->window = info->window;
glewExperimental = GL_TRUE; glewExperimental = GL_TRUE;
if(glewInit() != GLEW_OK){ if(glewInit() != GLEW_OK){
ARC_DEBUG_ERR("ARC_Renderer_Create(**renderer, info), GLEW failed to init"); ARC_DEBUG_ERR("ARC_Renderer_Create(**renderer, info), GLEW failed to init");
glfwTerminate(); glfwTerminate();
arc_errno = ARC_ERRNO_INIT; arc_errno = ARC_ERRNO_INIT;
} }
#endif // ARC_GLEW // #endif // ARC_GLEW
glClearColor(0.23f, 0.38f, 0.47f, 1.0f); 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){ void ARC_Renderer_Render(ARC_Renderer *renderer){
#ifdef ARC_GLFW // #ifdef ARC_GLEW
glfwSwapBuffers(renderer->window); glfwSwapBuffers(renderer->window);
#endif // ARC_GLEW // #endif // ARC_GLEW
} }
#endif //ARC_SDL #endif //ARC_SDL

View file

@ -1,6 +1,6 @@
#ifdef ARC_GLFW #ifdef ARC_GLFW_WINDOW
#include "arc/graphics/window.h" #include "arc/graphics/window.h"
#include "arc/graphics/opengl/window.h" #include "arc/graphics/glfw/window.h"
#include "arc/std/errno.h" #include "arc/std/errno.h"
#include <GLFW/glfw3.h> #include <GLFW/glfw3.h>

View file

@ -0,0 +1,10 @@
#ifdef ARC_OPENGL_GRAPHICS
#include "arc/graphics/circle.h"
#include <stdio.h>
void ARC_Circle_Render(ARC_Circle *circle, ARC_Renderer *renderer, ARC_Color *color){
printf("OpenGL Backend Selected\n");
}
#endif // !ARC_OPENGL_GRAPHICS

View file

@ -1,8 +1,8 @@
#ifdef ARC_OPENGL #ifdef ARC_OPENGL_GRAPHICS
#include "arc/graphics/line.h" #include "arc/graphics/line.h"
#include <stdlib.h> #include <stdlib.h>
void ARC_Line_Render(int32_t *x1, int32_t *y1, int32_t *x2, int32_t *y2, ARC_Renderer *renderer, ARC_Color *color){ 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 #endif // ARC_OPENGL_GRAPHICS

View file

@ -0,0 +1,14 @@
#ifdef ARC_OPENGL_GRAPHICS
#include "arc/graphics/obround.h"
#include <stdio.h>
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

View file

@ -1,4 +1,4 @@
#ifdef ARC_OPENGL #ifdef ARC_OPENGL_GRAPHICS
#include "arc/graphics/rectangle.h" #include "arc/graphics/rectangle.h"
#include <stdlib.h> #include <stdlib.h>
@ -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){ void ARC_Rect_RenderFill(ARC_Rect *rect, ARC_Renderer *renderer, ARC_Color *color){
} }
#endif // ARC_OPENGL #endif // ARC_OPENGL_GRAPHICS

View file

@ -1,4 +1,4 @@
#ifdef ARC_OPENGL #ifdef ARC_OPENGL_GRAPHICS
#include "arc/graphics/sprite.h" #include "arc/graphics/sprite.h"
#include "arc/math/point.h" #include "arc/math/point.h"
#include "arc/math/rectangle.h" #include "arc/math/rectangle.h"
@ -26,4 +26,4 @@ ARC_Rect *ARC_Sprite_GetBounds(ARC_Sprite *sprite){
return NULL; return NULL;
} }
#endif // ARC_OPENGL #endif // ARC_OPENGL_GRAPHICS

View file

@ -1,4 +1,4 @@
#ifdef ARC_OPENGL #ifdef ARC_OPENGL_GRAPHICS
#include "arc/graphics/spritesheet.h" #include "arc/graphics/spritesheet.h"
#include "arc/math/point.h" #include "arc/math/point.h"
#include <stdlib.h> #include <stdlib.h>
@ -14,4 +14,4 @@ uint32_t *ARC_Spritesheet_GetTileSize(ARC_Spritesheet *spritesheet){
return NULL; return NULL;
} }
#endif // ARC_OPENGL #endif // ARC_OPENGL_GRAPHICS

View file

@ -0,0 +1,26 @@
#ifdef ARC_OPENGL_GRAPHICS
#include "arc/graphics/text.h"
#include <stdio.h>
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

View file

@ -1,4 +1,4 @@
#ifdef ARC_GLFW #ifdef ARC_GLFW_INPUT
#include "arc/input/glfw/keyboard.h" #include "arc/input/glfw/keyboard.h"
#include "arc/input/keyboard.h" #include "arc/input/keyboard.h"
#include "arc/math/point.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; return ARC_KEY_NONE;
} }
#endif // ARC_GLFW #endif // ARC_GLFW_INPUT

View file

@ -1,4 +1,4 @@
#ifdef ARC_GLFW #ifdef ARC_GLFW_INPUT
#include "arc/input/glfw/mouse.h" #include "arc/input/glfw/mouse.h"
#include "arc/input/mouse.h" #include "arc/input/mouse.h"
#include "arc/math/point.h" #include "arc/math/point.h"
@ -30,4 +30,4 @@ int32_t *ARC_Mouse_GetScrollY(ARC_Mouse *mouse){
return mouse->scrollY; return mouse->scrollY;
} }
#endif // ARC_SDL #endif // ARC_SDL_INPUT