Migrated to cmake.
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@ -363,3 +363,5 @@ MigrationBackup/
|
|||||||
FodyWeavers.xsd
|
FodyWeavers.xsd
|
||||||
|
|
||||||
log.txt
|
log.txt
|
||||||
|
|
||||||
|
build/
|
@ -68,7 +68,6 @@ unsigned int shaderProgram;
|
|||||||
void GLAPIENTRY MessageCallback(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, const void* userparam) {
|
void GLAPIENTRY MessageCallback(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, const void* userparam) {
|
||||||
if (type == GL_DEBUG_TYPE_ERROR) {
|
if (type == GL_DEBUG_TYPE_ERROR) {
|
||||||
ERR("GL CALLBACK: ** GL ERROR ** type = {}, severity = {}, message = {}", type, severity, message);
|
ERR("GL CALLBACK: ** GL ERROR ** type = {}, severity = {}, message = {}", type, severity, message);
|
||||||
__debugbreak();
|
|
||||||
} else {
|
} else {
|
||||||
DEBUG("GL CALLBACK: type = {}, severity = {}, message = {}", type, severity, message);
|
DEBUG("GL CALLBACK: type = {}, severity = {}, message = {}", type, severity, message);
|
||||||
}
|
}
|
||||||
@ -83,7 +82,7 @@ void openGLContextInit() {
|
|||||||
INFO("GLAD Initialized");
|
INFO("GLAD Initialized");
|
||||||
int flags; glGetIntegerv(GL_CONTEXT_FLAGS, &flags);
|
int flags; glGetIntegerv(GL_CONTEXT_FLAGS, &flags);
|
||||||
if (!(flags & GL_CONTEXT_FLAG_DEBUG_BIT)){
|
if (!(flags & GL_CONTEXT_FLAG_DEBUG_BIT)){
|
||||||
ERROR("Failed to create Debug Context");
|
ERR("Failed to create Debug Context");
|
||||||
}
|
}
|
||||||
glEnable(GL_DEBUG_OUTPUT);
|
glEnable(GL_DEBUG_OUTPUT);
|
||||||
glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS);
|
glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS);
|
||||||
@ -209,7 +208,6 @@ int main() {
|
|||||||
init();
|
init();
|
||||||
|
|
||||||
std::thread renderThread(render);
|
std::thread renderThread(render);
|
||||||
Sleep(10);
|
|
||||||
update();
|
update();
|
||||||
renderThread.join();
|
renderThread.join();
|
||||||
|
|
||||||
|
18
CMakeLists.txt
Normal file
18
CMakeLists.txt
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.10)
|
||||||
|
project(2dGameProject)
|
||||||
|
file(GLOB 2dGameProject_SRC
|
||||||
|
"2dGameProject/*.h"
|
||||||
|
"2dGameProject/*.cpp"
|
||||||
|
)
|
||||||
|
find_package(OpenGL REQUIRED)
|
||||||
|
add_subdirectory(deps/glfw)
|
||||||
|
add_subdirectory(deps/glad)
|
||||||
|
add_executable(2dGameProject ${2dGameProject_SRC})
|
||||||
|
target_include_directories(2dGameProject PUBLIC
|
||||||
|
"${PROJECT_SOURCE_DIR}/deps/glfw/include"
|
||||||
|
"${PROJECT_SOURCE_DIR}/deps/glad/include"
|
||||||
|
"${PROJECT_SOURCE_DIR}/deps/glm"
|
||||||
|
"${PROJECT_SOURCE_DIR}/deps/spdlog/include"
|
||||||
|
)
|
||||||
|
|
||||||
|
target_link_libraries(2dGameProject PUBLIC glfw glad ${OPENGL_LIBRARIES})
|
6
deps/glad/CMakeLists.txt
vendored
Normal file
6
deps/glad/CMakeLists.txt
vendored
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.10)
|
||||||
|
project(glad)
|
||||||
|
add_library(glad src/glad.c)
|
||||||
|
target_include_directories(glad PUBLIC
|
||||||
|
"${PROJECT_SOURCE_DIR}/include"
|
||||||
|
)
|
Reference in New Issue
Block a user