From a1ac349c22f43ece1dcad7b21ed82dbb434cbf06 Mon Sep 17 00:00:00 2001 From: sanine Date: Thu, 18 Aug 2022 20:59:53 -0500 Subject: remove Lua as library requirement --- CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index bf0ee15..8095e9e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,7 +5,6 @@ set(CMAKE_C_FLAGS "-Wall -Wextra -Werror -Wfatal-errors -Wpedantic") set(CMAKE_C_FLAGS "-g") find_package(OpenGL REQUIRED) -find_package(Lua51 REQUIRED) set(SRC_ROOT ${CMAKE_SOURCE_DIR}/src) set(LIB_ROOT ${CMAKE_SOURCE_DIR}/libs) @@ -22,6 +21,7 @@ link_directories(${LIB_ROOT}/honeysuckle) # add_library(glad ${SRC_ROOT}/gl/glad/glad.c) # add_library(stb_image src/stb_image/stb_image.c) +add_subdirectory(${LIB_ROOT}/lua-5.1.5) add_subdirectory(${LIB_ROOT}/assimp) add_subdirectory(${LIB_ROOT}/honeysuckle) add_subdirectory(${LIB_ROOT}/cglm) @@ -38,7 +38,7 @@ set(SOURCE_FILES add_executable(honey ${SOURCE_FILES}) -set(LIBRARIES ${LUA_LIBRARIES} honeysuckle assimp glad cairo m) +set(LIBRARIES lua5.1 honeysuckle assimp glad cairo m) if (WIN32) set(LIBRARIES ${LIBRARIES} glfw3 opengl32) else() @@ -64,4 +64,4 @@ add_executable(test EXCLUDE_FROM_ALL ${TEST_SOURCES}) set_target_properties(test PROPERTIES C_STANDARD 99 CMAKE_C_FLAGS "-Wall -Wextra -Werror -Wfatal-errors -Wpedantic") -target_link_libraries(test ${LUA_LIBRARIES} honeysuckle) +target_link_libraries(test lua5.1 honeysuckle) -- cgit v1.2.1 From 275536b36657744d802866c060654e2b5cd5a5f8 Mon Sep 17 00:00:00 2001 From: sanine Date: Thu, 18 Aug 2022 22:46:40 -0500 Subject: implement working windows --- CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 8095e9e..99964c3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,6 +29,8 @@ add_subdirectory(${LIB_ROOT}/cglm) set(HONEY_LIB_FILES ${SRC_ROOT}/logging/logging.c + ${SRC_ROOT}/gl/gl.c + ${SRC_ROOT}/gl/window.c ) set(SOURCE_FILES @@ -38,7 +40,7 @@ set(SOURCE_FILES add_executable(honey ${SOURCE_FILES}) -set(LIBRARIES lua5.1 honeysuckle assimp glad cairo m) +set(LIBRARIES lua5.1 honeysuckle assimp cairo m) if (WIN32) set(LIBRARIES ${LIBRARIES} glfw3 opengl32) else() @@ -57,7 +59,7 @@ set(TEST_SOURCES ${SRC_ROOT}/test/honey-test.c ${SRC_ROOT}/logging/logging.test.c - ${SRC_ROOT}/gl/window.test.c + ${SRC_ROOT}/gl/gl.test.c ) add_executable(test EXCLUDE_FROM_ALL ${TEST_SOURCES}) -- cgit v1.2.1 From ecde0c8110da1c1f94cce7f6a1fa9406d04eca69 Mon Sep 17 00:00:00 2001 From: sanine Date: Fri, 19 Aug 2022 00:39:04 -0500 Subject: add several buffer-related functions --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 99964c3..2da7f20 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,6 +29,7 @@ add_subdirectory(${LIB_ROOT}/cglm) set(HONEY_LIB_FILES ${SRC_ROOT}/logging/logging.c + ${SRC_ROOT}/gl/glad/glad.c ${SRC_ROOT}/gl/gl.c ${SRC_ROOT}/gl/window.c ) @@ -59,6 +60,7 @@ set(TEST_SOURCES ${SRC_ROOT}/test/honey-test.c ${SRC_ROOT}/logging/logging.test.c + ${SRC_ROOT}/gl/glad/glad.c ${SRC_ROOT}/gl/gl.test.c ) @@ -66,4 +68,4 @@ add_executable(test EXCLUDE_FROM_ALL ${TEST_SOURCES}) set_target_properties(test PROPERTIES C_STANDARD 99 CMAKE_C_FLAGS "-Wall -Wextra -Werror -Wfatal-errors -Wpedantic") -target_link_libraries(test lua5.1 honeysuckle) +target_link_libraries(test lua5.1 honeysuckle dl) -- cgit v1.2.1 From 8b9b325b092b7157996cfbcdd7ce38f9e876fff8 Mon Sep 17 00:00:00 2001 From: sanine Date: Sat, 20 Aug 2022 15:37:04 -0500 Subject: fix bug in gl.bufferData and add error checking --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 2da7f20..c36fc99 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -62,10 +62,11 @@ set(TEST_SOURCES ${SRC_ROOT}/logging/logging.test.c ${SRC_ROOT}/gl/glad/glad.c ${SRC_ROOT}/gl/gl.test.c + ${SRC_ROOT}/gl/window.test.c ) add_executable(test EXCLUDE_FROM_ALL ${TEST_SOURCES}) set_target_properties(test PROPERTIES C_STANDARD 99 CMAKE_C_FLAGS "-Wall -Wextra -Werror -Wfatal-errors -Wpedantic") -target_link_libraries(test lua5.1 honeysuckle dl) +target_link_libraries(test lua5.1 honeysuckle glfw dl) -- cgit v1.2.1 From 74e48c197a57c9f7920ce048c9bf4b59d5303e18 Mon Sep 17 00:00:00 2001 From: sanine Date: Sun, 21 Aug 2022 20:31:58 -0500 Subject: add glfw to CMakeLists.txt --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index c36fc99..a76d76b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,12 +12,14 @@ set(LIB_ROOT ${CMAKE_SOURCE_DIR}/libs) include_directories( ${LUA_INCLUDE_DIR} ${CMAKE_SOURCE_DIR}/src - ${CMAKE_SOURCE_DIR}/libs/honeysuckle/src + ${LIB_ROOT}/honeysuckle/src + ${LIB_ROOT}/glfw-3.3.8/include ) # link to third-party included libraries link_directories(${LIB_ROOT}/assimp/lib) link_directories(${LIB_ROOT}/honeysuckle) +link_directories(${LIB_ROOT}/glfw-3.3.8/src) # add_library(glad ${SRC_ROOT}/gl/glad/glad.c) # add_library(stb_image src/stb_image/stb_image.c) @@ -25,6 +27,7 @@ add_subdirectory(${LIB_ROOT}/lua-5.1.5) add_subdirectory(${LIB_ROOT}/assimp) add_subdirectory(${LIB_ROOT}/honeysuckle) add_subdirectory(${LIB_ROOT}/cglm) +add_subdirectory(${LIB_ROOT}/glfw-3.3.8) set(HONEY_LIB_FILES -- cgit v1.2.1 From 4ffe0ff4ac30361ea2a35dcfa07ca560ed865631 Mon Sep 17 00:00:00 2001 From: sanine Date: Sun, 21 Aug 2022 21:54:47 -0500 Subject: build with clang on visual studio --- CMakeLists.txt | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index a76d76b..b5e8502 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,8 +1,10 @@ cmake_minimum_required(VERSION 3.2) project(honey_engine_demo) -set(CMAKE_C_FLAGS "-Wall -Wextra -Werror -Wfatal-errors -Wpedantic") -set(CMAKE_C_FLAGS "-g") +if (UNIX) + set(CMAKE_C_FLAGS "-Wall -Wextra -Werror -Wfatal-errors -Wpedantic") + set(CMAKE_C_FLAGS "-g") +endif() find_package(OpenGL REQUIRED) @@ -10,7 +12,7 @@ set(SRC_ROOT ${CMAKE_SOURCE_DIR}/src) set(LIB_ROOT ${CMAKE_SOURCE_DIR}/libs) include_directories( - ${LUA_INCLUDE_DIR} + ${LIB_ROOT}/lua-5.1.5/src ${CMAKE_SOURCE_DIR}/src ${LIB_ROOT}/honeysuckle/src ${LIB_ROOT}/glfw-3.3.8/include @@ -44,11 +46,11 @@ set(SOURCE_FILES add_executable(honey ${SOURCE_FILES}) -set(LIBRARIES lua5.1 honeysuckle assimp cairo m) +set(LIBRARIES lua5.1 honeysuckle assimp glfw) if (WIN32) - set(LIBRARIES ${LIBRARIES} glfw3 opengl32) + set(LIBRARIES ${LIBRARIES} opengl32) else() - set(LIBRARIES ${LIBRARIES} glfw GL dl) + set(LIBRARIES ${LIBRARIES} GL dl m) endif() target_link_libraries(honey ${LIBRARIES}) -- cgit v1.2.1 From 65ad3a58adcfe21690f379ab894a104b3852e3e9 Mon Sep 17 00:00:00 2001 From: sanine Date: Mon, 22 Aug 2022 10:31:56 -0500 Subject: refactor: move shader functions into separate file --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index b5e8502..618e8de 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,6 +36,7 @@ set(HONEY_LIB_FILES ${SRC_ROOT}/logging/logging.c ${SRC_ROOT}/gl/glad/glad.c ${SRC_ROOT}/gl/gl.c + ${SRC_ROOT}/gl/shader.c ${SRC_ROOT}/gl/window.c ) -- cgit v1.2.1 From dccc9bef56d51c5cad13c2568c5a3b97f637fd6e Mon Sep 17 00:00:00 2001 From: sanine Date: Mon, 22 Aug 2022 10:45:52 -0500 Subject: refactor: move drawing code into separate file --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 618e8de..02490f6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,6 +37,7 @@ set(HONEY_LIB_FILES ${SRC_ROOT}/gl/glad/glad.c ${SRC_ROOT}/gl/gl.c ${SRC_ROOT}/gl/shader.c + ${SRC_ROOT}/gl/drawing.c ${SRC_ROOT}/gl/window.c ) -- cgit v1.2.1 From a2c162f12337142c054c2e1f01ad508ee56963d2 Mon Sep 17 00:00:00 2001 From: sanine Date: Mon, 22 Aug 2022 11:00:42 -0500 Subject: refactor: move data functions into separate file --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 02490f6..dc9a83c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,6 +38,7 @@ set(HONEY_LIB_FILES ${SRC_ROOT}/gl/gl.c ${SRC_ROOT}/gl/shader.c ${SRC_ROOT}/gl/drawing.c + ${SRC_ROOT}/gl/data.c ${SRC_ROOT}/gl/window.c ) -- cgit v1.2.1 From b2c0dd12d2a39e74f8e6d63bffec073ef0871ea7 Mon Sep 17 00:00:00 2001 From: sanine Date: Mon, 22 Aug 2022 12:39:51 -0500 Subject: add uniforms --- CMakeLists.txt | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index dc9a83c..3796a43 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.2) -project(honey_engine_demo) +project(honey_engine) if (UNIX) set(CMAKE_C_FLAGS "-Wall -Wextra -Werror -Wfatal-errors -Wpedantic") @@ -32,22 +32,9 @@ add_subdirectory(${LIB_ROOT}/cglm) add_subdirectory(${LIB_ROOT}/glfw-3.3.8) -set(HONEY_LIB_FILES - ${SRC_ROOT}/logging/logging.c - ${SRC_ROOT}/gl/glad/glad.c - ${SRC_ROOT}/gl/gl.c - ${SRC_ROOT}/gl/shader.c - ${SRC_ROOT}/gl/drawing.c - ${SRC_ROOT}/gl/data.c - ${SRC_ROOT}/gl/window.c -) - -set(SOURCE_FILES - ${SRC_ROOT}/main.c - ${HONEY_LIB_FILES} - ) - -add_executable(honey ${SOURCE_FILES}) +set(HONEY_SOURCE ${SRC_ROOT}/main.c ${SRC_ROOT}/logging/logging.c) +add_executable(honey ${HONEY_SOURCE}) +add_subdirectory(${SRC_ROOT}/gl) set(LIBRARIES lua5.1 honeysuckle assimp glfw) if (WIN32) -- cgit v1.2.1 From d69f711275675d4b5da88117b14c1d15be232cf5 Mon Sep 17 00:00:00 2001 From: sanine Date: Mon, 22 Aug 2022 14:01:39 -0500 Subject: add image/ --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 3796a43..8b6c923 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,6 +35,7 @@ add_subdirectory(${LIB_ROOT}/glfw-3.3.8) set(HONEY_SOURCE ${SRC_ROOT}/main.c ${SRC_ROOT}/logging/logging.c) add_executable(honey ${HONEY_SOURCE}) add_subdirectory(${SRC_ROOT}/gl) +add_subdirectory(${SRC_ROOT}/image) set(LIBRARIES lua5.1 honeysuckle assimp glfw) if (WIN32) -- cgit v1.2.1 From 1f75a21851b0a0bd4bc766c458e67721dd37c9fd Mon Sep 17 00:00:00 2001 From: sanine Date: Mon, 22 Aug 2022 21:37:12 -0500 Subject: add append_table() --- CMakeLists.txt | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 8b6c923..17bf14d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,10 +32,8 @@ add_subdirectory(${LIB_ROOT}/cglm) add_subdirectory(${LIB_ROOT}/glfw-3.3.8) -set(HONEY_SOURCE ${SRC_ROOT}/main.c ${SRC_ROOT}/logging/logging.c) +set(HONEY_SOURCE ${SRC_ROOT}/main.c) add_executable(honey ${HONEY_SOURCE}) -add_subdirectory(${SRC_ROOT}/gl) -add_subdirectory(${SRC_ROOT}/image) set(LIBRARIES lua5.1 honeysuckle assimp glfw) if (WIN32) @@ -51,18 +49,15 @@ target_link_libraries(honey ${LIBRARIES}) string(LENGTH "${CMAKE_SOURCE_DIR}/" SOURCE_PATH_SIZE) add_definitions("-DSOURCE_PATH_SIZE=${SOURCE_PATH_SIZE}") -set(TEST_SOURCES - ${SRC_ROOT}/test/lily-test.c - ${SRC_ROOT}/test/honey-test.c - - ${SRC_ROOT}/logging/logging.test.c - ${SRC_ROOT}/gl/glad/glad.c - ${SRC_ROOT}/gl/gl.test.c - ${SRC_ROOT}/gl/window.test.c -) - -add_executable(test EXCLUDE_FROM_ALL ${TEST_SOURCES}) +add_executable(test EXCLUDE_FROM_ALL) set_target_properties(test PROPERTIES C_STANDARD 99 CMAKE_C_FLAGS "-Wall -Wextra -Werror -Wfatal-errors -Wpedantic") target_link_libraries(test lua5.1 honeysuckle glfw dl) + + +add_subdirectory(${SRC_ROOT}/gl) +add_subdirectory(${SRC_ROOT}/logging) +add_subdirectory(${SRC_ROOT}/image) +add_subdirectory(${SRC_ROOT}/util) +add_subdirectory(${SRC_ROOT}/test) -- cgit v1.2.1 From ae4e17fc743ca0344af818ab767db7311ea7829c Mon Sep 17 00:00:00 2001 From: sanine Date: Tue, 23 Aug 2022 13:28:01 -0500 Subject: add basic transforms --- CMakeLists.txt | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 17bf14d..ea8fca3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,17 +16,19 @@ include_directories( ${CMAKE_SOURCE_DIR}/src ${LIB_ROOT}/honeysuckle/src ${LIB_ROOT}/glfw-3.3.8/include + ${LIB_ROOT}/cglm/include ) +# disable byte-alignment in cglm +add_definitions(-DCGLM_ALL_UNALIGNED) + # link to third-party included libraries link_directories(${LIB_ROOT}/assimp/lib) link_directories(${LIB_ROOT}/honeysuckle) link_directories(${LIB_ROOT}/glfw-3.3.8/src) -# add_library(glad ${SRC_ROOT}/gl/glad/glad.c) -# add_library(stb_image src/stb_image/stb_image.c) add_subdirectory(${LIB_ROOT}/lua-5.1.5) -add_subdirectory(${LIB_ROOT}/assimp) +#add_subdirectory(${LIB_ROOT}/assimp) add_subdirectory(${LIB_ROOT}/honeysuckle) add_subdirectory(${LIB_ROOT}/cglm) add_subdirectory(${LIB_ROOT}/glfw-3.3.8) @@ -35,7 +37,7 @@ add_subdirectory(${LIB_ROOT}/glfw-3.3.8) set(HONEY_SOURCE ${SRC_ROOT}/main.c) add_executable(honey ${HONEY_SOURCE}) -set(LIBRARIES lua5.1 honeysuckle assimp glfw) +set(LIBRARIES lua5.1 honeysuckle glfw) if (WIN32) set(LIBRARIES ${LIBRARIES} opengl32) else() @@ -61,3 +63,4 @@ add_subdirectory(${SRC_ROOT}/logging) add_subdirectory(${SRC_ROOT}/image) add_subdirectory(${SRC_ROOT}/util) add_subdirectory(${SRC_ROOT}/test) +add_subdirectory(${SRC_ROOT}/glm) -- cgit v1.2.1