~thumper/nux/next-changes

« back to all changes in this revision

Viewing changes to NuxGraphics/GLDeviceObjects.h

  • Committer: Neil Jagdish Patel
  • Date: 2010-09-01 21:15:42 UTC
  • Revision ID: neil.patel@canonical.com-20100901211542-cw2ce3ak28unouwb
Add NuxGraphics with licensing

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright 2010 Inalogic Inc.
 
3
 *
 
4
 * This program is free software: you can redistribute it and/or modify it 
 
5
 * under the terms of the GNU Lesser General Public License version 3, as
 
6
 * published by the  Free Software Foundation.
 
7
 *
 
8
 * This program is distributed in the hope that it will be useful, but 
 
9
 * WITHOUT ANY WARRANTY; without even the implied warranties of 
 
10
 * MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR 
 
11
 * PURPOSE.  See the applicable version of the GNU Lesser General Public 
 
12
 * License for more details.
 
13
 * 
 
14
 * You should have received a copy of both the GNU Lesser General Public 
 
15
 * License version 3 along with this program.  If not, see 
 
16
 * <http://www.gnu.org/licenses/>
 
17
 *
 
18
 * Authored by: Jay Taoko <jay.taoko_AT_gmail_DOT_com>
 
19
 *
 
20
 */
 
21
 
 
22
 
 
23
#ifndef GLDEVICEOBJECT_H
 
24
#define GLDEVICEOBJECT_H
 
25
 
 
26
#include "GLResource.h"
 
27
#include "GLThread.h"
 
28
#include "GLDeviceFrameBufferObject.h"
 
29
#include "GLShaderParameter.h"
 
30
#include "GLTextureStates.h"
 
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
#include "IOpenGLResource.h"
 
75
#include "IOpenGLVertexBuffer.h"
 
76
#include "IOpenGLIndexBuffer.h"
 
77
#include "IOpenGLPixelBufferOject.h"
 
78
 
 
79
#include "IOpenGLBaseTexture.h"
 
80
#include "IOpenGLSurface.h"
 
81
#include "IOpenGLVolume.h"
 
82
#include "IOpenGLVolumeTexture.h"
 
83
#include "IOpenGLCubeTexture.h"
 
84
#include "IOpenGLRectangleTexture.h"
 
85
#include "IOpenGLTexture2D.h"
 
86
#include "IOpenGLAnimatedTexture.h"
 
87
#include "IOpenGLGLSLShader.h"
 
88
#include "IOpenGLAsmShader.h"
 
89
#include "IOpenGLQuery.h"
 
90
#include "IOpenGLVertexDeclaration.h"
 
91
#include "IOpenGLFrameBufferObject.h"
 
92
 
 
93
#if (NUX_ENABLE_CG_SHADERS)
 
94
    #include "IOpenGLCgShader.h"
 
95
#endif
 
96
 
 
97
#endif // GLDEVICEOBJECT_H
 
98