Added texture data format support
This commit is contained in:
@ -27,6 +27,11 @@ namespace Dawn {
|
||||
TEXTURE_FILTER_MODE_LINEAR = 1
|
||||
};
|
||||
|
||||
enum TextureDataFormat {
|
||||
TEXTURE_DATA_FORMAT_UNSIGNED_BYTE = 0,
|
||||
TEXTURE_DATA_FORMAT_FLOAT = 1
|
||||
};
|
||||
|
||||
class ITexture : public StateOwner {
|
||||
protected:
|
||||
bool_t texturePropertiesNeedUpdating = true;
|
||||
@ -69,11 +74,13 @@ namespace Dawn {
|
||||
* @param width Width of the texture (in pixels).
|
||||
* @param height Height of the texture (in pixels).
|
||||
* @param format Data format of the texture to use.
|
||||
* @param dataFormat Data format of the texture to use.
|
||||
*/
|
||||
virtual void setSize(
|
||||
int32_t width,
|
||||
int32_t height,
|
||||
enum TextureFormat format
|
||||
enum TextureFormat format,
|
||||
enum TextureDataFormat dataFormat
|
||||
) = 0;
|
||||
|
||||
/**
|
||||
|
@ -77,7 +77,7 @@ TrueTypeFaceTexture::TrueTypeFaceTexture(
|
||||
y += face->glyph->bitmap.rows;
|
||||
}
|
||||
|
||||
this->texture.setSize(w, h, TEXTURE_FORMAT_R);
|
||||
this->texture.setSize(w, h, TEXTURE_FORMAT_R, TEXTURE_DATA_FORMAT_UNSIGNED_BYTE);
|
||||
this->texture.buffer(buffer);
|
||||
memoryFree(buffer);
|
||||
}
|
||||
|
Reference in New Issue
Block a user