Equalizer  1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
objectManager.h
1 
2 /* Copyright (c) 2007-2014, Stefan Eilemann <eile@equalizergraphics.com>
3  *
4  * This library is free software; you can redistribute it and/or modify it under
5  * the terms of the GNU Lesser General Public License version 2.1 as published
6  * by the Free Software Foundation.
7  *
8  * This library is distributed in the hope that it will be useful, but WITHOUT
9  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
10  * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
11  * details.
12  *
13  * You should have received a copy of the GNU Lesser General Public License
14  * along with this library; if not, write to the Free Software Foundation, Inc.,
15  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
16  */
17 
18 #ifndef EQUTIL_OBJECTMANAGER_H
19 #define EQUTIL_OBJECTMANAGER_H
20 
21 #include <eq/util/types.h>
22 #include <eq/client/api.h>
23 
24 namespace eq
25 {
26 namespace util
27 {
28 namespace detail { class ObjectManager; }
29 
52 {
53 public:
54  enum
55  {
56  INVALID = 0 //<! return value for failed operations.
57  };
58 
60  EQ_API ObjectManager( const GLEWContext* const glewContext );
61 
63  EQ_API ObjectManager( const ObjectManager& shared );
64 
66  EQ_API virtual ~ObjectManager();
67 
68  ObjectManager& operator = ( const ObjectManager& rhs );
69 
71  EQ_API bool isShared() const;
72 
74  EQ_API void clear();
75 
80  EQ_API void deleteAll();
81 
82  EQ_API unsigned getList( const void* key ) const;
83  EQ_API unsigned newList( const void* key, const int num = 1 );
84  EQ_API unsigned obtainList( const void* key, const int num = 1 );
85  EQ_API void deleteList( const void* key );
86 
87  EQ_API unsigned getTexture( const void* key ) const;
88  EQ_API unsigned newTexture( const void* key );
89  EQ_API unsigned obtainTexture( const void* key );
90  EQ_API void deleteTexture( const void* key );
91 
92  EQ_API bool supportsBuffers() const;
93  EQ_API unsigned getBuffer( const void* key ) const;
94  EQ_API unsigned newBuffer( const void* key );
95  EQ_API unsigned obtainBuffer( const void* key );
96  EQ_API void deleteBuffer( const void* key );
97 
98  EQ_API bool supportsPrograms() const;
99  EQ_API unsigned getProgram( const void* key ) const;
100  EQ_API unsigned newProgram( const void* key );
101  EQ_API unsigned obtainProgram( const void* key );
102  EQ_API void deleteProgram( const void* key );
103 
104  EQ_API bool supportsShaders() const;
105  EQ_API unsigned getShader( const void* key ) const;
106  EQ_API unsigned newShader( const void* key, const unsigned type );
107  EQ_API unsigned obtainShader( const void* key, const unsigned type );
108  EQ_API void deleteShader( const void* key );
109 
110  EQ_API Accum* getEqAccum( const void* key ) const;
111  EQ_API Accum* newEqAccum( const void* key );
112  EQ_API Accum* obtainEqAccum( const void* key );
113  EQ_API void deleteEqAccum( const void* key );
114 
116  EQ_API lunchbox::Uploader* getEqUploader( const void* key ) const;
118  EQ_API lunchbox::Uploader* newEqUploader( const void* key );
120  EQ_API lunchbox::Uploader* obtainEqUploader( const void* key );
122  EQ_API void deleteEqUploader( const void* key );
123 
124  EQ_API bool supportsEqTexture() const;
125  EQ_API Texture* getEqTexture( const void* key ) const;
126  EQ_API Texture* newEqTexture( const void* key, const unsigned target );
127  EQ_API Texture* obtainEqTexture( const void* key, const unsigned target );
128  EQ_API void deleteEqTexture( const void* key );
129 
130  EQ_API bool supportsEqFrameBufferObject() const;
131  EQ_API FrameBufferObject* getEqFrameBufferObject(const void* key) const;
132  EQ_API FrameBufferObject* newEqFrameBufferObject( const void* key );
133  EQ_API FrameBufferObject* obtainEqFrameBufferObject( const void* key );
134  EQ_API void deleteEqFrameBufferObject( const void* key );
135 
136  EQ_API bool supportsEqPixelBufferObject() const;
137  EQ_API PixelBufferObject* getEqPixelBufferObject(const void* key) const;
138  EQ_API PixelBufferObject* newEqPixelBufferObject( const void* key,
139  const bool threadSafe );
140  EQ_API PixelBufferObject* obtainEqPixelBufferObject( const void* key,
141  const bool threadSafe );
142  EQ_API void deleteEqPixelBufferObject( const void* key );
143 
144  EQ_API util::BitmapFont* getEqBitmapFont( const void* key ) const;
145  EQ_API util::BitmapFont* newEqBitmapFont( const void* key );
146  EQ_API util::BitmapFont* obtainEqBitmapFont( const void* key );
147  EQ_API void deleteEqBitmapFont( const void* key );
148 
149  EQ_API const GLEWContext* glewGetContext() const;
150 
151 private:
152  typedef lunchbox::RefPtr< detail::ObjectManager > SharedDataPtr;
153  SharedDataPtr _impl;
154 };
155 }
156 }
157 
158 #endif // EQUTIL_OBJECTMANAGER_H
A C++ class to abstract an accumulation buffer.
Definition: accum.h:39
A C++ class to abstract OpenGL frame buffer objects.
EQ_API ObjectManager(const GLEWContext *const glewContext)
Construct a new object manager.
A C++ class to abstract OpenGL pixel buffer objects.
A wrapper around AGL, WGL and GLX bitmap fonts.
Definition: bitmapFont.h:29
A wrapper around OpenGL textures.
Definition: texture.h:38
EQ_API void clear()
Reset the object manager.
virtual EQ_API ~ObjectManager()
Destruct this object manager.
A facility class to manage OpenGL objects across shared contexts.
Definition: objectManager.h:51
EQ_API bool isShared() const
EQ_API void deleteAll()
Delete all managed objects and associated GL objects.