Merge branch 'herbglitch/redesign' into 'herbglitch/master'
Herbglitch/redesign In Progress, didn't want to break herbglitch/master, but merge should be smooth See merge request Archeus_00/arc!8
This commit is contained in:
commit
ea27d4f199
27 changed files with 533 additions and 24 deletions
|
|
@ -1,4 +1,4 @@
|
|||
cmake_minimum_required(VERSION 3.10)
|
||||
cmake_minimum_required(VERSION 3.25)
|
||||
|
||||
set(ARCHEUS_STD_VERSION 0.0.0)
|
||||
project(archeus_std LANGUAGES C VERSION ${ARCHEUS_STD_VERSION} DESCRIPTION "libarcheus_std standard archeus c library")
|
||||
|
|
@ -9,15 +9,31 @@ function(print var)
|
|||
message("${var} = ${${var}}")
|
||||
endfunction()
|
||||
|
||||
option(ARCHEUS_STD_DEBUG "Build in debug mode" ON)
|
||||
#TODO: Might want to remove this
|
||||
if(NOT CMAKE_BUILD_TYPE)
|
||||
message("[Archeus C STD] Build Type not set, defaulting to Debug")
|
||||
set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Default to Debug" FORCE)
|
||||
endif()
|
||||
|
||||
# ~ OPTIONS ~ #
|
||||
option(ARCHEUS_STD_DEFAULT_CONFIG "Build with default config keys" ON)
|
||||
option(ARCHEUS_STD_SDL "Build with SDL" OFF)
|
||||
option(ARCHEUS_STD_GLFW "Build with GLFW window" OFF)
|
||||
option(ARCHEUS_STD_GLEW "Build with GLEW" OFF)
|
||||
option(ARCHEUS_STD_OPENGL "Build with OpenGL" OFF)
|
||||
|
||||
set(ARCHEUS_STD_WINDOW_BACKEND "NONE" CACHE STRING "Window Backend to build with")
|
||||
set_property(CACHE ARCHEUS_STD_WINDOW_BACKEND PROPERTY STRINGS NONE SDL2 GLFW)
|
||||
|
||||
set(ARCHEUS_STD_INPUT_BACKEND "NONE" CACHE STRING "Input Backend to build with, most likely should match Window API")
|
||||
set_property(CACHE ARCHEUS_STD_INPUT_BACKEND PROPERTY STRINGS NONE SDL2 GLFW)
|
||||
|
||||
set(ARCHEUS_STD_GRAPHICS_BACKEND "NONE" CACHE STRING "Graphics Backend to build with")
|
||||
set_property(CACHE ARCHEUS_STD_GRAPHICS_BACKEND PROPERTY STRINGS NONE SDL2 OPENGL)
|
||||
|
||||
# ~ INIT VARIABLES ~ #
|
||||
set(ARCHEUS_STD_FLAGS "")
|
||||
set(ARCHEUS_STD_LIBRARIES "")
|
||||
|
||||
<<<<<<< HEAD
|
||||
# ~ ARCHEUS_SOURCES ~ #
|
||||
=======
|
||||
if(ARCHEUS_STD_DEBUG)
|
||||
string(APPEND ARCHEUS_STD_FLAGS "-Wall -Werror -g -ggdb -DARC_DEBUG ")
|
||||
endif()
|
||||
|
|
@ -54,8 +70,10 @@ endif()
|
|||
|
||||
set(CMAKE_C_FLAGS ${ARCHEUS_STD_FLAGS})
|
||||
|
||||
>>>>>>> 5750185bd8a38ce2a450f47e3bd8d5315b455561
|
||||
set(ARCHEUS_STD_SOURCES
|
||||
src/std/config.c
|
||||
src/std/errno.c
|
||||
src/std/handler.c
|
||||
src/std/hashtable.c
|
||||
src/std/io.c
|
||||
|
|
@ -76,6 +94,39 @@ set(ARCHEUS_STD_SOURCES
|
|||
src/engine/state.c
|
||||
)
|
||||
|
||||
<<<<<<< HEAD
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
string(APPEND ARCHEUS_STD_FLAGS "-Wall -Werror -g -ggdb -DARC_DEBUG ")
|
||||
endif()
|
||||
|
||||
# TODO: replace this with a better system
|
||||
if(ARCHEUS_STD_DEFAULT_CONFIG)
|
||||
string(APPEND ARCHEUS_STD_FLAGS "-DARC_DEFAULT_CONFIG ")
|
||||
endif()
|
||||
|
||||
# ~ NONE ~ #
|
||||
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/archeus_none.cmake)
|
||||
none_check_and_init_needed(ARCHEUS_STD_FLAGS ARCHEUS_STD_SOURCES ${ARCHEUS_STD_WINDOW_BACKEND} ${ARCHEUS_STD_INPUT_BACKEND} ${ARCHEUS_STD_GRAPHICS_BACKEND})
|
||||
|
||||
# ~ SDL2 ~ #
|
||||
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()
|
||||
|
||||
if(ARCHEUS_STD_GLFW)
|
||||
string(APPEND ARCHEUS_STD_FLAGS "-DARC_GLFW ")
|
||||
endif()
|
||||
|
||||
if(ARCHEUS_STD_GLEW)
|
||||
string(APPEND ARCHEUS_STD_FLAGS "-DARC_GLEW ")
|
||||
endif()
|
||||
|
||||
set(CMAKE_C_FLAGS ${ARCHEUS_STD_FLAGS})
|
||||
=======
|
||||
set(ARCHEUS_STD_SDL_SOURCES
|
||||
src/audio/sdl/audio.c
|
||||
src/audio/sdl/config.c
|
||||
|
|
@ -95,6 +146,7 @@ set(ARCHEUS_STD_SDL_SOURCES
|
|||
src/graphics/sdl/view.c
|
||||
src/graphics/sdl/window.c
|
||||
)
|
||||
>>>>>>> 5750185bd8a38ce2a450f47e3bd8d5315b455561
|
||||
|
||||
set(ARCHEUS_STD_OPENGL_SOURCES
|
||||
src/graphics/opengl/config.c
|
||||
|
|
@ -111,10 +163,6 @@ set(ARCHEUS_STD_GLFW_SOURCES
|
|||
src/input/glfw/mouse.c
|
||||
)
|
||||
|
||||
if(ARCHEUS_STD_SDL)
|
||||
list(APPEND ARCHEUS_STD_SOURCES ${ARCHEUS_STD_SDL_SOURCES})
|
||||
endif()
|
||||
|
||||
if(ARCHEUS_STD_OPENGL)
|
||||
list(APPEND ARCHEUS_STD_SOURCES ${ARCHEUS_STD_OPENGL_SOURCES})
|
||||
endif()
|
||||
|
|
@ -129,13 +177,15 @@ else()
|
|||
add_library(archeus_std SHARED ${ARCHEUS_STD_SOURCES})
|
||||
endif()
|
||||
|
||||
if(ARCHEUS_STD_SDL)
|
||||
target_include_directories(archeus_std
|
||||
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||
PRIVATE ${SDL2_INCLUDE_DIRS}
|
||||
PRIVATE ${SDL2IMAGE_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
<<<<<<< HEAD
|
||||
target_link_libraries(archeus_std
|
||||
PUBLIC m
|
||||
)
|
||||
=======
|
||||
target_link_libraries(archeus_std PUBLIC ${SDL2_LIBRARIES} SDL2_image::SDL2_image SDL2_ttf::SDL2_ttf SDL2_mixer::SDL2_mixer)
|
||||
endif()
|
||||
|
||||
|
|
@ -144,6 +194,7 @@ if(ARCHEUS_STD_OPENGL)
|
|||
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||
)
|
||||
endif()
|
||||
>>>>>>> 5750185bd8a38ce2a450f47e3bd8d5315b455561
|
||||
|
||||
install(TARGETS archeus_std EXPORT archeus_std_Exports
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
|
|
|
|||
41
cmake/archeus_none.cmake
Normal file
41
cmake/archeus_none.cmake
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
set(ARCHEUS_STD_NONE_WINDOW_SOURCES
|
||||
)
|
||||
|
||||
set(ARCHEUS_STD_NONE_INPUT_SOURCES
|
||||
src/input/none/keyboard.c
|
||||
src/input/none/mouse.c
|
||||
)
|
||||
|
||||
set(ARCHEUS_STD_NONE_GRAPHICS_SOURCES
|
||||
src/graphics/none/circle.c
|
||||
src/graphics/none/config.c
|
||||
src/graphics/none/line.c
|
||||
src/graphics/none/obround.c
|
||||
src/graphics/none/rectangle.c
|
||||
src/graphics/none/renderer.c
|
||||
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)
|
||||
#add matching files for the selected backends
|
||||
if(${ARCHEUS_STD_WINDOW_BACKEND} STREQUAL "NONE")
|
||||
string(APPEND ${_ARCHEUS_STD_FLAGS} "-DARC_NONE_WINDOW ")
|
||||
list(APPEND ${_ARCHEUS_STD_SOURCES} ${ARCHEUS_STD_NONE_WINDOW_SOURCES})
|
||||
endif()
|
||||
|
||||
if(${ARCHEUS_STD_INPUT_BACKEND} STREQUAL "NONE")
|
||||
string(APPEND ${_ARCHEUS_STD_FLAGS} "-DARC_NONE_INPUT ")
|
||||
list(APPEND ${_ARCHEUS_STD_SOURCES} ${ARCHEUS_STD_NONE_INPUT_SOURCES})
|
||||
endif()
|
||||
|
||||
if(${ARCHEUS_STD_GRAPHICS_BACKEND} STREQUAL "NONE")
|
||||
string(APPEND ${_ARCHEUS_STD_FLAGS} "-DARC_NONE_GRAPHICS ")
|
||||
list(APPEND ${_ARCHEUS_STD_SOURCES} ${ARCHEUS_STD_NONE_GRAPHICS_SOURCES})
|
||||
endif()
|
||||
|
||||
set(${_ARCHEUS_STD_FLAGS} ${${_ARCHEUS_STD_FLAGS}} PARENT_SCOPE)
|
||||
set(${_ARCHEUS_STD_SOURCES} ${${_ARCHEUS_STD_SOURCES}} PARENT_SCOPE)
|
||||
endfunction()
|
||||
0
cmake/archeus_opengl.cmake
Normal file
0
cmake/archeus_opengl.cmake
Normal file
64
cmake/archeus_sdl2.cmake
Normal file
64
cmake/archeus_sdl2.cmake
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
set(ARCHEUS_STD_SDL2_WINDOW_SOURCES
|
||||
)
|
||||
|
||||
set(ARCHEUS_STD_SDL2_INPUT_SOURCES
|
||||
src/input/sdl/keyboard.c
|
||||
src/input/sdl/mouse.c
|
||||
)
|
||||
|
||||
set(ARCHEUS_STD_SDL2_GRAPHICS_SOURCES
|
||||
src/graphics/sdl/circle.c
|
||||
src/graphics/sdl/config.c
|
||||
src/graphics/sdl/line.c
|
||||
src/graphics/sdl/obround.c
|
||||
src/graphics/sdl/rectangle.c
|
||||
src/graphics/sdl/renderer.c
|
||||
src/graphics/sdl/sprite.c
|
||||
src/graphics/sdl/spritesheet.c
|
||||
src/graphics/sdl/text.c
|
||||
src/graphics/sdl/window.c
|
||||
)
|
||||
|
||||
function(sdl2_check_and_init_needed ARCHEUS_STD_FLAGS ARCHEUS_STD_SOURCES ARCHEUS_STD_WINDOW_BACKEND ARCHEUS_STD_INPUT_BACKEND ARCHEUS_STD_GRAPHICS_BACKEND)
|
||||
#if no backend uses sdl return
|
||||
if(NOT ARCHEUS_STD_WINDOW_BACKEND STREQUAL "SDL2" AND NOT ARCHEUS_STD_INPUT_BACKEND STREQUAL "SDL2" AND NOT ARCHEUS_STD_GRAPHICS_BACKEND STREQUAL "SDL2")
|
||||
return()
|
||||
endif()
|
||||
|
||||
string(APPEND ARCHEUS_STD_FLAGS "-DARC_SDL ")
|
||||
|
||||
#get needed libraries for backends
|
||||
find_package(SDL2 REQUIRED)
|
||||
|
||||
if(ARCHEUS_STD_GRAPHICS_BACKEND STREQUAL "SDL2")
|
||||
if(NOT PNG AND WIN32 AND NOT MSVC)
|
||||
set(PNG_LIBRARY "C:/Program Files(x86)/libpng")
|
||||
set(PNG_PNG_INCLUDE_DIR "C:/Program Files(x86)/libpng/include")
|
||||
endif()
|
||||
|
||||
find_package(SDL2_image REQUIRED)
|
||||
find_package(SDL2_ttf REQUIRED)
|
||||
endif()
|
||||
|
||||
#add matching files for the selected backends
|
||||
if(ARCHEUS_STD_INPUT_BACKEND STREQUAL "SDL2")
|
||||
list(APPEND ARCHEUS_STD_SOURCES ${ARCHEUS_STD_SDL2_INPUT_SOURCES})
|
||||
endif()
|
||||
|
||||
if(ARCHEUS_STD_INPUT_BACKEND STREQUAL "SDL2")
|
||||
list(APPEND ARCHEUS_STD_SOURCES ${ARCHEUS_STD_SDL2_INPUT_SOURCES})
|
||||
endif()
|
||||
|
||||
if(ARCHEUS_STD_GRAPHICS_BACKEND STREQUAL "SDL2")
|
||||
list(APPEND ARCHEUS_STD_SOURCES ${ARCHEUS_STD_SDL2_GRAPHICS_SOURCES})
|
||||
endif()
|
||||
|
||||
target_include_directories(archeus_std
|
||||
PRIVATE ${SDL2_INCLUDE_DIRS}
|
||||
PRIVATE ${SDL2IMAGE_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
target_link_libraries(archeus_std PUBLIC ${SDL2_LIBRARIES} SDL2_image::SDL2_image SDL2_ttf::SDL2_ttf)
|
||||
|
||||
return(ARCHEUS_STD_SDL2_SOURCES)
|
||||
endfunction()
|
||||
14
include/arc/graphics/none/renderer.h
Normal file
14
include/arc/graphics/none/renderer.h
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
#ifdef ARC_NONE_GRAPHICS
|
||||
|
||||
#include "arc/graphics/renderer.h"
|
||||
|
||||
#ifndef ARC_NONE_RENDERER_H_
|
||||
#define ARC_NONE_RENDERER_H_
|
||||
|
||||
typedef void ARC_RendererType;
|
||||
|
||||
struct ARC_RenderInfo {};
|
||||
|
||||
#endif // !ARC_NONE_RENDERER_H_
|
||||
|
||||
#endif // !ARC_NONE_GRAPHICS
|
||||
12
include/arc/graphics/none/sprite.h
Normal file
12
include/arc/graphics/none/sprite.h
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
#ifdef ARC_NONE_GRAPHICS
|
||||
|
||||
#ifndef ARC_NONE_SPRITE_H_
|
||||
#define ARC_NONE_SPRITE_H_
|
||||
|
||||
#include "arc/graphics/sprite.h"
|
||||
|
||||
struct ARC_Sprite {};
|
||||
|
||||
#endif // !ARC_NONE_SPRITE_H_
|
||||
|
||||
#endif // !ARC_NONE_GRAPHICS
|
||||
12
include/arc/graphics/none/spritesheet.h
Normal file
12
include/arc/graphics/none/spritesheet.h
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
#ifdef ARC_NONE_GRAPHICS
|
||||
|
||||
#ifndef ARC_NONE_SPRITESHEET_H_
|
||||
#define ARC_NONE_SPRITESHEET_H_
|
||||
|
||||
#include "arc/graphics/spritesheet.h"
|
||||
|
||||
struct ARC_Spritesheet {};
|
||||
|
||||
#endif // !ARC_NONE_SPRITESHEET_H_
|
||||
|
||||
#endif // !ARC_NONE_GRAPHICS
|
||||
12
include/arc/graphics/none/text.h
Normal file
12
include/arc/graphics/none/text.h
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
#ifdef ARC_NONE_GRAPHICS
|
||||
|
||||
#ifndef ARC_NONE_TEXT_H_
|
||||
#define ARC_NONE_TEXT_H_
|
||||
|
||||
#include "arc/graphics/text.h"
|
||||
|
||||
struct ARC_Text {};
|
||||
|
||||
#endif // !ARC_NONE_TEXT_H_
|
||||
|
||||
#endif // !ARC_NONE_GRAPHICS
|
||||
14
include/arc/graphics/none/window.h
Normal file
14
include/arc/graphics/none/window.h
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
#ifdef ARC_NONE_WINDOW
|
||||
|
||||
#ifndef ARC_NONE_WINDOW_H_
|
||||
#define ARC_NONE_WINDOW_H_
|
||||
|
||||
#include "arc/graphics/window.h"
|
||||
|
||||
typedef void ARC_WindowType;
|
||||
|
||||
struct ARC_WindowInfo {};
|
||||
|
||||
#endif // !ARC_SDL_WINDOW_H_
|
||||
|
||||
#endif // !ARC_NONE_WINDOW
|
||||
14
include/arc/input/none/keyboard.h
Normal file
14
include/arc/input/none/keyboard.h
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
#ifdef ARC_NONE_INPUT
|
||||
|
||||
#ifndef ARC_NONE_KEYBOARD_H_
|
||||
#define ARC_NONE_KEYBOARD_H_
|
||||
|
||||
#include "arc/input/keyboard.h"
|
||||
|
||||
struct ARC_Keyboard {};
|
||||
|
||||
struct ARC_KeyboardInfo {};
|
||||
|
||||
#endif // !ARC_NONE_KEYBOARD_H_
|
||||
|
||||
#endif // !ARC_NONE_INPUT
|
||||
14
include/arc/input/none/mouse.h
Normal file
14
include/arc/input/none/mouse.h
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
#ifdef ARC_NONE_INPUT
|
||||
|
||||
#ifndef ARC_NONE_MOUSE_H_
|
||||
#define ARC_NONE_MOUSE_H_
|
||||
|
||||
#include "arc/input/mouse.h"
|
||||
|
||||
struct ARC_Mouse {};
|
||||
|
||||
struct ARC_MouseInfo {};
|
||||
|
||||
#endif // !ARC_NONE_MOUSE_H_
|
||||
|
||||
#endif // !ARC_NONE_INPUT
|
||||
|
|
@ -10,16 +10,12 @@
|
|||
#define ARC_ERRNO_OVERFLOW -0x05
|
||||
#define ARC_ERRNO_INIT -0x06
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-variable"
|
||||
static int32_t arc_errno = 0;
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern int32_t arc_errno;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -9,6 +9,11 @@
|
|||
#include "arc/std/handler.h"
|
||||
|
||||
//NOTE: some of this file is temporary, mostly to get smthn running so I can test out different ideas
|
||||
#include "arc/graphics/none/window.h"
|
||||
#include "arc/graphics/none/renderer.h"
|
||||
#include "arc/input/none/mouse.h"
|
||||
#include "arc/input/none/keyboard.h"
|
||||
|
||||
#ifdef ARC_SDL
|
||||
#include "arc/graphics/sdl/window.h"
|
||||
#include "arc/graphics/sdl/renderer.h"
|
||||
|
|
|
|||
10
src/graphics/none/circle.c
Normal file
10
src/graphics/none/circle.c
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
#ifdef ARC_NONE_GRAPHICS
|
||||
|
||||
#include "arc/graphics/circle.h"
|
||||
#include <stdio.h>
|
||||
|
||||
void ARC_Circle_Render(ARC_Circle *circle, ARC_Renderer *renderer, ARC_Color *color){
|
||||
printf("No Graphics Backend Selected\n");
|
||||
}
|
||||
|
||||
#endif // !ARC_NONE_GRAPHICS
|
||||
10
src/graphics/none/config.c
Normal file
10
src/graphics/none/config.c
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
#ifdef ARC_NONE_GRAPHICS
|
||||
|
||||
#include "arc/graphics/config.h"
|
||||
#include <stdio.h>
|
||||
|
||||
void ARC_GraphicsConfig_Init(ARC_Config *config, ARC_Renderer *renderer){
|
||||
printf("No Graphics Backend Selected\n");
|
||||
}
|
||||
|
||||
#endif //ARC_NONE_GRAPHICS
|
||||
10
src/graphics/none/line.c
Normal file
10
src/graphics/none/line.c
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
#ifdef ARC_NONE_GRAPHICS
|
||||
|
||||
#include "arc/graphics/line.h"
|
||||
#include <stdio.h>
|
||||
|
||||
void ARC_Line_Render(int32_t *x1, int32_t *y1, int32_t *x2, int32_t *y2, ARC_Renderer *renderer, ARC_Color *color){
|
||||
printf("No Graphics Backend Selected\n");
|
||||
}
|
||||
|
||||
#endif // !ARC_NONE_GRAPHICS
|
||||
14
src/graphics/none/obround.c
Normal file
14
src/graphics/none/obround.c
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
#ifdef ARC_NONE_GRAPHICS
|
||||
|
||||
#include "arc/graphics/obround.h"
|
||||
#include <stdio.h>
|
||||
|
||||
void ARC_Obround_Render(ARC_Obround *obround, ARC_Renderer *renderer, ARC_Color *color){
|
||||
printf("No Graphics Backend Selected\n");
|
||||
}
|
||||
|
||||
void ARC_FObround_Render(ARC_FObround *obround, ARC_Renderer *renderer, ARC_Color *color){
|
||||
printf("No Graphics Backend Selected\n");
|
||||
}
|
||||
|
||||
#endif // ARC_NONE_GRAPHICS
|
||||
22
src/graphics/none/rectangle.c
Normal file
22
src/graphics/none/rectangle.c
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
#ifdef ARC_NONE_GRAPHICS
|
||||
|
||||
#include "arc/graphics/rectangle.h"
|
||||
#include <stdio.h>
|
||||
|
||||
void ARC_Rect_Render(ARC_Rect *rect, ARC_Renderer *renderer, ARC_Color *color){
|
||||
printf("No Graphics Backend Selected\n");
|
||||
}
|
||||
|
||||
void ARC_Rect_RenderFill(ARC_Rect *rect, ARC_Renderer *renderer, ARC_Color *color){
|
||||
printf("No Graphics Backend Selected\n");
|
||||
}
|
||||
|
||||
void ARC_FRect_Render(ARC_FRect *rect, ARC_Renderer *renderer, ARC_Color *color){
|
||||
printf("No Graphics Backend Selected\n");
|
||||
}
|
||||
|
||||
void ARC_FRect_RenderFill(ARC_FRect *rect, ARC_Renderer *renderer, ARC_Color *color){
|
||||
printf("No Graphics Backend Selected\n");
|
||||
}
|
||||
|
||||
#endif // !ARC_NONE_GRAPHICS
|
||||
22
src/graphics/none/renderer.c
Normal file
22
src/graphics/none/renderer.c
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
#ifdef ARC_NONE_GRAPHICS
|
||||
|
||||
#include "arc/graphics/renderer.h"
|
||||
#include <stdio.h>
|
||||
|
||||
void ARC_Renderer_Create(ARC_Renderer **renderer, ARC_RenderInfo *info){
|
||||
printf("No Graphics Backend Selected\n");
|
||||
}
|
||||
|
||||
void ARC_Renderer_Destroy(ARC_Renderer *renderer){
|
||||
printf("No Graphics Backend Selected\n");
|
||||
}
|
||||
|
||||
void ARC_Renderer_Clear(ARC_Renderer *renderer){
|
||||
printf("No Graphics Backend Selected\n");
|
||||
}
|
||||
|
||||
void ARC_Renderer_Render(ARC_Renderer *renderer){
|
||||
printf("No Graphics Backend Selected\n");
|
||||
}
|
||||
|
||||
#endif // !ARC_NONE_GRAPHICS
|
||||
48
src/graphics/none/sprite.c
Normal file
48
src/graphics/none/sprite.c
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
#ifdef ARC_NONE_GRAPHICS
|
||||
|
||||
#include "arc/graphics/sprite.h"
|
||||
#include <stdio.h>
|
||||
|
||||
void ARC_Sprite_Create(ARC_Sprite **sprite, ARC_Spritesheet *spritesheet, ARC_Array *frames){
|
||||
printf("No Graphics Backend Selected\n");
|
||||
}
|
||||
|
||||
void ARC_Sprite_Destroy(ARC_Sprite *sprite){
|
||||
printf("No Graphics Backend Selected\n");
|
||||
}
|
||||
|
||||
void ARC_Sprite_Copy(ARC_Sprite **newSprite, ARC_Sprite *oldSprite){
|
||||
printf("No Graphics Backend Selected\n");
|
||||
}
|
||||
|
||||
void ARC_Sprite_Render(ARC_Sprite *sprite, ARC_Renderer *renderer, ARC_Rect *renderBounds){
|
||||
printf("No Graphics Backend Selected\n");
|
||||
}
|
||||
|
||||
void ARC_Sprite_RenderFlip(ARC_Sprite *sprite, ARC_Renderer *renderer, ARC_Rect *renderBounds, enum ARC_Sprite_Axis axis){
|
||||
printf("No Graphics Backend Selected\n");
|
||||
}
|
||||
|
||||
void ARC_Sprite_RenderRotated(ARC_Sprite *sprite, ARC_Renderer *renderer, ARC_Rect *renderBounds, ARC_Point *center, double angle){
|
||||
printf("No Graphics Backend Selected\n");
|
||||
}
|
||||
|
||||
void ARC_Sprite_SetFrameIndex(ARC_Sprite *sprite, uint32_t index){
|
||||
printf("No Graphics Backend Selected\n");
|
||||
}
|
||||
|
||||
void ARC_Sprite_IterateFrame(ARC_Sprite *sprite){
|
||||
printf("No Graphics Backend Selected\n");
|
||||
}
|
||||
|
||||
ARC_Rect *ARC_Sprite_GetBounds(ARC_Sprite *sprite){
|
||||
printf("No Graphics Backend Selected\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ARC_Array *ARC_Sprite_GetAllBounds(ARC_Sprite *sprite){
|
||||
printf("No Graphics Backend Selected\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#endif // !ARC_NONE_GRAPHICS
|
||||
21
src/graphics/none/spritesheet.c
Normal file
21
src/graphics/none/spritesheet.c
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
#ifdef ARC_NONE_GRAPHICS
|
||||
|
||||
#include "arc/graphics/spritesheet.h"
|
||||
#include "arc/math/point.h"
|
||||
#include <stdio.h>
|
||||
|
||||
void ARC_Spritesheet_RenderArea(ARC_Spritesheet *spritesheet, ARC_Rect *sheetBounds, ARC_Renderer *renderer, ARC_Rect *renderBounds){
|
||||
printf("No Graphics Backend Selected\n");
|
||||
}
|
||||
|
||||
ARC_Point ARC_Spritesheet_GetSize(ARC_Spritesheet *spritesheet){
|
||||
printf("No Graphics Backend Selected\n");
|
||||
return (ARC_Point){ 0, 0 };
|
||||
}
|
||||
|
||||
uint32_t *ARC_Spritesheet_GetTileSize(ARC_Spritesheet *spritesheet){
|
||||
printf("No Graphics Backend Selected\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#endif // !ARC_NONE_GRAPHICS
|
||||
26
src/graphics/none/text.c
Normal file
26
src/graphics/none/text.c
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
#ifdef ARC_NONE_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("No Graphics Backend Selected\n");
|
||||
}
|
||||
|
||||
void ARC_Text_Destroy(ARC_Text *font){
|
||||
printf("No Graphics Backend Selected\n");
|
||||
}
|
||||
|
||||
void ARC_Text_SetString(ARC_Text *text, ARC_Renderer *renderer, ARC_String *string){
|
||||
printf("No Graphics Backend Selected\n");
|
||||
}
|
||||
|
||||
void ARC_Text_Render(ARC_Text *text, ARC_Renderer *renderer){
|
||||
printf("No Graphics Backend Selected\n");
|
||||
}
|
||||
|
||||
void ARC_Text_SetPos(ARC_Text *text, ARC_Point pos){
|
||||
printf("No Graphics Backend Selected\n");
|
||||
}
|
||||
|
||||
#endif // !ARC_NONE_GRAPHICS
|
||||
14
src/graphics/none/window.c
Normal file
14
src/graphics/none/window.c
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
#ifdef ARC_NONE_WINDOW
|
||||
|
||||
#include "arc/graphics/window.h"
|
||||
#include <stdio.h>
|
||||
|
||||
void ARC_Window_Create(ARC_Window **window, ARC_WindowInfo *info){
|
||||
printf("No Window Backend Selected\n");
|
||||
}
|
||||
|
||||
void ARC_Window_Destroy(ARC_Window *window){
|
||||
printf("No Window Backend Selected\n");
|
||||
}
|
||||
|
||||
#endif // !ARC_NONE_WINDOW
|
||||
23
src/input/none/keyboard.c
Normal file
23
src/input/none/keyboard.c
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
#ifdef ARC_NONE_INPUT
|
||||
|
||||
#include "arc/input/keyboard.h"
|
||||
#include <stdio.h>
|
||||
|
||||
void ARC_Keyboard_Create(ARC_Keyboard **keyboard, ARC_KeyboardInfo *info){
|
||||
printf("No Input Backend Selected\n");
|
||||
}
|
||||
|
||||
void ARC_Keyboard_Destroy(ARC_Keyboard *keyboard){
|
||||
printf("No Input Backend Selected\n");
|
||||
}
|
||||
|
||||
void ARC_Keyboard_Update(ARC_Keyboard *keyboard){
|
||||
printf("No Input Backend Selected\n");
|
||||
}
|
||||
|
||||
ARC_KeyboardState ARC_Keyboard_GetState(ARC_Keyboard *keyboard, enum ARC_KeyboardKey key){
|
||||
printf("No Input Backend Selected\n");
|
||||
return ARC_KEY_NONE;
|
||||
}
|
||||
|
||||
#endif // !ARC_NONE_INPUT
|
||||
37
src/input/none/mouse.c
Normal file
37
src/input/none/mouse.c
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
#ifdef ARC_NONE_INPUT
|
||||
|
||||
#include "arc/input/mouse.h"
|
||||
#include <stdio.h>
|
||||
|
||||
void ARC_Mouse_Create(ARC_Mouse **mouse, ARC_MouseInfo *info){
|
||||
printf("No Input Backend Selected\n");
|
||||
}
|
||||
|
||||
void ARC_Mouse_Destroy(ARC_Mouse *mouse){
|
||||
printf("No Input Backend Selected\n");
|
||||
}
|
||||
|
||||
void ARC_Mouse_UpdateButton(ARC_Mouse *mouse, uint8_t button, uint32_t *buttons, uint32_t mask){
|
||||
printf("No Input Backend Selected\n");
|
||||
}
|
||||
|
||||
void ARC_Mouse_Update(ARC_Mouse *mouse){
|
||||
printf("No Input Backend Selected\n");
|
||||
}
|
||||
|
||||
ARC_Point *ARC_Mouse_GetCoords(ARC_Mouse *mouse){
|
||||
printf("No Input Backend Selected\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ARC_MouseState ARC_Mouse_GetState(ARC_Mouse *mouse, ARC_MouseButton button){
|
||||
printf("No Input Backend Selected\n");
|
||||
return ARC_MOUSE_NONE;
|
||||
}
|
||||
|
||||
int32_t *ARC_Mouse_GetScrollY(ARC_Mouse *mouse){
|
||||
printf("No Input Backend Selected\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#endif // !ARC_INPUT_NONE
|
||||
3
src/std/errno.c
Normal file
3
src/std/errno.c
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
#include "arc/std/errno.h"
|
||||
|
||||
int32_t arc_errno = 0;
|
||||
|
|
@ -8,8 +8,8 @@
|
|||
void ARC_IO_FileToStr(ARC_String *path, ARC_String **data){
|
||||
FILE *file = fopen(path->data, "rb");
|
||||
if(!file){
|
||||
return;
|
||||
arc_errno = ARC_ERRNO_NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
fseek(file, 0L, SEEK_END);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue