2
* Copyright 2010 Inalogic Inc.
4
* This program is free software: you can redistribute it and/or modify it
5
* under the terms of the GNU Lesser General Public License version 3, as
6
* published by the Free Software Foundation.
8
* This program is distributed in the hope that it will be useful, but
9
* WITHOUT ANY WARRANTY; without even the implied warranties of
10
* MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
11
* PURPOSE. See the applicable version of the GNU Lesser General Public
12
* License for more details.
14
* You should have received a copy of both the GNU Lesser General Public
15
* License version 3 along with this program. If not, see
16
* <http://www.gnu.org/licenses/>
18
* Authored by: Jay Taoko <jay.taoko_AT_gmail_DOT_com>
23
#ifndef IOPENGLANIMATEDTEXTURE_H
24
#define IOPENGLANIMATEDTEXTURE_H
28
class IOpenGLBaseTexture;
29
class IOpenGLRectangleTexture;
31
// Note that for Animated texture, the Depth value is the number of frames.
32
// The number of mipmap levels is always 1;
33
class IOpenGLAnimatedTexture: public IOpenGLBaseTexture
35
DECLARE_OBJECT_TYPE(IOpenGLAnimatedTexture, IOpenGLBaseTexture);
38
virtual ~IOpenGLAnimatedTexture();
40
void GetSurfaceFrame(int Frame, TRefGL<IOpenGLSurface>& surface);
41
TRefGL<IOpenGLSurface> GetSurfaceFrame(int Level);
45
SURFACE_LOCKED_RECT * pLockedRect,
46
const SURFACE_RECT * pRect);
52
int GetDepth(int MipLevel) const {return _Depth;}
54
int GetDesc(ANIMATEDTEXTURE_DESC* pDesc)
56
pDesc->Width = Max<unsigned int>(1, _Width);
57
pDesc->Height = Max<unsigned int>(1, _Height);
58
pDesc->Depth = _Depth;
59
pDesc->PixelFormat = _PixelFormat;
60
pDesc->Type = _ResourceType;
63
void PresentFirstFrame();
64
void PresentNextFrame();
65
void PresentLastFrame();
68
void SetFrameTime(int Frame, int time_ms);
71
IOpenGLAnimatedTexture(
75
, BitmapFormat PixelFormat);
77
// unsigned int _Width;
78
// unsigned int _Height;
79
// unsigned int _Depth;
80
//std::vector<IOpenGLSurface*> _VolumeArray;
83
std::vector< TRefGL<IOpenGLRectangleTexture> > _FrameTextureArray;
85
std::vector< int > _FrameTimeArray;
87
friend class GLDeviceFactory;
88
friend class IOpenGLSurface;
92
#endif // IOPENGLANIMATEDTEXTURE_H