Working on fixing stb

This commit is contained in:
2021-09-30 11:44:58 -07:00
parent fd6b9e5c84
commit 7ce46d3e44
7 changed files with 18 additions and 24 deletions

View File

@ -7,6 +7,7 @@
cmake_minimum_required(VERSION 3.13)
set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD_REQUIRED ON)
project(Dawn VERSION 1.0)
set(GAME_NAME DawnGame)
set(GAME_VERSION 1.0)

View File

@ -3,10 +3,8 @@
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT
project(${GAME_NAME} VERSION ${GAME_VERSION})
file(GLOB_RECURSE SOURCES ${CMAKE_SOURCE_DIR}/*.c)
file(GLOB_RECURSE HEADERS ${CMAKE_SOURCE_DIR}/*.h)
file(GLOB_RECURSE SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/*.c)
file(GLOB_RECURSE HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/*.h)
add_executable(${PROJECT_NAME} ${HEADERS} ${SOURCES})
target_link_libraries(${PROJECT_NAME} src glfw)
target_link_libraries(${PROJECT_NAME} src glfw glad_gl_core_33)

View File

@ -27,7 +27,8 @@ int32_t main() {
// Load GLAD
glfwMakeContextCurrent(window);
glfwSwapInterval(0);
gladLoadGLLoader((GLADloadproc) glfwGetProcAddress);
gladLoadGL((GLADloadfunc)glfwGetProcAddress);
// gladLoadGLLoader((GLADloadproc) glfwGetProcAddress);
// Setup window listeners
glfwSetWindowSizeCallback(window, &glfwOnResize);

View File

@ -4,10 +4,12 @@
// https://opensource.org/licenses/MIT
#pragma once
#include <src/libs.h>
#include "src/display/render.h"
#include "src/game/game.h"
#include "src/input/input.h"
#include <glad/gl.h>
#include <GLFW/glfw3.h>
#include <libs.h>
#include <display/render.h>
#include <game/game.h>
#include <input/input.h>
#define WINDOW_WIDTH_DEFAULT 1280
#define WINDOW_HEIGHT_DEFAULT WINDOW_WIDTH_DEFAULT/16*9

View File

@ -3,15 +3,15 @@
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT
add_subdirectory(Unity)
#add_subdirectory(Unity)
add_subdirectory(cglm)
add_subdirectory(glfw)
add_subdirectory(duktape)
# STB
add_library(stb STATIC stb/stb_image.h)
set_target_properties(stb PROPERTIES LINKER_LANGUAGE C)
target_include_directories(stb PUBLIC stb/)
file(GLOB_RECURSE STB_SOURCES stb/*.h)
add_library(stb INTERFACE)
target_include_directories(stb INTERFACE stb)
# GLAD
add_subdirectory(glad2/cmake)

View File

@ -8,12 +8,10 @@ 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
stb
)
# Set up flags

View File

@ -7,7 +7,6 @@
// Static Libs
#include <glad/gl.h>
#include <GLFW/glfw3.h>
#include <duktape.h>
#include <cglm/cglm.h>
#include <stb_image.h>
@ -26,12 +25,7 @@
#if defined(_WIN32) || defined(_WIN64)
// Windows Fixes
# define strtok_r strtok_s
#if defined(Sleep)
# define sleep(n) Sleep(n)
#else
# define sleep(n) _sleep(n)
#endif
#else
// Unix Fixes
#include <unistd.h>