Panda3D
Classes | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
GraphicsStateGuardianBase Class Referenceabstract

This is a base class for the GraphicsStateGuardian class, which is itself a base class for the various GSG's for different platforms. More...

#include "graphicsStateGuardianBase.h"

Inheritance diagram for GraphicsStateGuardianBase:
TypedWritableReferenceCount TypedWritable ReferenceCount TypedObject MemoryBase MemoryBase GraphicsStateGuardian DXGraphicsStateGuardian9

Public Member Functions

virtual bool begin_draw_primitives (const GeomPipelineReader *geom_reader, const GeomVertexDataPipelineReader *data_reader, bool force)=0
 
virtual void bind_light (PointLight *light_obj, const NodePath &light, int light_id)
 
virtual void bind_light (DirectionalLight *light_obj, const NodePath &light, int light_id)
 
virtual void bind_light (Spotlight *light_obj, const NodePath &light, int light_id)
 
virtual void clear_before_callback ()=0
 
virtual void clear_state_and_transform ()=0
 
virtual PN_stdfloat compute_distance_to (const LPoint3 &point) const =0
 
virtual CPT (RenderState) begin_decal_base_first()=0
 
virtual CPT (RenderState) begin_decal_nested()=0
 
virtual CPT (RenderState) begin_decal_base_second()=0
 
virtual bool depth_offset_decals ()=0
 
virtual void dispatch_compute (int size_x, int size_y, int size_z)=0
 
virtual bool draw_lines (const GeomPrimitivePipelineReader *reader, bool force)=0
 
virtual bool draw_lines_adj (const GeomPrimitivePipelineReader *reader, bool force)=0
 
virtual bool draw_linestrips (const GeomPrimitivePipelineReader *reader, bool force)=0
 
virtual bool draw_linestrips_adj (const GeomPrimitivePipelineReader *reader, bool force)=0
 
virtual bool draw_patches (const GeomPrimitivePipelineReader *reader, bool force)=0
 
virtual bool draw_points (const GeomPrimitivePipelineReader *reader, bool force)=0
 
virtual bool draw_triangles (const GeomPrimitivePipelineReader *reader, bool force)=0
 
virtual bool draw_triangles_adj (const GeomPrimitivePipelineReader *reader, bool force)=0
 
virtual bool draw_trifans (const GeomPrimitivePipelineReader *reader, bool force)=0
 
virtual bool draw_tristrips (const GeomPrimitivePipelineReader *reader, bool force)=0
 
virtual bool draw_tristrips_adj (const GeomPrimitivePipelineReader *reader, bool force)=0
 
virtual void end_draw_primitives ()=0
 
virtual void ensure_generated_shader (const RenderState *state)=0
 
virtual bool extract_texture_data (Texture *tex)=0
 
virtual void finish_decal ()=0
 
virtual TypeHandle force_init_type ()
 
virtual bool framebuffer_copy_to_ram (Texture *tex, int view, int z, const DisplayRegion *dr, const RenderBuffer &rb)=0
 
virtual bool framebuffer_copy_to_texture (Texture *tex, int view, int z, const DisplayRegion *dr, const RenderBuffer &rb)=0
 
virtual bool get_effective_incomplete_render () const =0
 
virtual bool get_incomplete_render () const =0
 
virtual CoordinateSystem get_internal_coordinate_system () const =0
 
virtual int get_max_texture_dimension () const =0
 
virtual int get_max_vertices_per_array () const =0
 
virtual int get_max_vertices_per_primitive () const =0
 
virtual PreparedGraphicsObjectsget_prepared_objects ()=0
 
virtual SceneSetupget_scene () const =0
 
virtual int get_supported_geom_rendering () const =0
 
virtual bool get_supports_compressed_texture_format (int compression_mode) const =0
 
virtual bool get_supports_hlsl () const =0
 
virtual bool get_supports_multisample () const =0
 
virtual bool get_supports_shadow_filter () const =0
 
virtual bool get_supports_texture_srgb () const =0
 
virtual TypeHandle get_type () const
 
virtual void pop_group_marker ()
 
virtual bool prefers_triangle_strips () const =0
 
virtual GeomContextprepare_geom (Geom *geom)=0
 
virtual IndexBufferContextprepare_index_buffer (GeomPrimitive *data)=0
 
virtual SamplerContextprepare_sampler (const SamplerState &sampler)=0
 
virtual ShaderContextprepare_shader (Shader *shader)=0
 
virtual BufferContextprepare_shader_buffer (ShaderBuffer *data)=0
 
virtual TextureContextprepare_texture (Texture *tex, int view)=0
 
virtual VertexBufferContextprepare_vertex_buffer (GeomVertexArrayData *data)=0
 
