trying to fix some warnings (had side effects)

This commit is contained in:
2021-06-14 17:44:59 +02:00
parent 05a8dfe1ff
commit 573b276116
10 changed files with 17 additions and 17 deletions

View File

@ -5,7 +5,7 @@
namespace MM::Components::OpenGL {
struct Texture {
MM::OpenGL::Texture::handle tex;
MM::OpenGL::Texture::handle_t tex;
};
} // MM::Components::OpenGL

View File

@ -6,7 +6,7 @@ namespace MM::OpenGL {
// a SpriteSheet is a texture divided evenly into a Grid
struct SpriteSheet {
MM::OpenGL::Texture::handle tex = nullptr;
MM::OpenGL::Texture::handle_t tex = nullptr;
struct {
uint32_t x = 1;
uint32_t y = 1;

View File

@ -15,9 +15,9 @@ uint32_t Texture::getHandle(void) const {
Texture::Texture(
uint32_t handle,
int32_t width, int32_t height,
int32_t width_, int32_t height_,
int32_t internalFormat, int32_t format, int32_t type
) : _handle(handle), width(width), height(height),
) : _handle(handle), width(width_), height(height_),
_internalFormat(internalFormat), _format(format), _type(type) {}
Texture::~Texture(void) {
@ -44,7 +44,7 @@ void Texture::resize(int32_t new_width, int32_t new_height) {
*(const_cast<int32_t*>(&height)) = new_height;
}
Texture::handle Texture::createEmpty(int32_t internalFormat, int32_t width, int32_t height, int32_t format, int32_t type) {
Texture::handle_t Texture::createEmpty(int32_t internalFormat, int32_t width, int32_t height, int32_t format, int32_t type) {
uint32_t id;
glGenTextures(1, &id);
glBindTexture(GL_TEXTURE_2D, id);
@ -54,7 +54,7 @@ Texture::handle Texture::createEmpty(int32_t internalFormat, int32_t width, int3
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glBindTexture(GL_TEXTURE_2D, 0);
return handle(new Texture(id, width, height, internalFormat, format, type));
return handle_t(new Texture(id, width, height, internalFormat, format, type));
}
} // MM::OpenGL

View File

@ -19,12 +19,12 @@ namespace MM::OpenGL {
Texture(
uint32_t handle,
int32_t width, int32_t height,
int32_t width_, int32_t height_,
int32_t internalFormat, int32_t format, int32_t type
);
public:
using handle = std::shared_ptr<Texture>;
using handle_t = std::shared_ptr<Texture>;
int32_t const width;
int32_t const height;
@ -44,7 +44,7 @@ namespace MM::OpenGL {
void resize(int32_t new_width, int32_t new_height);
static handle createEmpty(int32_t internalFormat, int32_t width, int32_t height, int32_t format, int32_t type);
static handle_t createEmpty(int32_t internalFormat, int32_t width, int32_t height, int32_t format, int32_t type);
};
} // MM::OpenGL