Panda3D
Public Member Functions | Static Public Member Functions
QueryContext Class Reference

This is a base class for queries that might require a round-trip to the graphics engine. More...

#include "queryContext.h"

Inheritance diagram for QueryContext:
TypedReferenceCount TypedObject ReferenceCount MemoryBase MemoryBase OcclusionQueryContext DXOcclusionQueryContext9

List of all members.

Public Member Functions

virtual TypeHandle force_init_type ()
virtual TypeHandle get_type () const
virtual bool is_answer_ready () const =0
 Returns true if the query's answer is ready, false otherwise.
virtual void waiting_for_answer ()
 Requests the graphics engine to expedite the pending answer--the application is now waiting until the answer is ready.

Static Public Member Functions

static TypeHandle get_class_type ()
static void init_type ()
 This function is declared non-inline to work around a compiler bug in g++ 2.96.

Detailed Description

This is a base class for queries that might require a round-trip to the graphics engine.

The idea is that when you ask the GSG to make a particular query, it returns a QueryContext, which does not necessarily have the answer right away (but it will eventually).

Unlike SavedContext, QueryContext is reference-counted. It removes itself from the GSG when the last reference goes away. You're responsible for keeping the pointer to the QueryContext as long as you are interested in the answer.

Definition at line 38 of file queryContext.h.


Member Function Documentation

static void QueryContext::init_type ( ) [inline, static]

This function is declared non-inline to work around a compiler bug in g++ 2.96.

Making it inline seems to cause problems in the optimizer.

Reimplemented from TypedReferenceCount.

Reimplemented in DXOcclusionQueryContext9, and OcclusionQueryContext.

Definition at line 50 of file queryContext.h.

References TypedReferenceCount::init_type().

Referenced by OcclusionQueryContext::init_type().

bool QueryContext::is_answer_ready ( ) const [pure virtual]

Returns true if the query's answer is ready, false otherwise.

If this returns false, the application must continue to poll until it returns true.

It is only valid to call this from the draw thread.

Implemented in DXOcclusionQueryContext9.

Definition at line 38 of file queryContext.cxx.

Requests the graphics engine to expedite the pending answer--the application is now waiting until the answer is ready.

It is only valid to call this from the draw thread.

Reimplemented in DXOcclusionQueryContext9.

Definition at line 52 of file queryContext.cxx.


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations