Did some tweaks to the CMakeLists

This commit is contained in:
2021-10-16 22:57:19 -07:00
parent d8ded38fd5
commit f7165daa6d
19 changed files with 178 additions and 243 deletions

View File

@ -3,12 +3,32 @@
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT
# Definitions
add_compile_definitions(
SETTING_PLATFORM_GLFW=1
SETTING_PLATFORM=1
SETTING_PLATFORM_USE_GLAD=1
)
# Libraries
target_link_libraries(${PROJECT_NAME}
PUBLIC
glfw
glad
)
# Sources
file(GLOB_RECURSE SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/*.c)
file(GLOB_RECURSE HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/*.h)
add_executable(${PROJECT_NAME} ${SOURCES})
target_link_libraries(${PROJECT_NAME}
game
glfw
glad
target_sources(${PROJECT_NAME}
PRIVATE
${SOURCES}
${HEADERS}
)
# Includes
target_include_directories(${PROJECT_NAME}
PUBLIC
${CMAKE_CURRENT_LIST_DIR}
)

View File

@ -72,6 +72,9 @@ int32_t main() {
inputBind(input, INPUT_MOUSE_X, GLFW_PLATFORM_INPUT_MOUSE_X);
inputBind(input, INPUT_MOUSE_Y, GLFW_PLATFORM_INPUT_MOUSE_Y);
// Set up the client
game->engine.client.setTitle = &glfwClientSetTitle;
// Set up some GLFW stuff
glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_NORMAL);
glfwSetWindowTitle(window, game->engine.name);
@ -139,4 +142,8 @@ inputsource_t glfwGetInputSourceForKey(int32_t key) {
key <= GLFW_KEY_MENU ? key - GLFW_KEY_ESCAPE + GLFW_KEY_GRAVE_ACCENT :
key
) % INPUT_SOURCE_COUNT);
}
void glfwClientSetTitle(char *name) {
glfwSetWindowTitle(window, name);
}

View File

@ -52,4 +52,7 @@ void glfwOnCursor(GLFWwindow *window, double x, double y);
* @param key Key to get the input source for.
* @return The input source.
*/
inputsource_t glfwGetInputSourceForKey(int32_t key);
inputsource_t glfwGetInputSourceForKey(int32_t key);
/** GLFW Client Methods */
void glfwClientSetTitle(char *name);