Compare commits
1 Commits
Prerelease
...
Prerelease
Author | SHA1 | Date | |
---|---|---|---|
93612bb816 |
@@ -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)
|
||||
|
19
main.cpp
19
main.cpp
@@ -1,9 +1,6 @@
|
||||
//#include <GL/glew.h>
|
||||
#include <glad/glad.h>
|
||||
#include <JGL/JGL.h>
|
||||
#include <rewindow/types/window.h>
|
||||
#include <iostream>
|
||||
#include <LearnOpenGL/Shader.h>
|
||||
#include <JGL/Colors.h>
|
||||
#include <J3ML/LinearAlgebra/Vector2.h>
|
||||
|
||||
@@ -23,21 +20,6 @@ struct Character
|
||||
|
||||
std::map<char, Character> 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) :
|
||||
|
@@ -4,7 +4,6 @@
|
||||
|
||||
#include <glad/glad.h>
|
||||
#include <JGL/JGL.h>
|
||||
#include <J3ML/LinearAlgebra/Transform2D.h>
|
||||
#include <freetype2/ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
#include <JGL/Color3.h>
|
||||
@@ -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;
|
||||
|
Reference in New Issue
Block a user