2
2
// libavg - Media Playback Engine.
3
// Copyright (C) 2003-2008 Ulrich von Zadow
3
// Copyright (C) 2003-2011 Ulrich von Zadow
5
5
// This library is free software; you can redistribute it and/or
6
6
// modify it under the terms of the GNU Lesser General Public
36
typedef boost::shared_ptr<TextureMover> TextureMoverPtr;
35
38
class AVG_API GLTexture {
38
41
GLTexture(const IntPoint& size, PixelFormat pf, bool bMipmap=false,
39
unsigned wrapSMode=GL_CLAMP_TO_EDGE, unsigned wrapTMode=GL_CLAMP_TO_EDGE);
42
unsigned wrapSMode=GL_CLAMP_TO_EDGE, unsigned wrapTMode=GL_CLAMP_TO_EDGE,
43
bool bForcePOT=false);
44
GLTexture(unsigned glTexID, const IntPoint& size, PixelFormat pf, bool bMipmap=false,
45
bool bDeleteTex=false);
40
46
virtual ~GLTexture();
42
48
void activate(int textureUnit=GL_TEXTURE0);
43
49
void generateMipmaps();
50
void setWrapMode(unsigned wrapSMode, unsigned wrapTMode);
52
void enableStreaming();
53
BitmapPtr lockStreamingBmp();
54
void unlockStreamingBmp(bool bUpdated);
55
void moveBmpToTexture(BitmapPtr pBmp);
56
BitmapPtr moveTextureToBmp();
45
58
const IntPoint& getSize() const;
59
const IntPoint& getGLSize() const;
46
60
PixelFormat getPF() const;
47
61
unsigned getID() const;
63
IntPoint getMipmapSize(int level) const;
49
65
static bool isFloatFormatSupported();
50
66
static int getGLFormat(PixelFormat pf);
51
67
static int getGLType(PixelFormat pf);
52
68
int getGLInternalFormat() const;
53
bool hasMipmaps() const;
84
TextureMoverPtr m_pMover;
63
87
typedef boost::shared_ptr<GLTexture> GLTexturePtr;