18 #ifndef RE_TIMER_QUERY_H
19 #define RE_TIMER_QUERY_H
74 myTime = getElapsedTimeNS(r);
77 myStart.recordTimestamp(r);
83 myEnd.recordTimestamp(r);
95 return (myStart.isResultAvailable(r) &&
96 myEnd.isResultAvailable(r));
105 t += (myEnd.getTimeStampNS(r) -
106 myStart.getTimeStampNS(r));
114 void reset() { myHasTime =
false; myTime = 0; }
bool recordTimestamp(RE_Render *r)
void end(RE_Render *r)
Mark the beginning and end of GPU commands to time Bracket the draw calls to measure with begin and e...
int64 getElapsedTimeNS(RE_Render *r)
Fetch elapsed render time between begin/end in nanoseconds.
int64 getLongResult(RE_Render *r)
void reset()
Reset the queries without deleting them.
void begin(RE_Render *r)
Mark the beginning and end of GPU commands to time Bracket the draw calls to measure with begin and e...
bool queryCounter(RE_Render *r)
Basic GL timer query implementation.
void destroy()
Deletes the queries. init() must be called again.
int64 getTimeStampNS(RE_Render *r)
Fetch the timestamp recorded by recordTimestamp()
void init(RE_Render *r)
Initialize the queries (queries cannot be created if a query is running)
int64 getElapsedTimeNS(RE_Render *r)
Fetch elapsed render time between begin/end in nanoseconds. Returns the elapsed time in nanoseconds...
bool isResultAvailable(RE_Render *r)
Returns true if the query result is available from the GL server.
~RE_TimerQuery() override