Dawn/src/dawnopengl/display/Texture.hpp
2023-01-14 22:06:35 -08:00

42 lines
1.0 KiB
C++

// Copyright (c) 2022 Dominic Masters
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT
#pragma once
#include "dawnopengl.hpp"
#include "assert/assert.hpp"
#include "display/_Texture.hpp"
#include "util/memory.hpp"
namespace Dawn {
class TextureRenderTarget;
typedef GLuint textureslot_t;
class Texture : public ITexture {
private:
int32_t width = -1;
int32_t height = -1;
GLuint id = -1;
public:
int32_t getWidth() override;
int32_t getHeight() override;
void setSize(int32_t width, int32_t height) override;
void fill(struct Color) override;
bool_t isReady() override;
void buffer(struct Color pixels[]) override;
/**
* Binds the texture to the given slot (for use by the shaders).
*
* @param slot Slot to bind to.
*/
void bind(textureslot_t slot);
~Texture();
friend class TextureRenderTarget;
};
}