~ubuntu-branches/ubuntu/oneiric/nux/oneiric

« back to all changes in this revision

Viewing changes to NuxGraphics/GLDeviceObjects.h

  • Committer: Bazaar Package Importer
  • Author(s): Didier Roche
  • Date: 2010-12-09 19:56:53 UTC
  • mto: This revision was merged to the branch mainline in revision 6.
  • Revision ID: james.westby@ubuntu.com-20101209195653-lsc4objqdxs9exp3
Tags: upstream-0.9.10
ImportĀ upstreamĀ versionĀ 0.9.10

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
 * License version 3 along with this program.  If not, see
16
16
 * <http://www.gnu.org/licenses/>
17
17
 *
18
 
 * Authored by: Jay Taoko <jay.taoko_AT_gmail_DOT_com>
 
18
 * Authored by: Jay Taoko <jaytaoko@inalogic.com>
19
19
 *
20
20
 */
21
21
 
29
29
#include "GLShaderParameter.h"
30
30
#include "GLTextureStates.h"
31
31
 
32
 
// #include "CG/cg.h"
33
 
// #include "CG/cgGL.h"
34
 
// #ifdef WIN32
35
 
//     #pragma comment( lib, "cg.lib" )
36
 
//     #pragma comment( lib, "cgGL.lib" )
37
 
// #endif
38
 
 
39
 
/*
40
 
We create a set of classes that wraps OpenGL objects ID.
41
 
The equivalent of OpenGL object ID on D3D are
42
 
IDirect3DResource9
43
 
IDirect3DSurface9,
44
 
IDirect3DIndexBuffer9,
45
 
IDirect3DVertexBuffer9,
46
 
IDirect3DVolume9
47
 
- IDirect3DBaseTexture9
48
 
IDirect3DCubeTexture9
49
 
IDirect3DTexture9
50
 
IDirect3DVolumeTexture9
51
 
 
52
 
All the D3D object support Release() and AddRef() and are managed by the DirectX Api.
53
 
On OpenGL, we must create an object interface that support Release() and AddRef() and we define a class
54
 
that create opengl object and maintain a reference count of them. The creator class calls the following functions:
55
 
glGenQueriesARB         (occlusion query objects)
56
 
glGenTextures           (texture objects)
57
 
glGenFramebuffersEXT    (frame buffer objects)
58
 
glGenRenderbuffersEXT   (render buffer objects)
59
 
glGenBuffersARB         (index and vertex buffers)
60
 
 
61
 
At creation, and opengl object has a reference count equal to 1. When the object reference count reaches 0,
62
 
the creator classes delete it using the appropriate semantic calls:
63
 
glDeleteQueries
64
 
glDeleteTextures
65
 
glDeleteFramebuffersEXT
66
 
glDeleteRenderbuffersEXT
67
 
glDeleteBuffersARB
68
 
 
69
 
Note that all these opengl object may not have have an equivalent in OpenGL ES.
70
 
 
71
 
*/
72
 
 
73
 
 
74
32
#include "IOpenGLResource.h"
75
33
#include "IOpenGLVertexBuffer.h"
76
34
#include "IOpenGLIndexBuffer.h"