diff --git a/src/app/app.h b/src/app/app.h index 45e41464..14f8d6fb 100644 --- a/src/app/app.h +++ b/src/app/app.h @@ -32,7 +32,7 @@ #include "graphics/core/device.h" #include "level/level_category.h" - +#include "math/intpoint.h" #include #include diff --git a/src/graphics/core/device.h b/src/graphics/core/device.h index 45659986..6db6891b 100644 --- a/src/graphics/core/device.h +++ b/src/graphics/core/device.h @@ -28,7 +28,7 @@ #include "graphics/core/texture.h" #include "graphics/core/vertex.h" -#include "math/intpoint.h" +#include #include #include @@ -70,7 +70,7 @@ struct VertexTex2; struct DeviceConfig { //! Screen size - Math::IntPoint size = Math::IntPoint(800, 600); + glm::ivec2 size = { 800, 600 }; //! Bits per pixel int bpp = 32; //! Full screen @@ -474,7 +474,7 @@ public: //! Creates a depth texture with specific dimensions and depth virtual Texture CreateDepthTexture(int width, int height, int depth) = 0; //! Updates a part of texture from raw image data - virtual void UpdateTexture(const Texture& texture, Math::IntPoint offset, ImageData* data, TexImgFormat format) = 0; + virtual void UpdateTexture(const Texture& texture, const glm::ivec2& offset, ImageData* data, TexImgFormat format) = 0; //! Deletes a given texture, freeing it from video memory virtual void DestroyTexture(const Texture &texture) = 0; //! Deletes all textures created so far diff --git a/src/graphics/core/texture.h b/src/graphics/core/texture.h index 8d8694a1..0a074a94 100644 --- a/src/graphics/core/texture.h +++ b/src/graphics/core/texture.h @@ -27,7 +27,7 @@ #include "graphics/core/color.h" -#include "math/intpoint.h" +#include // Graphics module namespace @@ -217,9 +217,9 @@ struct Texture //! ID of the texture in graphics engine; 0 = invalid texture unsigned int id = 0; //! Size of texture - Math::IntPoint size; + glm::ivec2 size; //! Original size of texture (as loaded from image) - Math::IntPoint originalSize; + glm::ivec2 originalSize; //! Whether the texture has alpha channel bool alpha = false; diff --git a/src/graphics/opengl/gl33device.cpp b/src/graphics/opengl/gl33device.cpp index bdffcf6a..285bd84d 100644 --- a/src/graphics/opengl/gl33device.cpp +++ b/src/graphics/opengl/gl33device.cpp @@ -680,7 +680,7 @@ Texture CGL33Device::CreateTexture(CImage *image, const TextureCreateParams &par return Texture(); // invalid texture } - Math::IntPoint originalSize = image->GetSize(); + glm::ivec2 originalSize = image->GetSize(); if (params.padToNearestPowerOfTwo) image->PadToNearestPowerOfTwo(); @@ -810,7 +810,7 @@ Texture CGL33Device::CreateDepthTexture(int width, int height, int depth) return result; } -void CGL33Device::UpdateTexture(const Texture& texture, Math::IntPoint offset, ImageData* data, TexImgFormat format) +void CGL33Device::UpdateTexture(const Texture& texture, const glm::ivec2& offset, ImageData* data, TexImgFormat format) { if (texture.id == 0) return; diff --git a/src/graphics/opengl/gl33device.h b/src/graphics/opengl/gl33device.h index d89c67e8..70ea424a 100644 --- a/src/graphics/opengl/gl33device.h +++ b/src/graphics/opengl/gl33device.h @@ -135,7 +135,7 @@ public: Texture CreateTexture(CImage *image, const TextureCreateParams ¶ms) override; Texture CreateTexture(ImageData *data, const TextureCreateParams ¶ms) override; Texture CreateDepthTexture(int width, int height, int depth) override; - void UpdateTexture(const Texture& texture, Math::IntPoint offset, ImageData* data, TexImgFormat format) override; + void UpdateTexture(const Texture& texture, const glm::ivec2& offset, ImageData* data, TexImgFormat format) override; void DestroyTexture(const Texture &texture) override; void DestroyAllTextures() override; diff --git a/src/graphics/opengl/glutil.cpp b/src/graphics/opengl/glutil.cpp index 3fd3c0f9..0edfb838 100644 --- a/src/graphics/opengl/glutil.cpp +++ b/src/graphics/opengl/glutil.cpp @@ -629,7 +629,7 @@ GLint LinkProgram(const std::vector& shaders) return program; } -std::unique_ptr GetGLFrameBufferPixels(Math::IntPoint size) +std::unique_ptr GetGLFrameBufferPixels(const glm::ivec2& size) { auto pixels = MakeUnique(4 * size.x * size.y); diff --git a/src/graphics/opengl/glutil.h b/src/graphics/opengl/glutil.h index 84ce1670..37c29acb 100644 --- a/src/graphics/opengl/glutil.h +++ b/src/graphics/opengl/glutil.h @@ -26,10 +26,10 @@ #include "graphics/core/device.h" -#include "math/intpoint.h" #include "math/vector.h" #include +#include #include #include @@ -135,7 +135,7 @@ private: std::unique_ptr m_pixels; }; -std::unique_ptr GetGLFrameBufferPixels(Math::IntPoint size); +std::unique_ptr GetGLFrameBufferPixels(const glm::ivec2& size); struct LightLocations {