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