VR-Vantage 3.0 API Documentation
Home
Modules
Namespaces
Classes
Files
Libraries
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
sensorFx
include
fbObject.h
Go to the documentation of this file.
1
2
// Copyright JRM Enterprises, Inc. 2006
3
// All rights reserved.
4
//
5
// This code is the intellectual property of JRM Enterprises, Inc.
6
// It may not be used or released as source or compiled binary form
7
// without the prior written consent of JRM Enterprises, Inc.
8
//
9
// Original Authors: Ken George
11
12
#ifndef FBOBJECT__H
13
#define FBOBJECT__H
14
15
#ifndef __gl_h_
16
#include <GL/glew.h>
17
#ifdef _WIN32
18
#include <GL/wglew.h>
19
#else
20
#include <GL/glxew.h>
21
#endif
22
#endif
23
24
// simple wrapper to encapsulate a framebuffer_object using render-to-texture and its associated texture object
25
26
class
fbObject
{
27
public
:
28
fbObject
(
int
width
,
int
height
,
GLenum
target
,
GLenum
texInternalFormat);
29
30
~fbObject
();
31
32
// activate this fbo for rendering
33
void
Activate
(
bool
clear =
false
);
34
// activate the standard frame buffer for rendering
35
void
Deactivate
();
36
37
// bind the texture associated with this fbo as texture
38
void
Bind
() {
glBindTexture
(
m_target
,
m_tex
); }
39
40
// release the texture - no operation necessary with fbo
41
void
Release
() { }
42
43
inline
int
GetWidth
() {
return
m_width
; }
44
inline
int
GetHeight
() {
return
m_height
; }
45
46
private
:
47
48
void
CheckFramebufferStatus
();
49
50
GLuint
m_fbo
;
// color render target
51
GLuint
m_tex
;
// texture for each buffer
52
GLenum
m_target
;
// texture target type
53
int
m_width
;
// width of fbo/texture
54
int
m_height
;
// height of fbo/texture
55
};
56
#endif
57
Copyright © 2005-2022 MAK Technologies. All Rights Reserved (
www.mak.com
)