Working on doing things properly.

This commit is contained in:
2021-09-30 11:09:52 -07:00
parent d47a3707ba
commit fd6b9e5c84
27 changed files with 106439 additions and 890 deletions

30
src/CMakeLists.txt Normal file
View File

@ -0,0 +1,30 @@
# Copyright (c) 2021 Dominic Msters
#
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT
# Add Sources
file(GLOB_RECURSE SOURCES *.c)
add_library(src STATIC ${SOURCES})
target_include_directories(src PUBLIC ${CMAKE_CURRENT_LIST_DIR})
target_link_libraries(src PUBLIC
glfw
cglm
stb
cglm
duktape
glad_gl_core_33
)
# Set up flags
target_compile_definitions(src PRIVATE
SETTING_PLATFORM_GLFW=1
SETTING_PLATFORM=1
SETTING_PLATFORM_USE_GLAD=1
SETTING_ASSET_PREFIX="../assets/"
SETTING_GAME_NAME="DawnGame"
SETTING_GAME_POKER=1
SETTING_GAME_DAWN=2
SETTING_GAME_SANDBOX=3
SETTING_GAME=1
)

0
src/config.h Normal file
View File

View File

@ -13,6 +13,9 @@
#include "../display/render.h"
typedef struct {
/** Name of the game */
char *name;
/** Time Manager for the game */
epoch_t time;

View File

@ -5,33 +5,15 @@
#pragma once
// Settings
#include "config.h"
// Static Libs
#include <cglm/cglm.h>
#include <glad/gl.h>
#include <GLFW/glfw3.h>
#include <duktape.h>
#if SETTING_PLATFORM_USE_GLAD == 1
#include <glad/glad.h>
#else
#include <GL/gl.h>
#endif
#if SETTING_PLATFORM == SETTING_PLATFORM_GLFW
#include <GLFW/glfw3.h>
#elif SETTING_PLATFORM == SETTING_PLATFORM_SDL
#include "SDL.h"
#include "SDL_opengl.h"
#elif SETTING_PLATFORM == SETTING_PLATFORM_GBM
#include <xf86drm.h>
#include <xf86drmMode.h>
#include <gbm.h>
#endif
#include <cglm/cglm.h>
#include <stb_image.h>
#include <stb_truetype.h>
// Standard Libs
#include <stdio.h>
#include <stdint.h>
@ -51,5 +33,6 @@
# define sleep(n) _sleep(n)
#endif
#else
// Unix Fixes
#include <unistd.h>
#endif