2
* Copyright 2010 Inalogic Inc.
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.
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.
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/>
18
* Authored by: Jay Taoko <jay.taoko_AT_gmail_DOT_com>
23
#ifndef GLDEVICEOBJECT_H
24
#define GLDEVICEOBJECT_H
26
#include "GLResource.h"
28
#include "GLDeviceFrameBufferObject.h"
29
#include "GLShaderParameter.h"
30
#include "GLTextureStates.h"
33
// #include "CG/cgGL.h"
35
// #pragma comment( lib, "cg.lib" )
36
// #pragma comment( lib, "cgGL.lib" )
40
We create a set of classes that wraps OpenGL objects ID.
41
The equivalent of OpenGL object ID on D3D are
44
IDirect3DIndexBuffer9,
45
IDirect3DVertexBuffer9,
47
- IDirect3DBaseTexture9
50
IDirect3DVolumeTexture9
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)
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:
65
glDeleteFramebuffersEXT
66
glDeleteRenderbuffersEXT
69
Note that all these opengl object may not have have an equivalent in OpenGL ES.
74
#include "IOpenGLResource.h"
75
#include "IOpenGLVertexBuffer.h"
76
#include "IOpenGLIndexBuffer.h"
77
#include "IOpenGLPixelBufferOject.h"
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"
93
#if (NUX_ENABLE_CG_SHADERS)
94
#include "IOpenGLCgShader.h"
97
#endif // GLDEVICEOBJECT_H