Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 268 vs 286 for /trunk/Source Code/Hardware/Video/Textures/Headers/Texture.h

Diff revisions: vs.
  @@ -34,35 +34,35 @@
34 34 /*Abstract interface*/
35 35 public:
36 36 virtual void Bind(U16 slot) = 0;
37 - virtual void Destroy() = 0;
38 - virtual void loadData(U32 target, const U8* const ptr, const vec2<U16>& dimensions, U8 bpp, GFXImageFormat format) = 0;
39 - virtual void setMipMapRange(U32 base = 0, U32 max = 1000) = 0;
37 + virtual void loadData(U32 target, const U8* const ptr, const vec2<U16>& dimensions, const vec2<U16>& mipLevels,
38 + GFXImageFormat format, GFXImageFormat internalFormat, bool usePOW2 = false) = 0;
39 + virtual void setMipMapRange(U16 base = 0, U16 max = 1000) = 0;
40 + virtual void updateMipMaps() = 0;
40 41 virtual ~Texture() {}
41 42
42 43 public:
43 44 bool LoadFile(U32 target, const std::string& name);
45 +
44 46 void resize(U16 width, U16 height);
45 47
46 48 inline void setCurrentSampler(const SamplerDescriptor& descriptor) {_samplerDescriptor = descriptor;}
47 49 inline const SamplerDescriptor& getCurrentSampler() const {return _samplerDescriptor;}
48 50
49 - inline void setNumLayers(U8 numLayers) { _numLayers = numLayers; }
50 - inline U8 getNumLayers() const { return _numLayers; }
51 + inline void refreshMipMaps() { _mipMapsDirty = true; }
52 + inline void setNumLayers(U8 numLayers) { _numLayers = numLayers; }
53 + inline U8 getNumLayers() const { return _numLayers; }
54 + inline U8 getBitDepth() const { return _bitDepth; }
55 + inline U16 getWidth() const { return _width; }
56 + inline U16 getHeight() const { return _height; }
57 + inline U32 getHandle() const { return _handle; }
58 + inline bool isFlipped() const { return _flipped; }
59 + inline bool hasTransparency() const { return _hasTransparency; }
60 + inline TextureType getTextureType() const { return _textureType; }
51 61
52 - inline U32 getHandle() const {return _handle;}
53 - inline U16 getWidth() const {return _width;}
54 - inline U16 getHeight() const {return _height;}
55 - inline U8 getBitDepth() const {return _bitDepth;}
56 - inline bool isFlipped() const {return _flipped;}
57 - inline bool hasTransparency() const {return _hasTransparency;}
58 -
59 - protected:
60 - template<typename T>
61 - friend class ImplResourceLoader;
62 - virtual bool generateHWResource(const std::string& name) {return HardwareResource::generateHWResource(name);}
62 + virtual bool generateHWResource(const std::string& name);
63 63
64 64 protected:
65 - Texture(const bool flipped = false);
65 + Texture(TextureType type, const bool flipped = false);
66 66
67 67 protected:
68 68 boost::atomic<U32> _handle;
  @@ -70,7 +70,9 @@
70 70 U8 _bitDepth;
71 71 U8 _numLayers;
72 72 bool _flipped;
73 + bool _mipMapsDirty;
73 74 bool _hasTransparency;
75 + TextureType _textureType;
74 76 mat4<F32> _transformMatrix;
75 77 SamplerDescriptor _samplerDescriptor;
76 78 };