virtual PT (GeomMunger) get_geom_munger(const RenderState *state
 
virtual void push_group_marker (const std::string &marker)
 
virtual void release_geom (GeomContext *gc)=0
 
virtual void release_index_buffer (IndexBufferContext *ibc)=0
 
virtual void release_sampler (SamplerContext *sc)=0
 
virtual void release_shader (ShaderContext *sc)=0
 
virtual void release_shader_buffer (BufferContext *ibc)=0
 
virtual void release_texture (TextureContext *tc)=0
 
virtual void release_vertex_buffer (VertexBufferContext *vbc)=0
 
virtual void remove_window (GraphicsOutputBase *window)=0
 
virtual void set_state_and_transform (const RenderState *state, const TransformState *transform)=0
 
virtual bool update_texture (TextureContext *tc, bool force)=0
 
- Public Member Functions inherited from TypedWritableReferenceCount
 TypedWritableReferenceCount (const TypedWritableReferenceCount &copy)
 
virtual ReferenceCountas_reference_count ()
 Returns the pointer cast to a ReferenceCount pointer, if it is in fact of that type. More...
 
void operator= (const TypedWritableReferenceCount &copy)
 
- Public Member Functions inherited from TypedWritable
 TypedWritable (const TypedWritable &copy)
 
virtual int complete_pointers (TypedWritable **p_list, BamReader *manager)
 Receives an array of pointers, one for each time manager->read_pointer() was called in fillin(). More...
 
vector_uchar encode_to_bam_stream () const
 Converts the TypedWritable object into a single stream of data using a BamWriter, and returns that data as a bytes object. More...
 
bool encode_to_bam_stream (vector_uchar &data, BamWriter *writer=nullptr) const
 Converts the TypedWritable object into a single stream of data using a BamWriter, and stores that data in the indicated string. More...
 
virtual void fillin (DatagramIterator &scan, BamReader *manager)
 This internal function is intended to be called by each class's make_from_bam() method to read in all of the relevant data from the BamFile for the new object. More...
 
virtual void finalize (BamReader *manager)
 Called by the BamReader to perform any final actions needed for setting up the object after all objects have been read and all pointers have been completed. More...
 
UpdateSeq get_bam_modified () const
 Returns the current bam_modified counter. More...
 
void mark_bam_modified ()
 Increments the bam_modified counter, so that this object will be invalidated and retransmitted on any open bam streams. More...
 
void operator= (const TypedWritable &copy)
 
virtual bool require_fully_complete () const
 Some objects require all of their nested pointers to have been completed before the objects themselves can be completed. More...
 
virtual void update_bam_nested (BamWriter *manager)
 Called by the BamWriter when this object has not itself been modified recently, but it should check its nested objects for updates. More...
 
virtual void write_datagram (BamWriter *manager, Datagram &dg)
 Writes the contents of this object to the datagram for shipping out to a Bam file. More...
 
- Public Member Functions inherited from TypedObject
 TypedObject (const TypedObject &copy)=default
 
TypedObjectas_typed_object ()
 Returns the object, upcast (if necessary) to a TypedObject pointer. More...
 
const TypedObjectas_typed_object () const
 Returns the object, upcast (if necessary) to a TypedObject pointer. More...
 
int get_best_parent_from_Set (const std::set< int > &) const
 
int get_type_index () const
 Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. More...
 
bool is_exact_type (TypeHandle handle) const
 Returns true if the current object is the indicated type exactly. More...
 
bool is_of_type (TypeHandle handle) const
 Returns true if the current object is or derives from the indicated type. More...
 
TypedObjectoperator= (const TypedObject &copy)=default
 
- Public Member Functions inherited from ReferenceCount
int get_ref_count () const
 
WeakReferenceListget_weak_list () const
 Returns the WeakReferenceList associated with this ReferenceCount object. More...
 
bool has_weak_list () const
 Returns true if this particular ReferenceCount object has a WeakReferenceList created, false otherwise. More...
 
void local_object ()
 This function should be called, once, immediately after creating a new instance of some ReferenceCount-derived object on the stack. More...
 
void ref () const
 Explicitly increments the reference count. More...
 
bool ref_if_nonzero () const
 Atomically increases the reference count of this object if it is not zero. More...
 
bool test_ref_count_integrity () const
 Does some easy checks to make sure that the reference count isn't completely bogus. More...
 
bool test_ref_count_nonzero () const
 Does some easy checks to make sure that the reference count isn't zero, or completely bogus. More...
 
virtual bool unref () const
 Explicitly decrements the reference count. More...
 
WeakReferenceListweak_ref ()
 Adds the indicated PointerToVoid as a weak reference to this object. More...
 
void weak_unref ()
 Removes the indicated PointerToVoid as a weak reference to this object. More...
 

Static Public Member Functions

static void add_gsg (GraphicsStateGuardianBase *gsg)
 Called by a GSG after it has been initialized, to add a new GSG to the available list. More...
 
static TypeHandle get_class_type ()
 
static GraphicsStateGuardianBaseget_default_gsg ()
 Returns a pointer to the "default" GSG. More...
 
static GraphicsStateGuardianBaseget_gsg (size_t n)
 
static size_t get_num_gsgs ()
 
static void init_type ()
 
static void mark_rehash_generated_shaders ()
 
static void remove_gsg (GraphicsStateGuardianBase *gsg)
 Called by a GSG destructor to remove a GSG from the available list. More...
 
static void set_default_gsg (GraphicsStateGuardianBase *default_gsg)
 Specifies a particular GSG to use as the "default" GSG. More...
 
- Static Public Member Functions inherited from TypedWritableReferenceCount
static TypeHandle get_class_type ()
 
static void init_type ()
 
static PT (TypedWritableReferenceCount) decode_from_bam_stream(vector_uchar data
 
- Static Public Member Functions inherited from TypedWritable
static bool decode_raw_from_bam_stream (TypedWritable *&ptr, ReferenceCount *&ref_ptr, vector_uchar data, BamReader *reader=nullptr)
 Reads the bytes created by a previous call to encode_to_bam_stream(), and extracts the single object on those bytes. More...
 
static TypeHandle get_class_type ()
 
static void init_type ()
 
- Static Public Member Functions inherited from TypedObject
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. More...
 
- Static Public Member Functions inherited from ReferenceCount
static TypeHandle get_class_type ()
 
static void init_type ()
 

Public Attributes

size_t _id
 
virtual Threadcurrent_thread =0
 
 get_gsg
 Returns the nth GSG in the universe. More...
 
 get_num_gsgs
 Returns the total number of GSG's in the universe. More...
 
- Public Attributes inherited from TypedWritableReferenceCount
static BamReaderreader = nullptr)
 
- Public Attributes inherited from TypedObject
 get_type
 
- Public Attributes inherited from ReferenceCount
 get_ref_count
 Returns the current reference count. More...
 

Additional Inherited Members

- Static Public Attributes inherited from TypedWritable
static TypedWritable *const Null = nullptr
 

Detailed Description

This is a base class for the GraphicsStateGuardian class, which is itself a base class for the various GSG's for different platforms.

This class contains all the function prototypes to support the double-dispatch of GSG to geoms, transitions, etc. It lives in a separate class in its own package so we can avoid circular build dependency problems.

GraphicsStateGuardians are not actually writable to bam files, of course, but they may be passed as event parameters, so they inherit from TypedWritableReferenceCount instead of TypedReferenceCount for that convenience.

Definition at line 110 of file graphicsStateGuardianBase.h.

Member Function Documentation

◆ add_gsg()

void GraphicsStateGuardianBase::add_gsg ( GraphicsStateGuardianBase gsg)
static

Called by a GSG after it has been initialized, to add a new GSG to the available list.

Definition at line 97 of file graphicsStateGuardianBase.cxx.

References AtomicAdjustDummyImpl::compare_and_exchange_ptr(), and AtomicAdjustDummyImpl::get_ptr().

◆ get_default_gsg()

GraphicsStateGuardianBase * GraphicsStateGuardianBase::get_default_gsg ( )
static

Returns a pointer to the "default" GSG.

This is typically the first GSG created in an application; in a single-window application, it will be the only GSG. This GSG is used to determine default optimization choices for loaded geometry.

The return value may be NULL if a GSG has not been created.

Definition at line 31 of file graphicsStateGuardianBase.cxx.

References AtomicAdjustDummyImpl::get_ptr().

Referenced by SceneGraphReducer::set_gsg().

◆ remove_gsg()

void GraphicsStateGuardianBase::remove_gsg ( GraphicsStateGuardianBase gsg)
static

Called by a GSG destructor to remove a GSG from the available list.

Definition at line 131 of file graphicsStateGuardianBase.cxx.

References AtomicAdjustDummyImpl::get_ptr().

◆ set_default_gsg()

void GraphicsStateGuardianBase::set_default_gsg ( GraphicsStateGuardianBase default_gsg)
static

Specifies a particular GSG to use as the "default" GSG.

See get_default_gsg().

Definition at line 46 of file graphicsStateGuardianBase.cxx.

References AtomicAdjustDummyImpl::get_ptr().

Member Data Documentation

◆ get_gsg

GraphicsStateGuardianBase * GraphicsStateGuardianBase::get_gsg

Returns the nth GSG in the universe.

GSG's automatically add themselves and remove themselves from this list as they are created and destroyed.

Definition at line 247 of file graphicsStateGuardianBase.h.

Referenced by PipeOcclusionCullTraverser::end_traverse(), PT(), and PipeOcclusionCullTraverser::set_scene().

◆ get_num_gsgs

size_t GraphicsStateGuardianBase::get_num_gsgs

Returns the total number of GSG's in the universe.

Definition at line 247 of file graphicsStateGuardianBase.h.


The documentation for this class was generated from the following files: