Simplifying texture formats a bit
Posted: Fri Jul 05, 2013 12:13 am
I'm in the mood for some mindless refactoring.
Texture.h has these three enums:
That's because when uploading OpenGL textures you specify a format, an internal format and a data type. DirectX has all the combinations in one enum (same formats are actually used with more than images, such as vertex data):
I think I would like to do the same (limited to formats we actually use). If anyone thinks it's bad idea I won't do it.
Texture.h has these three enums:
Code: Select all
enum TextureFormat {
TEXTURE_RGBA,
TEXTURE_RGB,
...etc
};
enum ImageFormat {
IMAGE_RGBA,
IMAGE_RGB,
...etc
};
enum ImageType {
IMAGE_UNSIGNED_BYTE,
};
Code: Select all
typedef enum DXGI_FORMAT {
DXGI_FORMAT_UNKNOWN = 0,
DXGI_FORMAT_R32G32B32A32_TYPELESS = 1,
DXGI_FORMAT_R32G32B32A32_FLOAT = 2,
DXGI_FORMAT_R32G32B32A32_UINT = 3,
DXGI_FORMAT_R32G32B32A32_SINT = 4,
DXGI_FORMAT_R32G32B32_TYPELESS = 5,
DXGI_FORMAT_R32G32B32_FLOAT = 6,
DXGI_FORMAT_R32G32B32_UINT = 7,
DXGI_FORMAT_R32G32B32_SINT = 8,
DXGI_FORMAT_R16G16B16A16_TYPELESS = 9,
DXGI_FORMAT_R16G16B16A16_FLOAT
...etc
}