Broken Text

This commit is contained in:
2024-02-20 17:51:44 -05:00
parent 79ba5d8933
commit 02c10facd8
6 changed files with 30 additions and 15 deletions

View File

@@ -55,10 +55,10 @@ CPMAddPackage(
URL https://git.redacted.cc/josh/j3ml/archive/Prerelease-18.zip
)
#Causes multiple definition
#CPMAddPackage(
#NAME JGL
#URL https://git.redacted.cc/josh/JGL/archive/Prerelease-3.zip
#)
CPMAddPackage(
NAME JGL
URL https://git.redacted.cc/josh/JGL/archive/Prerelease-4.zip
)
CPMAddPackage(
NAME SOIL
@@ -109,9 +109,10 @@ include_directories(
${ASSIMP_SOURCE_DIR}/include
${archive_SOURCE_DIR}/include
${PROJECT_BINARY_DIR}/glu/include
${JGL_SOURCE_DIR}/include
)
if(UNIX AND NOT APPLE)
target_link_libraries(Re3D_Demo PUBLIC Re3D ReWindowLibrary ReHardwareID J3ML soil uuid_v4 GL glad assimp archive ${PROJECT_BINARY_DIR}/lib/libGLU.so)
target_link_libraries(Re3D_Demo PUBLIC Re3D ReWindowLibrary ReHardwareID J3ML JGL soil uuid_v4 GL glad assimp archive ${PROJECT_BINARY_DIR}/lib/libGLU.so)
endif()
if(WIN32)

View File

@@ -7,6 +7,7 @@
#include <fstream>
#include <engine/world.h>
#include <rewindow/types/window.h>
enum class GAMESTATE: uint8_t {
NORMAL = 0, //Gameplay.
IN_MAIN_MENU = 1,
@@ -24,7 +25,6 @@ enum class ENGINE_ERROR_CODE: uint8_t {
INVALID_SHADER_TYPE = 5,
SHADER_NOT_FOUND = 6,
MODEL_NOT_FOUND = 7,
};
struct EngineError {

View File

@@ -41,7 +41,7 @@ void Engine::initGL()
exit (1);
}
glClearColor(0.f, 0.f, 0.f, 1.f);
glViewport(0,0,window->getSize()[0],window->getSize()[1]);
glViewport(0,0,window->getSize().x,window->getSize().y);
glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LESS);
glDepthMask(GL_TRUE);
@@ -90,6 +90,7 @@ void Engine::debugInfo() const {
//}
//}
}
float Engine::framerate() const
{
return 1.f / this->frameDelta;

View File

@@ -5,15 +5,18 @@
#include <types/entity/camera.h>
#include <types/entity/player.h>
#include <types/entity/skybox.h>
#include <JGL/JGL.h>
void Render::pre_render() {
// NO
if (engine->frameCount == 0) {
engine->window->init(RenderingAPI::OPENGL, "Re: 3D", 1152, 864, false);
engine->window->setFlag(RWindowFlags::RESIZABLE, false);
engine->window->setFlag(RWindowFlags::RESIZABLE, true);
engine->initGL();
engine->loadConfig();
JGL::InitTextEngine();
auto* camera = new Camera();
camera->SetPos({0.0f, -2.0f, -5.0f});
camera->angle.y = 0.0f;
@@ -68,10 +71,10 @@ void Render::pre_render() {
void Render::render() {
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
//glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
//glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
//glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
//glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
//TODO: *Always* render the camera first.
glCullFace(GL_BACK);
for (auto& e : engine->world->GetChildren()) {

View File

@@ -1,6 +1,8 @@
#include <types/entity/camera.h>
#include <engine/occlusion.h>
#include <types/entity/player.h>
// Even tho CLion reports this as const-qualifiable
// It is not in "intent" (obviously the gametick changes gamestate)
void Camera::update()

View File

@@ -4,6 +4,8 @@
#include <collision.h>
#include <uuid_v4.h>
#include <collision.h>
#include "JGL/JGL.h"
#include "JGL/Colors.h"
//inline LinearAlgebra::Vector3 Entity::GetPos() const
//{ return LinearAlgebra::Vector3(coordinates[1]); }
@@ -47,8 +49,6 @@ Entity::Entity() {
UUIDv4::UUIDGenerator<std::mt19937_64> uuidGenerator;
UUIDv4::UUID id = uuidGenerator.getUUID();
uuid = id.bytes();
}
void Entity::setScale(const float &multiplier) {
@@ -136,7 +136,7 @@ VertexArray* Entity::getGeometry() {
void Entity::render() {
//JGL::J3D::DrawString3D(JGL::Colors::Yellow, "ENTITY", position, 1.f);
bool cameraInside = false;
@@ -187,4 +187,12 @@ void Entity::render() {
if (engine->world->getGlobalFogMode() != NULL)
glEnable(GL_FOG);
//glPushMatrix();
//glOrtho(0, 1024, 768, 0, -1, 1);
//JGL::J2D::DrawString2D(JGL::Colors::Blue, "ENTITY", position.x, position.y, 1.f);
//JGL::J3D::DrawString3D(JGL::Colors::Blue, "ENTITY", position, 1.f);
//glPopMatrix();
}