libglez/include/glez/texture.hpp
2022-04-07 14:04:25 -04:00

49 lines
1.1 KiB
C++

/*
Created by Jenny White on 30.04.18.
Copyright (c) 2018 nullworks. All rights reserved.
*/
#pragma once
#include <cstddef>
#include <freetype-gl.h>
#include <limits>
#include <string>
namespace glez {
class texture {
public:
texture() { }
static texture loadFromFile(const std::string& path);
static texture loadFromMemory(const std::byte* mem, std::size_t size, unsigned w, unsigned h);
texture(texture&&);
~texture();
texture& operator=(texture&&);
void bind();
inline bool isLoaded() { return this->init; }
public:
bool init = false;
bool bound = false;
int width = 0;
int height = 0;
GLuint id;
GLubyte* data;
public:
[[deprecated]] int getWidth() const { return this->width; }
[[deprecated]] int getHeight() const { return this->height; }
[[deprecated]] unsigned getHandle() const { return 1; }
[[deprecated]] bool canLoad() const { return true; }
[[deprecated]] void load() { }
[[deprecated]] void unload() { }
[[deprecated]] const std::string path;
};
} // namespace glez