glad (used for gl extensions)

This commit is contained in:
2024-01-26 10:12:18 -05:00
parent 2e367e2576
commit 690270b63d
7 changed files with 23 additions and 9 deletions

View File

@@ -65,6 +65,10 @@ CPMAddPackage(
NAME uuid_v4
URL https://github.com/RedactedSoftware/uuid_v4/archive/refs/tags/v1.zip
)
CPMAddPackage(
NAME glad
URL https://git.redacted.cc/Redacted/glad/archive/v1.1.zip
)
add_library(Re3D SHARED ${SOURCES})
# Why god???
set_target_properties(Re3D PROPERTIES LINKER_LANGUAGE CXX)
@@ -81,14 +85,15 @@ include_directories(
${ReHardwareID_SOURCE_DIR}/include
${J3ML_SOURCE_DIR}/include
${SOIL_SOURCE_DIR}/include
${glad_SOURCE_DIR}/include
${uuid_v4_SOURCE_DIR}/
${PROJECT_BINARY_DIR}/glu/include
)
if(UNIX AND NOT APPLE)
target_link_libraries(Re3D_Demo PUBLIC Re3D ReWindowLibrary ReHardwareID J3ML soil uuid_v4 GL ${PROJECT_BINARY_DIR}/lib/libGLU.so)
target_link_libraries(Re3D_Demo PUBLIC Re3D ReWindowLibrary ReHardwareID J3ML soil uuid_v4 GL glad ${PROJECT_BINARY_DIR}/lib/libGLU.so)
endif()
if(WIN32)
target_link_libraries(Re3D_Demo PUBLIC Re3D ReWindowLibrary ReHardwareID J3ML soil uuid_v4 GL GLU)
target_link_libraries(Re3D_Demo PUBLIC Re3D ReWindowLibrary ReHardwareID J3ML soil uuid_v4 GL GLU glad)
endif()

View File

@@ -5,7 +5,6 @@
#include <cstring>
#include <iostream>
#include <fstream>
#include <GL/gl.h>
#include <engine/world.h>
#include <rewindow/types/window.h>
enum class GAMESTATE: uint8_t {
@@ -26,6 +25,7 @@ public:
//float tickDelta = NULL;
bool fullscreen;
bool debug = true;
bool useVBO = false;
uint64_t tickCount = 0;
uint64_t frameCount = 0;
float frameDelta = NULL;

View File

@@ -1,6 +1,6 @@
#pragma once
#include <GL/gl.h>
#include <glad/glad.h>
#include <GL/glu.h>
#include <vector>
#include <string>

View File

@@ -4,7 +4,7 @@
#include <iostream>
#include <fstream>
#include <sstream>
#include <GL/gl.h>
#include <glad/glad.h>
#include <J3ML/LinearAlgebra/Vector3.h>
#include <J3ML/LinearAlgebra/Vector2.h>
#include <types/texture.h>
@@ -24,4 +24,10 @@ public:
void load(const std::string& filename);
void drawWireframe();
void draw();
};
class VertexBufferObject {
std::string name;
GLuint vbo = NULL;
void load(const VertexArray* vArray);
};

View File

@@ -1,8 +1,6 @@
#include <engine/engine.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include <sstream>
#include <engine/world.h>
void Engine::quit() {
@@ -19,6 +17,7 @@ float Engine::getGLVersion()
void Engine::initGL()
{
gladLoadGL();
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
//glOrtho(-1.0f, 1.0f, -1.0f, 1.0f, -0.5f, 0.5f);
@@ -49,7 +48,6 @@ void Engine::initGL()
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);
glEnable(GL_COLOR_MATERIAL);
//glDepthRange(-0.5f,0.5f);
}

View File

@@ -126,4 +126,4 @@ void VertexArray::rotate(const LinearAlgebra::Vector3& angle) {
vertex.y = newY;
vertex.z = newZ;
}
}
}

View File

@@ -0,0 +1,5 @@
#include <types/vertex.h>
void VertexBufferObject::load(const VertexArray *vArray) {
if (vbo == NULL) {
}
}