Add support for:

F_rgba16,  // 16 bits per R,G,B,A channel
    F_rgba32,  // 32 bits per R,G,B,A channel
This commit is contained in:
aignacio_sf 2006-12-08 22:29:23 +00:00
parent 82ee360915
commit b1131ae0da
2 changed files with 23 additions and 2 deletions

View File

@ -432,6 +432,13 @@ estimate_texture_memory() const {
case Texture::F_rgb12:
bpp = 6;
break;
case Texture::F_rgba16:
bpp = 8;
break;
case Texture::F_rgba32:
bpp = 16;
break;
}
size_t bytes = pixels * bpp;
@ -1360,6 +1367,12 @@ write(ostream &out, int indent_level) const {
case F_rgbm:
out << "rgbm";
break;
case F_rgba32:
out << "rgba32";
break;
case F_rgba16:
out << "rgba16";
break;
case F_rgba12:
out << "rgba12";
break;
@ -1514,6 +1527,8 @@ set_format(Texture::Format format) {
case F_rgba5:
case F_rgba8:
case F_rgba12:
case F_rgba16:
case F_rgba32:
_num_components = 4;
break;
}
@ -2435,6 +2450,8 @@ has_alpha(Format format) {
case F_rgba5:
case F_rgba8:
case F_rgba12:
case F_rgba16:
case F_rgba32:
case F_luminance_alpha:
case F_luminance_alphamask:
return true;

View File

@ -103,7 +103,10 @@ PUBLISHED:
F_luminance,
F_luminance_alpha, // 8 bits luminance, 8 bits alpha
F_luminance_alphamask // 8 bits luminance, only needs 1 bit of alpha
F_luminance_alphamask, // 8 bits luminance, only needs 1 bit of alpha
F_rgba16, // 16 bits per R,G,B,A channel
F_rgba32, // 32 bits per R,G,B,A channel
};
enum FilterType {
@ -345,10 +348,11 @@ PUBLISHED:
static bool is_mipmap(FilterType type);
public:
INLINE bool get_match_framebuffer_format() const;
INLINE void set_match_framebuffer_format(bool flag);
public:
TextureContext *prepare_now(PreparedGraphicsObjects *prepared_objects,
GraphicsStateGuardianBase *gsg);
void texture_uploaded();