HDK
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
RE_OGLQuery.h
Go to the documentation of this file.
1
/*
2
* PROPRIETARY INFORMATION. This software is proprietary to
3
* Side Effects Software Inc., and is not to be reproduced,
4
* transmitted, or disclosed in any way without written permission.
5
*
6
* NAME: RE_OGLQuery.h ( RE Library, C++)
7
*
8
* COMMENTS:
9
* Base class for GL queries (timer, occlusion, transform feedback prims)
10
*/
11
#ifndef RE_OGLQuery_h
12
#define RE_OGLQuery_h
13
14
#include "
RE_ContextSpecificObject.h
"
15
16
class
RE_API
RE_OGLQuery
:
public
RE_ContextSpecificObject
17
{
18
public
:
19
~
RE_OGLQuery
()
override
;
20
21
/// Create the query. A query cannot be created if another query is active.
22
bool
init
(
RE_Render
*
r
)
override
;
23
24
/// Bracket the draw calls to measure with begin and end.
25
/// @{
26
virtual
bool
begin
(
RE_Render
*r);
27
virtual
void
end
(
RE_Render
*r);
28
/// @}
29
30
/// Returns true if the query result is available from the GL server.
31
bool
isResultAvailable(
RE_Render
*r)
const
;
32
33
/// returns true if a query block has been executed in the past.
34
bool
isQueryBlockDone
()
const
{
return
myQueryPerformed; }
35
36
/// Get Raw GL ID of the query object
37
int
getID
()
const
{
return
myID; }
38
39
/// resets the query object so that isQueryBlockDone() returns false, as if
40
/// a query had never been performed.
41
void
reset
();
42
43
/// Deletes the query ID. init() must be called again.
44
void
destroy();
45
46
protected
:
47
48
RE_OGLQuery
(
RE_Extension
extension_type,
49
int
gl_query_type,
50
int
stream_num,
51
RE_Extension
alternate_extension =
RE_EXT_INVALID
,
52
int
alt_gl_query_type = 0);
53
54
int
getIntResult(
RE_Render
*r);
55
int64
getLongResult(
RE_Render
*r);
56
57
bool
queryCounter(
RE_Render
*r);
58
59
private
:
60
RE_Extension
myExtension;
61
RE_Extension
myAltExtension;
62
bool
myActiveQuery;
63
bool
myQueryPerformed;
64
bool
myHasResult;
65
unsigned
int
myID;
66
int
myQueryType;
67
int
myAltQueryType;
68
int
myStreamNum;
69
70
union
{
71
int
myInt
;
72
int64
myInt64
;
73
} myResult;
74
};
75
76
class
RE_API
RE_PrimitivesGeneratedQuery
:
public
RE_OGLQuery
77
{
78
public
:
79
RE_PrimitivesGeneratedQuery
(
int
stream
= 0);
80
81
/// Fetch the number of primitives generated by the GPU
82
int
getNumPrimitives
(
RE_Render
*
r
) {
return
getIntResult
(r); }
83
};
84
85
// No RE_API - used by RE_Render only.
86
class
RE_FeedbackPrimitivesWrittenQuery
:
public
RE_OGLQuery
87
{
88
public
:
89
RE_FeedbackPrimitivesWrittenQuery
(
int
stream
= 0);
90
91
/// Fetch the number of primitives captured by transform feedback
92
int
getNumPrimitives
(
RE_Render
*
r
) {
return
getIntResult
(r); }
93
};
94
95
#endif
stream
GLuint GLuint stream
Definition:
glcorearb.h:1832
RE_API
#define RE_API
Definition:
RE_API.h:10
RE_ContextSpecificObject::init
virtual bool init(RE_Render *r)=0
RE_OGLQuery
Definition:
RE_OGLQuery.h:16
RE_FeedbackPrimitivesWrittenQuery
Definition:
RE_OGLQuery.h:86
RE_ContextSpecificObject.h
reset
GLboolean reset
Definition:
glad.h:5138
end
GLuint GLuint end
Definition:
glcorearb.h:475
RE_Render
Definition:
RE_Render.h:29
RE_OGLQuery::myInt64
int64 myInt64
Definition:
RE_OGLQuery.h:72
RE_OGLQuery::isQueryBlockDone
bool isQueryBlockDone() const
returns true if a query block has been executed in the past.
Definition:
RE_OGLQuery.h:34
int64
long long int64
Definition:
SYS_Types.h:116
RE_PrimitivesGeneratedQuery
Definition:
RE_OGLQuery.h:76
RE_OGLQuery::getIntResult
int getIntResult(RE_Render *r)
RE_OGLQuery::myInt
int myInt
Definition:
RE_OGLQuery.h:71
RE_ContextSpecificObject
Definition:
RE_ContextSpecificObject.h:25
RE_PrimitivesGeneratedQuery::getNumPrimitives
int getNumPrimitives(RE_Render *r)
Fetch the number of primitives generated by the GPU.
Definition:
RE_OGLQuery.h:82
RE_OGLQuery::getID
int getID() const
Get Raw GL ID of the query object.
Definition:
RE_OGLQuery.h:37
r
GLboolean r
Definition:
glcorearb.h:1222
RE_EXT_INVALID
Definition:
RE_Extension.h:6
RE_FeedbackPrimitivesWrittenQuery::RE_FeedbackPrimitivesWrittenQuery
RE_FeedbackPrimitivesWrittenQuery(int stream=0)
RE_FeedbackPrimitivesWrittenQuery::getNumPrimitives
int getNumPrimitives(RE_Render *r)
Fetch the number of primitives captured by transform feedback.
Definition:
RE_OGLQuery.h:92
RE_Extension
RE_Extension
Definition:
RE_Extension.h:4
begin
PcpNodeRef_ChildrenIterator begin(const PcpNodeRef::child_const_range &r)
Support for range-based for loops for PcpNodeRef children ranges.
Definition:
node.h:558
RE
RE_OGLQuery.h
Generated on Tue Dec 17 2024 03:41:45 for HDK by
1.8.6