Home | Namespaces | Hierarchy | Alphabetical List | Class list | Files | Namespace Members | Class members | File members | Tutorials

IGUISpriteBank.h

Go to the documentation of this file.
00001 // Copyright (C) 2002-2009 Nikolaus Gebhardt
00002 // This file is part of the "Irrlicht Engine".
00003 // For conditions of distribution and use, see copyright notice in irrlicht.h
00004 
00005 #ifndef __I_GUI_SPRITE_BANK_H_INCLUDED__
00006 #define __I_GUI_SPRITE_BANK_H_INCLUDED__
00007 
00008 #include "IReferenceCounted.h"
00009 #include "irrArray.h"
00010 #include "SColor.h"
00011 #include "rect.h"
00012 
00013 namespace irr
00014 {
00015 
00016 namespace video
00017 {
00018         class ITexture;
00019 } // end namespace video
00020 
00021 namespace gui
00022 {
00023 
00025 struct SGUISpriteFrame
00026 {
00027         u32 textureNumber;
00028         u32 rectNumber;
00029 };
00030 
00032 struct SGUISprite
00033 {
00034         SGUISprite() : Frames(), frameTime(0) {}
00035 
00036         core::array<SGUISpriteFrame> Frames;
00037         u32 frameTime;
00038 };
00039 
00040 
00042 class IGUISpriteBank : public virtual IReferenceCounted
00043 {
00044 public:
00045 
00047         virtual core::array< core::rect<s32> >& getPositions() = 0;
00048 
00050         virtual core::array< SGUISprite >& getSprites() = 0;
00051 
00053         virtual u32 getTextureCount() const = 0;
00054 
00056         virtual video::ITexture* getTexture(u32 index) const = 0;
00057 
00059         virtual void addTexture(video::ITexture* texture) = 0;
00060 
00062         virtual void setTexture(u32 index, video::ITexture* texture) = 0;
00063 
00065         virtual void draw2DSprite(u32 index, const core::position2di& pos,
00066                         const core::rect<s32>* clip=0,
00067                         const video::SColor& color= video::SColor(255,255,255,255),
00068                         u32 starttime=0, u32 currenttime=0,
00069                         bool loop=true, bool center=false) = 0;
00070 
00072         virtual void draw2DSpriteBatch(const core::array<u32>& indices, const core::array<core::position2di>& pos,
00073                         const core::rect<s32>* clip=0,
00074                         const video::SColor& color= video::SColor(255,255,255,255),
00075                         u32 starttime=0, u32 currenttime=0,
00076                         bool loop=true, bool center=false) = 0;
00077 };
00078 
00079 
00080 } // end namespace gui
00081 } // end namespace irr
00082 
00083 #endif // __I_GUI_SPRITE_BANK_H_INCLUDED__
00084 

The Irrlicht Engine
The Irrlicht Engine Documentation © 2003-2009 by Nikolaus Gebhardt. Generated on Sun Jan 10 09:24:03 2010 by Doxygen (1.5.6)