X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Ftexturestate.h;fp=source%2Ftexturestate.h;h=13f56744a43e9c4003dec444295ecd10d632601c;hb=ee7f1e3a5912789664648ac5be85127e62c1cda5;hp=0000000000000000000000000000000000000000;hpb=151c65f1157f3b55d0b794db788b557bbc50ed0c;p=gldbg.git diff --git a/source/texturestate.h b/source/texturestate.h new file mode 100644 index 0000000..13f5674 --- /dev/null +++ b/source/texturestate.h @@ -0,0 +1,61 @@ +/* $Id$ + +This file is part of gldbg +Copyright © 2009 Mikko Rasa, Mikkosoft Productions +Distributed under the GPL +*/ + +#ifndef TEXTURESTATE_H_ +#define TEXTURESTATE_H_ + +#include +#include +#include +#include "autoconstptr.h" + +struct TexImageState +{ + unsigned width; + unsigned height; + unsigned depth; + GLenum internal_format; + + TexImageState(); + void set_2d(GLenum, unsigned, unsigned); + std::string describe() const; +}; + +struct TextureState +{ + unsigned id; + GLenum target; + std::vector images; + GLenum min_filter; + GLenum mag_filter; + GLenum wrap_s; + GLenum wrap_t; + GLenum wrap_r; + GLenum compare_mode; + GLenum compare_func; + bool generate_mipmap; + + TextureState(); + void set_image_2d(unsigned, GLenum, unsigned, unsigned); + void set_parameter(GLenum, const int *); + std::string describe() const; +}; + +struct TexUnitState +{ + AutoConstPtr current_2d; + AutoConstPtr current_3d; + + TexUnitState(); + + void set_current_texture(GLenum, TextureState *); + TextureState *get_current_texture(GLenum); + const TextureState *get_current_texture(GLenum) const; + std::string describe_binding(GLenum) const; +}; + +#endif