Remove use of <glm/detail/*>

These files are GLM internal and change over time
This commit is contained in:
Dorian Wouters 2018-09-17 00:14:38 +02:00
parent de2d5744cc
commit 4255b63652
No known key found for this signature in database
GPG Key ID: 6E9DA8063322434B
18 changed files with 46 additions and 41 deletions

View File

@ -10,7 +10,6 @@
#include <AL/al.h>
#endif
#include <glm/detail/setup.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp>

View File

@ -9,8 +9,6 @@
#define GLFW_INCLUDE_NONE
#include <GLFW/glfw3.h>
#include <glm/detail/type_mat.hpp>
#include "StateMachine.hpp"
#include "Platform.hpp"
#include "platform/Types.hpp"

View File

@ -76,7 +76,7 @@ Skybox::Skybox(Game *G, const std::string &skyName) : G(G) {
m_vbo.setData(coords, 6*6);
}
void Skybox::render(const glm::mat4 &transform) const {
void Skybox::render(const mat4 &transform) const {
RenderProgram->bind();
m_vbo.bind();
glEnableVertexAttribArray(RenderProgram_attrib_coord);

View File

@ -1,7 +1,7 @@
#ifndef SKYBOX_HPP
#define SKYBOX_HPP
#include <glm/detail/type_mat.hpp>
#include "platform/types/mat4.hpp"
#include "render/gl/VBO.hpp"
#include "Game.hpp"
@ -28,7 +28,7 @@ private:
public:
Skybox(Game *G, const std::string &skyName);
~Skybox();
void render(const glm::mat4 &transform) const;
void render(const mat4 &transform) const;
};
}

View File

@ -7,9 +7,9 @@
namespace diggler {
using mat2f = glm::tmat2x2<float>;
using mat2d = glm::tmat2x2<double>;
using mat2 = mat2d;
using mat2f = glm::tmat2x2<float>;
using mat2d = glm::tmat2x2<double>;
using mat2 = mat2f;
}

View File

@ -7,9 +7,9 @@
namespace diggler {
using mat3f = glm::tmat3x3<float>;
using mat3d = glm::tmat3x3<double>;
using mat3 = mat3d;
using mat3f = glm::tmat3x3<float>;
using mat3d = glm::tmat3x3<double>;
using mat3 = mat3f;
}

View File

@ -9,7 +9,7 @@ namespace diggler {
using mat4f = glm::tmat4x4<float>;
using mat4d = glm::tmat4x4<double>;
using mat4 = mat4d;
using mat4 = mat4f;
}

View File

@ -23,7 +23,7 @@ using vec2ivt = vec2i::value_type;
using vec2f = glm::tvec2<float>;
using vec2d = glm::tvec2<double>;
using vec2 = vec2d;
using vec2 = vec2f;
using vec2vt = vec2::value_type;
}

View File

@ -23,7 +23,7 @@ using vec3ivt = vec3i::value_type;
using vec3f = glm::tvec3<float>;
using vec3d = glm::tvec3<double>;
using vec3 = vec3d;
using vec3 = vec3f;
using vec3vt = vec3::value_type;
}

View File

@ -23,7 +23,7 @@ using vec4ivt = vec4i::value_type;
using vec4f = glm::tvec4<float>;
using vec4d = glm::tvec4<double>;
using vec4 = vec4d;
using vec4 = vec4f;
using vec4vt = vec4::value_type;
}

View File

@ -42,7 +42,7 @@ void Button::onCursorEnter(int x, int y) {
void Button::onCursorLeave(int x, int y) {
}
void Button::render(const glm::mat4 &matrix) const {
void Button::render(const mat4 &matrix) const {
M->drawRect(matrix, glm::vec4(1, 1, 1, isCursorOver() ? 0.5 : 0.3));
m_text->render(matrix);
}

View File

@ -31,7 +31,7 @@ public:
void onCursorEnter(int x, int y) override;
void onCursorLeave(int x, int y) override;
void render(const glm::mat4&) const override;
void render(const mat4&) const override;
using Element::render;
};

View File

@ -3,7 +3,7 @@
#include "../Platform.hpp"
#include <glm/detail/type_mat3x3.hpp>
#include "../platform/types/mat4.hpp"
namespace diggler {
@ -89,7 +89,7 @@ public:
virtual void setVisible(bool v) { m_isVisible = v; }
bool isVisible() const { return m_isVisible; }
virtual void render(const glm::mat4&) const = 0;
virtual void render(const mat4&) const = 0;
void render() const;
};

View File

@ -1,7 +1,12 @@
#ifndef UI_MANAGER_HPP
#define UI_MANAGER_HPP
#include <list>
#include <memory>
#include "../platform/types/mat4.hpp"
#include "../platform/types/vec4.hpp"
#include "Element.hpp"
namespace diggler {
@ -24,17 +29,17 @@ private:
std::list<std::weak_ptr<Element>> m_elements;
std::weak_ptr<Element> m_hoveredElement;
std::weak_ptr<Element> m_focusedElement;
glm::mat4 m_projMatrix, m_projMat1, m_projMat1V;
mat4 m_projMatrix, m_projMat1, m_projMat1V;
friend GameWindow;
void setProjMat(const glm::mat4&);
void setProjMat(const mat4&);
void add(std::weak_ptr<Element>);
template<class T, typename... Args> std::shared_ptr<T> create(Args&&... args) {
return std::make_shared<T>(this, std::forward<Args>(args)...);
}
public:
const glm::mat4 *PM, *PM1;
const mat4 *PM, *PM1;
Game *G;
int scale;
@ -67,16 +72,16 @@ public:
// Utility
void drawRect(const glm::mat4&, const Element::Area&, const glm::vec4 &color) const;
void drawRect(const glm::mat4&, int w, int h, const glm::vec4 &color) const;
void drawRect(const glm::mat4&, const glm::vec4 &color) const;
void drawFullRect(const glm::vec4 &color) const;
void drawTex(const glm::mat4&, const Element::Area&, const Texture&) const;
void drawTex(const glm::mat4&, int w, int h, const Texture&) const;
void drawTex(const glm::mat4&, const Texture&) const;
void drawTex(const glm::mat4&, const Texture&, const glm::vec4 &color) const;
void drawRect(const mat4&, const Element::Area&, const vec4 &color) const;
void drawRect(const mat4&, int w, int h, const vec4 &color) const;
void drawRect(const mat4&, const vec4 &color) const;
void drawFullRect(const vec4 &color) const;
void drawTex(const mat4&, const Element::Area&, const Texture&) const;
void drawTex(const mat4&, int w, int h, const Texture&) const;
void drawTex(const mat4&, const Texture&) const;
void drawTex(const mat4&, const Texture&, const vec4 &color) const;
void drawFullTexV(const Texture&) const;
void drawFullTexV(const Texture&, const glm::vec4 &color) const;
void drawFullTexV(const Texture&, const vec4 &color) const;
// Render

View File

@ -1,5 +1,8 @@
#ifndef RECT_HPP
#define RECT_HPP
#include "../platform/types/mat4.hpp"
#include "Element.hpp"
namespace diggler {
@ -9,7 +12,7 @@ class Rect : public Element {
private:
class VBO m_vbo;
Color m_color;
glm::mat4 m_mat;
mat4 m_mat;
class Texture *m_tex;
public:
@ -31,4 +34,4 @@ public:
}
}
#endif
#endif

View File

@ -60,7 +60,7 @@ void Text::setScale(int scaleX, int scaleY) {
}
void Text::updateMatrix() {
m_matrix = glm::scale(glm::mat4(), glm::vec3(m_scaleX, m_scaleY, 1.f));
m_matrix = glm::scale(mat4(), vec3(m_scaleX, m_scaleY, 1.f));
}
void Text::updateText() {
@ -70,7 +70,7 @@ void Text::updateText() {
M->G->FM->getFont(m_fontName)->updateTextBuffer(m_textBuf, m_text);
}
void Text::render(const glm::mat4 &matrix) const {
void Text::render(const mat4 &matrix) const {
if (m_textBuf) {
M->G->FM->getFont(m_fontName)->draw(m_textBuf, matrix * m_matrix);
}

View File

@ -16,7 +16,7 @@ private:
render::FontRendererTextBufferUsage m_textBufUsage;
render::FontRendererTextBufferRef m_textBuf;
std::string m_fontName;
glm::mat4 m_matrix;
mat4 m_matrix;
std::string m_text;
Text(const Text&) = delete;
@ -56,7 +56,7 @@ public:
void setFont(const std::string &name);
void setScale(int scaleX, int scaleY);
Size getSize() const;
void render(const glm::mat4&) const override;
void render(const mat4&) const override;
using Element::render;
};

View File

@ -4,9 +4,9 @@
#include <sstream>
#include <string>
#include <glm/detail/type_vec2.hpp>
#include <glm/detail/type_vec3.hpp>
#include <glm/detail/type_vec4.hpp>
#include <glm/vec2.hpp>
#include <glm/vec3.hpp>
#include <glm/vec4.hpp>
#include "../Encoding.hpp"