Removed physics for now.
This commit is contained in:
@ -19,7 +19,7 @@ Texture::Texture() : ITexture() {
|
||||
});
|
||||
}
|
||||
|
||||
void Texture::bind(textureslot_t slot) {
|
||||
void Texture::bind(const textureslot_t slot) {
|
||||
assertTrue(this->id != -1, "Texture is not ready!");
|
||||
glActiveTexture(GL_TEXTURE0 + slot);
|
||||
assertNoGLError();
|
||||
@ -41,10 +41,10 @@ int32_t Texture::getHeight() {
|
||||
}
|
||||
|
||||
void Texture::setSize(
|
||||
int32_t width,
|
||||
int32_t height,
|
||||
enum TextureFormat format,
|
||||
enum TextureDataFormat dataFormat
|
||||
const int32_t width,
|
||||
const int32_t height,
|
||||
const enum TextureFormat format,
|
||||
const enum TextureDataFormat dataFormat
|
||||
) {
|
||||
if(this->id != -1) {
|
||||
glDeleteTextures(1, &this->id);
|
||||
@ -80,7 +80,7 @@ void Texture::fill(struct Color color) {
|
||||
memoryFree(pixels);
|
||||
}
|
||||
|
||||
void Texture::fill(uint8_t color) {
|
||||
void Texture::fill(const uint8_t color) {
|
||||
auto pixels = memoryAllocate<uint8_t>(
|
||||
sizeof(uint8_t) * this->width * this->height
|
||||
);
|
||||
@ -151,7 +151,7 @@ void Texture::updateTextureProperties() {
|
||||
);
|
||||
}
|
||||
|
||||
void Texture::bufferRaw(void *data) {
|
||||
void Texture::bufferRaw(const void *data) {
|
||||
assertTrue(this->isReady(), "Texture is not ready!");
|
||||
|
||||
GLenum format;
|
||||
@ -203,7 +203,7 @@ void Texture::bufferRaw(void *data) {
|
||||
this->texturePropertiesNeedUpdating = true;
|
||||
}
|
||||
|
||||
void Texture::buffer(struct ColorU8 pixels[]) {
|
||||
void Texture::buffer(const struct ColorU8 pixels[]) {
|
||||
assertTrue(
|
||||
this->dataFormat == TEXTURE_DATA_FORMAT_UNSIGNED_BYTE,
|
||||
"Texture data format must be unsigned byte!"
|
||||
@ -211,7 +211,7 @@ void Texture::buffer(struct ColorU8 pixels[]) {
|
||||
this->bufferRaw((void*)pixels);
|
||||
}
|
||||
|
||||
void Texture::buffer(struct Color pixels[]) {
|
||||
void Texture::buffer(const struct Color pixels[]) {
|
||||
assertTrue(
|
||||
this->dataFormat == TEXTURE_DATA_FORMAT_FLOAT,
|
||||
"Texture data format must be float!"
|
||||
@ -223,7 +223,7 @@ void Texture::buffer(struct Color pixels[]) {
|
||||
this->bufferRaw((void*)pixels);
|
||||
}
|
||||
|
||||
void Texture::buffer(uint8_t pixels[]) {
|
||||
void Texture::buffer(const uint8_t pixels[]) {
|
||||
assertTrue(
|
||||
this->dataFormat == TEXTURE_DATA_FORMAT_UNSIGNED_BYTE,
|
||||
"Texture data format must be unsigned byte!"
|
||||
|
@ -21,31 +21,31 @@ namespace Dawn {
|
||||
enum TextureDataFormat dataFormat;
|
||||
|
||||
void updateTextureProperties();
|
||||
void bufferRaw(void *data);
|
||||
void bufferRaw(const void *data);
|
||||
|
||||
public:
|
||||
Texture();
|
||||
int32_t getWidth() override;
|
||||
int32_t getHeight() override;
|
||||
void setSize(
|
||||
int32_t width,
|
||||
int32_t height,
|
||||
enum TextureFormat format,
|
||||
enum TextureDataFormat dataFormat
|
||||
const int32_t width,
|
||||
const int32_t height,
|
||||
const enum TextureFormat format,
|
||||
const enum TextureDataFormat dataFormat
|
||||
) override;
|
||||
void fill(struct Color) override;
|
||||
void fill(uint8_t) override;
|
||||
void fill(const struct Color) override;
|
||||
void fill(const uint8_t) override;
|
||||
bool_t isReady() override;
|
||||
void buffer(struct ColorU8 pixels[]) override;
|
||||
void buffer(struct Color pixels[]);
|
||||
void buffer(uint8_t pixels[]) override;
|
||||
void buffer(const struct ColorU8 pixels[]) override;
|
||||
void buffer(const struct Color pixels[]);
|
||||
void buffer(const uint8_t 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);
|
||||
void bind(const textureslot_t slot);
|
||||
|
||||
~Texture();
|
||||
|
||||
|
Reference in New Issue
Block a user