Refactored Math::IntPoint in core graphics classes
parent
cd6ea1a4c5
commit
48d2b4a618
|
@ -32,7 +32,7 @@
|
|||
#include "graphics/core/device.h"
|
||||
|
||||
#include "level/level_category.h"
|
||||
|
||||
#include "math/intpoint.h"
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
#include "graphics/core/texture.h"
|
||||
#include "graphics/core/vertex.h"
|
||||
|
||||
#include "math/intpoint.h"
|
||||
#include <glm/glm.hpp>
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
@ -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
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
#include "graphics/core/color.h"
|
||||
|
||||
#include "math/intpoint.h"
|
||||
#include <glm/glm.hpp>
|
||||
|
||||
|
||||
// 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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -629,7 +629,7 @@ GLint LinkProgram(const std::vector<GLint>& shaders)
|
|||
return program;
|
||||
}
|
||||
|
||||
std::unique_ptr<CGLFrameBufferPixels> GetGLFrameBufferPixels(Math::IntPoint size)
|
||||
std::unique_ptr<CGLFrameBufferPixels> GetGLFrameBufferPixels(const glm::ivec2& size)
|
||||
{
|
||||
auto pixels = MakeUnique<CGLFrameBufferPixels>(4 * size.x * size.y);
|
||||
|
||||
|
|
|
@ -26,10 +26,10 @@
|
|||
|
||||
#include "graphics/core/device.h"
|
||||
|
||||
#include "math/intpoint.h"
|
||||
#include "math/vector.h"
|
||||
|
||||
#include <GL/glew.h>
|
||||
#include <glm/glm.hpp>
|
||||
|
||||
#include <string>
|
||||
#include <memory>
|
||||
|
@ -135,7 +135,7 @@ private:
|
|||
std::unique_ptr<GLubyte[]> m_pixels;
|
||||
};
|
||||
|
||||
std::unique_ptr<CGLFrameBufferPixels> GetGLFrameBufferPixels(Math::IntPoint size);
|
||||
std::unique_ptr<CGLFrameBufferPixels> GetGLFrameBufferPixels(const glm::ivec2& size);
|
||||
|
||||
struct LightLocations
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue