diff --git a/CMakeLists.txt b/CMakeLists.txt index c759abf..3638a82 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,49 +21,38 @@ include(cmake/CPM.cmake) CPMAddPackage( NAME J3ML - URL https://git.redacted.cc/josh/j3ml/archive/Release-1.zip + URL https://git.redacted.cc/josh/j3ml/archive/Release-6.zip ) CPMAddPackage( NAME ReWindow - URL https://git.redacted.cc/Redacted/ReWindow/archive/vA0.2.23.zip + URL https://git.redacted.cc/Redacted/ReWindow/archive/vA0.2.30.zip ) CPMAddPackage( NAME GLAD URL https://git.redacted.cc/Redacted/glad/archive/v2.1.zip ) - - -CPMAddPackage( - NAME LearnOpenGL - URL https://git.redacted.cc/josh/LearnOpenGL/archive/Prerelease-4.zip -) - +file(COPY "assets" DESTINATION "${PROJECT_BINARY_DIR}") file(GLOB_RECURSE HEADERS "include/*.h" "include/*.hpp") file(GLOB_RECURSE SOURCES "src/*.c" "src/*.cpp" ) -file(GLOB_RECURSE ASSETS "content/*") +file(GLOB_RECURSE ASSETS "assets/*") add_library(JGL SHARED ${SOURCES}) set_target_properties(JGL PROPERTIES LINKER_LANGUAGE CXX) find_package(OpenGL REQUIRED) -find_package(GLUT REQUIRED) find_package(Freetype REQUIRED) add_executable(JGL_Demo main.cpp) set_target_properties(JGL_Demo PROPERTIES LINK_FLAGS "-Wl,-rpath,./lib") include_directories(${PROJECT_SOURCE_DIR}/include) include_directories(${OPENGL_INCLUDE_DIRS}) -include_directories(${GLUT_INCLUDE_DIRS}) include_directories(${J3ML_SOURCE_DIR}/include) include_directories(${ReWindow_SOURCE_DIR}/include) include_directories(${glad_SOURCE_DIR}/include) -target_include_directories(JGL PUBLIC ${LearnOpenGL_SOURCE_DIR}/include) -target_link_libraries(JGL PUBLIC LearnOpenGL) - target_include_directories(JGL PRIVATE ${FREETYPE_INCLUDE_DIRS}) target_link_libraries(JGL PRIVATE ${FREETYPE_LIBRARIES}) target_include_directories(JGL PRIVATE ${FREETYPE_INCLUDE_DIRS}) -target_link_libraries(JGL_Demo PUBLIC JGL ${OPENGL_LIBRARIES} ${GLUT_LIBRARIES} J3ML ReWindowLibrary GLEW glad) +target_link_libraries(JGL_Demo PUBLIC JGL ${OPENGL_LIBRARIES} J3ML ReWindowLibrary glad) diff --git a/content/FreeSans.ttf b/assets/fonts/FreeSans.ttf similarity index 100% rename from content/FreeSans.ttf rename to assets/fonts/FreeSans.ttf diff --git a/main.cpp b/main.cpp index 3e83820..1f4ae5c 100644 --- a/main.cpp +++ b/main.cpp @@ -1,9 +1,6 @@ -//#include #include #include #include -#include -#include #include #include @@ -23,21 +20,6 @@ struct Character std::map Characters; GLuint VAO, VBO; -const std::string vertexShader = "attribute vec4 coord;\n" - "varying vec2 texpos;\n" - "\n" - "void main(void) {\n" - " gl_Position = vec4(coord.xy, 0, 1);\n" - " texpos = coord.zw;\n" - "}\n" - ""; -const std::string fragmentShader = "varying vec2 texpos;\n" - "uniform sampler2D tex;\n" - "uniform vec4 color;\n" - "\n" - "void main(void) {\n" - " gl_FragColor = vec4(1, 1, 1, texture2D(tex, texpos).a) * color;\n" - "}"; using J3ML::LinearAlgebra::Matrix4x4; @@ -51,7 +33,6 @@ struct point { class JGLDemoWindow : public ReWindow::RWindow { public: - LearnOpenGL::Shader shader; JGLDemoWindow() : ReWindow::RWindow() {} JGLDemoWindow(const std::string& title, int width, int height) : diff --git a/src/JGL/JGL.cpp b/src/JGL/JGL.cpp index 547a256..04c6083 100644 --- a/src/JGL/JGL.cpp +++ b/src/JGL/JGL.cpp @@ -4,7 +4,6 @@ #include #include -#include #include #include FT_FREETYPE_H #include @@ -29,7 +28,7 @@ namespace JGL return false; } - if (FT_New_Face(ft, "content/FreeSans.ttf", 0, &face)) + if (FT_New_Face(ft, "assets/fonts/FreeSans.ttf", 0, &face)) { std::cout << "Error::FREETYPE: Failed to load font!" << std::endl; return false;