~ubuntu-branches/ubuntu/trusty/libavg/trusty-proposed

« back to all changes in this revision

Viewing changes to src/graphics/GLTexture.h

  • Committer: Package Import Robot
  • Author(s): OXullo Intersecans
  • Date: 2011-12-06 22:44:56 UTC
  • mfrom: (1.1.6)
  • Revision ID: package-import@ubuntu.com-20111206224456-qc7250z3ya1vi8s9
Tags: 1.7.0-0ubuntu1
* New upstream release (LP: #899183)
* Remove patches 0002-libav-0.7.patch, 0003-fglrx-segfault-on-startup.patch
  now merged to upstream
* Remove unnecessary .la files
* Update debian/watch file
* Fix debian/copyright dep-5 compliancy
* Update standards to version 3.9.2
* Add man pages for avg_checktouch, avg_checkvsync, avg_showsvg
* Minor debian/rules enhancement
* Add librsvg2-dev, libgdk-pixbuf2.0-dev to Build-Depends
* Proper transition to dh_python2

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
//
2
2
//  libavg - Media Playback Engine. 
3
 
//  Copyright (C) 2003-2008 Ulrich von Zadow
 
3
//  Copyright (C) 2003-2011 Ulrich von Zadow
4
4
//
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
32
32
 
33
33
namespace avg {
34
34
 
 
35
class TextureMover;
 
36
typedef boost::shared_ptr<TextureMover> TextureMoverPtr;
 
37
 
35
38
class AVG_API GLTexture {
36
39
 
37
40
public:
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();
41
47
 
42
48
    void activate(int textureUnit=GL_TEXTURE0);
43
49
    void generateMipmaps();
 
50
    void setWrapMode(unsigned wrapSMode, unsigned wrapTMode);
 
51
 
 
52
    void enableStreaming();
 
53
    BitmapPtr lockStreamingBmp();
 
54
    void unlockStreamingBmp(bool bUpdated);
 
55
    void moveBmpToTexture(BitmapPtr pBmp);
 
56
    BitmapPtr moveTextureToBmp();
44
57
 
45
58
    const IntPoint& getSize() const;
 
59
    const IntPoint& getGLSize() const;
46
60
    PixelFormat getPF() const;
47
61
    unsigned getID() const;
48
62
 
 
63
    IntPoint getMipmapSize(int level) const;
 
64
 
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;
 
69
    
 
70
    void setDirty();
 
71
    bool isDirty() const;
 
72
    void resetDirty();
54
73
 
55
74
private:
56
75
    IntPoint m_Size;
 
76
    IntPoint m_GLSize;
57
77
    PixelFormat m_pf;
58
78
    bool m_bMipmap;
 
79
    bool m_bDeleteTex;
 
80
    bool m_bUsePOT;
59
81
 
60
82
    unsigned m_TexID;
 
83
    bool m_bIsDirty;
 
84
    TextureMoverPtr m_pMover;
61
85
};
62
86
 
63
87
typedef boost::shared_ptr<GLTexture> GLTexturePtr;