Small restructure.
Some checks failed
Run ReCI Build Test / Explore-Gitea-Actions (push) Has been cancelled

This commit is contained in:
2025-01-20 16:32:09 -05:00
parent e8245c4442
commit 7b2f7de032
13 changed files with 18 additions and 55 deletions

View File

@@ -46,23 +46,18 @@ CPMAddPackage(
)
if (WIN32)
#CPMAddPackage(
#NAME harfbuzz
#URL https://github.com/harfbuzz/harfbuzz/archive/refs/tags/9.0.0.zip
#)
CPMAddPackage(
NAME freetype
URL https://github.com/freetype/freetype/archive/refs/tags/VER-2-13-2.zip
)
endif()
#set(CMAKE_CXX_FLAGS "-O3 -Wall -Wextra")
set(CMAKE_CXX_FLAGS "-O3 -Wall -Wextra")
file(COPY "assets" DESTINATION "${PROJECT_BINARY_DIR}")
file(GLOB_RECURSE ASSETS "assets/*")
file(GLOB_RECURSE HEADERS "include/*.h" "include/*.hpp" )
file(GLOB_RECURSE SOURCES "src/*.c" "src/*.cpp" "src/internals/*.h")
file(GLOB_RECURSE SOURCES "src/*.c" "src/*.cpp" "src/renderer/OpenGL/internals/*.h")
find_package(OpenGL REQUIRED)

View File

@@ -5,7 +5,7 @@
#include <glad/glad.h>
#include <JGL/JGL.h>
#include <JGL/logger/logger.h>
#include "internals/include/internals.h"
#include "renderer/OpenGL/internals/internals.h"
namespace JGL {
using namespace J3ML;

View File

@@ -1,4 +1,4 @@
#include <JGL/JGL.h>
#include "JGL/JGL.h"
void JGL::ShapeCache::Init() {
std::array<Vector3, 8> vertices = {

View File

@@ -1,9 +0,0 @@
#pragma once
#include <string>
namespace JGL {
class VertexArray;
/*
VertexArray LoadAMO(const std::string& file_text);
*/
}

View File

@@ -1,9 +0,0 @@
#pragma once
#include <string>
namespace JGL {
class VertexArray;
// Currently requires "Triangulate Mesh" ticked in Blender.
// TODO use the number of slashes in the first "face-line" to detect quads.
VertexArray LoadWavefrontOBJ(const std::string& file_text);
}

View File

@@ -1,7 +1,7 @@
#include <JGL/JGL.h>
#include <JGL/logger/logger.h>
#include <J3ML/Algorithm/Bezier.hpp>
#include "../internals/include/internals.h"
#include "internals/internals.h"
void JGL::J2D::Begin(RenderTarget* rt, bool clear_buffers) {
GLfloat old_clear_color[4];

View File

@@ -4,7 +4,7 @@
#include <J3ML/Geometry/OBB.hpp>
#include <J3ML/Algorithm/Bezier.hpp>
#include <JGL/types/Light.h>
#include "../internals/include/internals.h"
#include "internals/internals.h"
std::array<GLfloat, 16> JGL::OpenGLPerspectiveProjectionRH(float fovY, float aspect, float z_near, float z_far) {

View File

@@ -1,11 +1,11 @@
#include <JGL/JGL.h>
#include "../internals/include/internals.h"
#include "internals/internals.h"
#if __linux__
#include <freetype2/ft2build.h>
#include FT_FREETYPE_H
#include FT_OUTLINE_H
#include FT_FREETYPE_H"freetype/freetype.h""freetype/freetype.h"
#include FT_OUTLINE_H"freetype/ftoutln.h""freetype/ftoutln.h"
#endif
#if _WIN32

View File

@@ -1,6 +1,6 @@
#include "../include/internals.h"
#include "J3ML/LinearAlgebra/Vector4.hpp"
#include "JGL/types/Light.h"
#include "internals.h"
#include <J3ML/LinearAlgebra/Vector4.hpp>
#include <JGL/types/Light.h>
// TODO handle the case that a required light is in the list of optional lights.
void JGL::J3D::SelectLights(const Vector3& position) {

View File

@@ -1,13 +1,12 @@
/// Things used in J2D and J3D that should not be exposed to the user of the library.
#pragma once
#include "glad/glad.h"
#include <glad/glad.h>
#include <array>
#include <vector>
#include "J3ML/LinearAlgebra/Vector2.hpp"
#include "JGL/types/RenderTarget.h"
#include "JGL/types/Light.h"
#include "JGL/logger/logger.h"
#include <J3ML/LinearAlgebra/Vector2.hpp>
#include <JGL/types/RenderTarget.h>
#include <JGL/types/Light.h>
#include <JGL/logger/logger.h>
namespace JGL {
inline constexpr std::array<const LightBase*, 8> empty_light_array = { nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr };
@@ -55,5 +54,4 @@ namespace JGL::J3D {
// Resets the GL lights to default and disables them. Then, disables lighting.
void ResetLights();
[[nodiscard]] bool UsingLighting();
}

View File

@@ -1,7 +1,5 @@
#include <JGL/types/VertexArray.h>
#include <JGL/logger/logger.h>
#include "../internals/include/WavefrontOBJ.h"
#include "../internals/include/AMO.h"
using namespace JGL;
@@ -179,11 +177,3 @@ VertexArray::VertexArray(const std::vector<Vertex>& vertex_positions, const std:
bool VertexArray::Static() {
return animations.empty();
}
VertexArray VertexArray::LoadWavefrontOBJ(const std::string& file_text) {
return JGL::LoadWavefrontOBJ(file_text);
}
VertexArray VertexArray::LoadAMO(const std::string& file_text) {
//return JGL::LoadAMO(file_text);
}

View File

@@ -1,5 +1,3 @@
#include "../include/WavefrontOBJ.h"
#include "../include/AMO.h"
#include <JGL/types/VertexArray.h>
#include <JGL/logger/logger.h>
@@ -116,7 +114,7 @@ std::pair<std::array<Vector3, 3>, unsigned long> ParseWavefrontFaceData(const st
return {face_data, new_offset};
}
VertexArray JGL::LoadWavefrontOBJ(const std::string &file_text) {
VertexArray VertexArray::LoadWavefrontOBJ(const std::string &file_text) {
std::vector<std::array<Vector3, 3>> faceline_data;
std::vector<TextureCoordinate> temp_uvs;