Panda3D
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | Friends

DXGraphicsStateGuardian9 Class Reference

A GraphicsStateGuardian for rendering into DirectX9 contexts. More...

#include "dxGraphicsStateGuardian9.h"

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

List of all members.

Classes

struct  TextureRenderStates
struct  TextureStageStates

Public Types

enum  ShaderModel {
  SM_00, SM_11, SM_20, SM_2X,
  SM_30, SM_40
}
typedef bool TextureCallback (TextureContext *tc, void *callback_arg)

Public Member Functions

 DXGraphicsStateGuardian9 (GraphicsEngine *engine, GraphicsPipe *pipe)
virtual void apply_fog (Fog *fog)
bool apply_index_buffer (IndexBufferContext *ibc, const GeomPrimitivePipelineReader *reader, bool force)
 Updates the index buffer with the current data, and makes it the current index buffer for rendering.
void apply_texture (int i, TextureContext *tc)
 Makes the texture the currently available texture for rendering on the ith stage.
bool apply_vertex_buffer (VertexBufferContext *vbc, CLP(ShaderContext)*shader_context, const GeomVertexArrayDataHandle *reader, bool force, string name)
 Updates the vertex buffer with the current data, and makes it the current vertex buffer for rendering.
virtual ReferenceCountas_reference_count ()
 Returns the pointer cast to a ReferenceCount pointer, if it is in fact of that type.
TypedObjectas_typed_object ()
 Returns the object, upcast (if necessary) to a TypedObject pointer.
const TypedObjectas_typed_object () const
 Returns the object, upcast (if necessary) to a TypedObject pointer.
virtual bool begin_draw_primitives (const GeomPipelineReader *geom_reader, const GeomMunger *munger, const GeomVertexDataPipelineReader *data_reader, bool force)
 Called before a sequence of draw_primitive() functions are called, this should prepare the vertex data for rendering.
virtual bool begin_frame (Thread *current_thread)
 Called before each frame is rendered, to allow the GSG a chance to do any internal cleanup before beginning the frame.
virtual void begin_occlusion_query ()
 Begins a new occlusion query.
virtual bool begin_scene ()
 Called between begin_frame() and end_frame() to mark the beginning of drawing commands for a "scene" (usually a particular DisplayRegion) within a frame.
virtual void bind_light (PointLight *light_obj, const NodePath &light, int light_id)
 Called the first time a particular light has been bound to a given id within a frame, this should set up the associated hardware light with the light's properties.
virtual void bind_light (DirectionalLight *light_obj, const NodePath &light, int light_id)
 Called the first time a particular light has been bound to a given id within a frame, this should set up the associated hardware light with the light's properties.
virtual void bind_light (Spotlight *light_obj, const NodePath &light, int light_id)
 Called the first time a particular light has been bound to a given id within a frame, this should set up the associated hardware light with the light's properties.
FrameBufferProperties calc_fb_properties (DWORD cformat, DWORD dformat, DWORD multisampletype, DWORD multisamplequality)
 Convert DirectX framebuffer format ids into a FrameBufferProperties structure.
bool check_dx_allocation (HRESULT result, int allocation_size, int attempts)
 This function is called after the creation of textures, vertex buffers, and index buffers to check if DirectX is out of memory.
virtual void clear (DrawableRegion *clearable)
 Clears all of the indicated buffers to their assigned colors.
virtual void clear_before_callback ()
 Resets any non-standard graphics state that might give a callback apoplexy.
void clear_flash_texture ()
 Resets the "flash texture", so that no textures will flash.
virtual void clear_state_and_transform ()
 Forgets the current graphics state and current transform, so that the next call to set_state_and_transform() will have to reload everything.
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().
virtual float compute_distance_to (const LPoint3f &point) const
 This function may only be called during a render traversal; it will compute the distance to the indicated point, assumed to be in eye coordinates, from the camera plane.
virtual CPT (RenderState) begin_decal_base_first()
virtual CPT (TransformState) calc_projection_mat(const Lens *lens)
virtual bool depth_offset_decals ()
 Returns true if this GSG can implement decals using a DepthOffsetAttrib, or false if that is unreliable and the three-step rendering process should be used instead.
bool do_framebuffer_copy_to_ram (Texture *tex, int z, const DisplayRegion *dr, const RenderBuffer &rb, bool inverted)
 This is the implementation of framebuffer_copy_to_ram(); it adds one additional parameter, which should be true if the framebuffer is to be inverted during the copy (as in the same way it copies to texture memory).
void do_issue_clip_plane ()
 This is fundametically similar to do_issue_light(), with calls to apply_clip_plane() and enable_clip_planes(), as appropriate.
void do_issue_color ()
 This method is defined in the base class because it is likely that this functionality will be used for all (or at least most) kinds of GraphicsStateGuardians--it's not specific to any one rendering backend.
void do_issue_color_scale ()
virtual void do_issue_light ()
 This implementation of do_issue_light() assumes we have a limited number of hardware lights available.
virtual bool draw_lines (const GeomPrimitivePipelineReader *reader, bool force)
 Draws a series of disconnected line segments.
virtual bool draw_linestrips (const GeomPrimitivePipelineReader *reader, bool force)
 Draws a series of line strips.
virtual bool draw_points (const GeomPrimitivePipelineReader *reader, bool force)
 Draws a series of disconnected points.
virtual bool draw_triangles (const GeomPrimitivePipelineReader *reader, bool force)
 Draws a series of disconnected triangles.
virtual bool draw_trifans (const GeomPrimitivePipelineReader *reader, bool force)
 Draws a series of triangle fans.
virtual bool draw_tristrips (const GeomPrimitivePipelineReader *reader, bool force)
 Draws a series of triangle strips.
string encode_to_bam_stream () const
 Converts the TypedWritable object into a single stream of data using a BamWriter, and returns that data as a string string.
bool encode_to_bam_stream (string &data, BamWriter *writer=NULL) const
 Converts the TypedWritable object into a single stream of data using a BamWriter, and stores that data in the indicated string.
virtual void end_draw_primitives ()
 Called after a sequence of draw_primitive() functions are called, this should do whatever cleanup is appropriate.
virtual void end_frame (Thread *current_thread)
 Called after each frame is rendered, to allow the GSG a chance to do any internal cleanup after rendering the frame, and before the window flips.
virtual void end_scene ()
 Called between begin_frame() and end_frame() to mark the end of drawing commands for a "scene" (usually a particular DisplayRegion) within a frame.
virtual bool extract_texture_data (Texture *tex)
 This method should only be called by the GraphicsEngine.
const LMatrix4ffetch_specified_part (Shader::ShaderMatInput input, InternalName *name, LMatrix4f &t)
 See fetch_specified_value.
const LMatrix4ffetch_specified_value (Shader::ShaderMatSpec &spec, int altered)
 The gsg contains a large number of useful matrices:
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.
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.
virtual void finish_decal ()
 Called during draw to clean up after decals are finished.
virtual TypeHandle force_init_type ()
virtual bool framebuffer_copy_to_ram (Texture *tex, int z, const DisplayRegion *dr, const RenderBuffer &rb)
 Copy the pixels within the indicated display region from the framebuffer into system memory, not texture memory.
virtual bool framebuffer_copy_to_texture (Texture *tex, int z, const DisplayRegion *dr, const RenderBuffer &rb)
 Copy the pixels within the indicated display region from the framebuffer into texture memory.
bool get_alpha_scale_via_texture () const
 Returns true if this particular GSG can implement (or would prefer to implement) an alpha scale via an additional Texture layer, or false if we need to actually munge the alpha.
bool get_alpha_scale_via_texture (const TextureAttrib *tex_attrib) const
 This variant of get_alpha_scale_via_texture() answers the question of whether the GSG can implement an alpha scale via an additional Texture layer, considering the current TextureAttrib that will be in effect.
UpdateSeq get_bam_modified () const
 Returns the current bam_modified counter.
int get_best_parent_from_Set (const std::set< int > &) const
bool get_color_scale_via_lighting () const
 Returns true if this particular GSG can implement (or would prefer to implement) set color and/or color scale using materials and/or ambient lights, or false if we need to actually munge the color.
CoordinateSystem get_coordinate_system () const
 Returns the coordinate system in effect on this particular gsg.
bool get_copy_texture_inverted () const
 Returns true if this particular GSG has the property that any framebuffer-to-texture copy results in a texture that is upside-down and backwards from Panda's usual convention; that is, it copies into a texture from the bottom up instead of from the top down.
virtual const TransformStateget_cs_transform () const
 Returns a transform that converts from the GSG's external coordinate system (as returned by get_coordinate_system()) to its internal coordinate system (as returned by get_internal_coordinate_system()).
const DisplayRegionget_current_display_region () const
 Returns the current display region being rendered to, as set by the last call to prepare_display_region().
const Lensget_current_lens () const
 Returns the current lens being used to render, according to the scene specified via the last call to set_scene().
Lens::StereoChannel get_current_stereo_channel () const
 Returns the current stereo channel being rendered to, as set by the last call to prepare_display_region().
virtual bool get_effective_incomplete_render () const
 Returns true if the GSG is effectively in incomplete_render state, considering both the GSG's incomplete_render and its current DisplayRegion's incomplete_render flags.
GraphicsEngineget_engine () const
 Returns the graphics engine that created this GSG.
Textureget_flash_texture () const
 Returns the current "flash texture", if any, or NULL if none.
float get_gamma (float gamma)
 Get the current gamma setting.
virtual bool get_incomplete_render () const
 Returns the incomplete_render flag.
virtual CoordinateSystem get_internal_coordinate_system () const
 Returns the coordinate system used internally by the GSG.
const TransformStateget_inv_cs_transform () const
 Returns the inverse of the transform returned by get_cs_transform().
Loaderget_loader () const
 Returns the Loader object that will be used by this GSG to load textures when necessary, if get_incomplete_render() is true.
int get_max_3d_texture_dimension () const
 Returns the largest possible texture size in any one dimension for a 3-d texture, or -1 if there is no particular limit.
int get_max_clip_planes () const
 Returns the maximum number of simultaneous clip planes that may be applied to geometry, or -1 if there is no particular limit.
int get_max_cube_map_dimension () const
 Returns the largest possible texture size in any one dimension for a cube map texture, or -1 if there is no particular limit.
int get_max_lights () const
 Returns the maximum number of simultaneous lights that may be rendered on geometry, or -1 if there is no particular limit.
virtual int get_max_texture_dimension () const
 Returns the largest possible texture size in any one dimension supported by the GSG, or -1 if there is no particular limit.
int get_max_texture_stages () const
 Returns the maximum number of simultaneous textures that may be applied to geometry with multitexturing, as supported by this particular GSG.
int get_max_vertex_transform_indices () const
 Returns the maximum number of transforms there may be in a single TransformTable for this graphics hardware.
int get_max_vertex_transforms () const
 Returns the maximum number of transform matrices that may be simultaneously used to transform any one vertex by the graphics hardware.
virtual int get_max_vertices_per_array () const
 Returns the maximum number of vertices that should be put into any one GeomVertexData object for use with this GSG.
virtual int get_max_vertices_per_primitive () const
 Returns the maximum number of vertex indices that should be put into any one GeomPrimitive object for use with this GSG.
int get_maximum_simultaneous_render_targets () const
 Returns the maximum simultaneous render targets supported.
GraphicsPipeget_pipe () const
 Returns the graphics pipe on which this GSG was created.
virtual PreparedGraphicsObjectsget_prepared_objects ()
 Returns the set of texture and geom objects that have been prepared with this GSG (and possibly other GSG's that share objects).
int get_ref_count () const
 Returns the current reference count.
RenderBuffer get_render_buffer (int buffer_type, const FrameBufferProperties &prop)
 Returns a RenderBuffer object suitable for operating on the requested set of buffers.
bool get_runtime_color_scale () const
 Returns true if this particular GSG can implement (or would prefer to implement) set color and/or color scale directly, without requiring any munging of vertices or tricks with lighting.
virtual SceneSetupget_scene () const
 Returns the current SceneSetup object.
int get_shader_model () const
 Returns the ShaderModel.
virtual int get_supported_geom_rendering () const
 Returns the union of Geom::GeomRendering values that this particular GSG can support directly.
bool get_supports_3d_texture () const
 Returns true if this GSG can render 3-d (volumetric) textures.
bool get_supports_basic_shaders () const
 Returns true if this particular GSG supports arbfp1+arbvp1 or above.
virtual bool get_supports_cg_profile (const string &name) const
 Returns true if this particular GSG supports the specified Cg Shader Profile.
bool get_supports_compressed_texture () const
 Returns true if this GSG can compress textures as it loads them into texture memory, and/or accept pre-compressed textures for storing.
virtual bool get_supports_compressed_texture_format (int compression_mode) const
 Returns true if this GSG can accept textures pre-compressed in the indicated format.
bool get_supports_cube_map () const
 Returns true if this GSG can render cube map textures.
bool get_supports_depth_stencil () const
 Returns true if this particular GSG supports textures whose format is F_depth_stencil.
bool get_supports_depth_texture () const
 Returns true if this particular GSG supports textures whose format is F_depth_stencil.
bool get_supports_generate_mipmap () const
 Returns true if this particular GSG can generate mipmaps for a texture automatically, or if they must be generated in software.
bool get_supports_geometry_instancing () const
 Returns true if this particular GSG supports hardware geometry instancing: the ability to render multiple copies of a model.
bool get_supports_glsl () const
 Returns true if this particular GSG supports GLSL shaders.
virtual bool get_supports_multisample () const
 Returns true if this particular GSG supports using the multisample bits to provide antialiasing, and also supports M_multisample and M_multisample_mask transparency modes.
virtual bool get_supports_occlusion_query () const
 Returns true if this GSG supports an occlusion query.
bool get_supports_render_texture () const
 Returns true if this particular GSG can render directly into a texture, or false if it must always copy-to-texture at the end of each frame to achieve this effect.
bool get_supports_shadow_filter () const
 Returns true if this particular GSG supports the filter mode FT_shadow for depth textures.
bool get_supports_stencil () const
 Returns true if this particular GSG supports stencil buffers at all.
bool get_supports_tex_non_pow2 () const
 Returns true if this GSG can handle non power of two sized textures.
bool get_supports_texture_combine () const
 Returns true if this particular GSG can use the TextureStage::M_combine mode, which includes all of the texture blend modes specified by set_combine_rgb() and/or set_combine_alpha().
bool get_supports_texture_dot3 () const
 Returns true if this GSG can use the TextureStage::CM_dot3_rgb or CM_dot3_rgba combine modes.
bool get_supports_texture_saved_result () const
 Returns true if this GSG can use the TextureStage::CS_last_saved_result source, which allows you to save the result of a TextureStage and re-use it for multiple inputs.
bool get_supports_two_sided_stencil () const
 Returns true if this particular GSG supports two sided stencil: different stencil settings for the front and back side of the same polygon.
Texture::QualityLevel get_texture_quality_override () const
 Returns the global quality_level override specified by set_texture_quality_override.
const GraphicsThreadingModelget_threading_model () const
 Returns the threading model that was used to create this GSG.
virtual TypeHandle get_type () const
int get_type_index () const
 Returns the internal index number associated with this object's TypeHandle, a unique number for each different type.
WeakReferenceListget_weak_list () const
 Returns the WeakReferenceList associated with this ReferenceCount object.
bool has_weak_list () const
 Returns true if this particular ReferenceCount object has a WeakReferenceList created, false otherwise.
bool is_active () const
 Returns the active flag associated with the GraphicsStateGuardian.
bool is_exact_type (TypeHandle handle) const
 Returns true if the current object is the indicated type exactly.
bool is_hardware () const
 Returns true if this GSG appears to be hardware-accelerated, or false if it is known to be software only.
bool is_of_type (TypeHandle handle) const
 Returns true if the current object is or derives from the indicated type.
bool is_valid () const
 Returns true if the GSG has been correctly initialized within a graphics context, false if there has been some problem or it hasn't been initialized yet.
void local_object ()
 This function should be called, once, immediately after creating a new instance of some ReferenceCount-derived object on the stack.
 MAKE_SEQ (get_gsgs, get_num_gsgs, get_gsg)
void mark_bam_modified ()
 Increments the bam_modified counter, so that this object will be invalidated and retransmitted on any open bam streams.
void mark_new ()
 Marks the GSG as "new", so that the next call to reset_if_new() will be effective.
bool needs_reset () const
 Returns true if the gsg is marked as needing a reset.
void operator delete (void *ptr, void *)
void operator delete (void *ptr, void *)
void operator delete (void *ptr)
void operator delete (void *ptr)
void operator delete[] (void *, void *)
void operator delete[] (void *ptr)
void operator delete[] (void *ptr)
void operator delete[] (void *, void *)
void * operator new (size_t size, void *ptr)
void * operator new (size_t size, void *ptr)
void * operator new (size_t size)
void * operator new (size_t size)
void * operator new[] (size_t size)
void * operator new[] (size_t size, void *ptr)
void * operator new[] (size_t size, void *ptr)
void * operator new[] (size_t size)
virtual bool prefers_triangle_strips () const
 Returns true if this GSG strongly prefers triangle strips to individual triangles (such as SGI), or false if it prefers to minimize the number of primitive batches, even at the expense of triangle strips (such as most PC hardware).
virtual void prepare_display_region (DisplayRegionPipelineReader *dr, Lens::StereoChannel stereo_channel)
 Prepare a display region for rendering (set up scissor region and viewport)
virtual GeomContextprepare_geom (Geom *geom)
 Prepares the indicated Geom for retained-mode rendering, by creating whatever structures are necessary in the GSG (for instance, vertex buffers).
virtual IndexBufferContextprepare_index_buffer (GeomPrimitive *data)
 Creates a new retained-mode representation of the given data, and returns a newly-allocated IndexBufferContext pointer to reference it.
virtual bool prepare_lens ()
 Makes the current lens (whichever lens was most recently specified with set_scene()) active, so that it will transform future rendered geometry.
ShaderContextprepare_shader (Shader *se)
 Compile a vertex/fragment shader body.
virtual TextureContextprepare_texture (Texture *tex)
 Creates a new retained-mode representation of the given texture, and returns a newly-allocated TextureContext pointer to reference it.
virtual VertexBufferContextprepare_vertex_buffer (GeomVertexArrayData *data)
 Creates a new retained-mode representation of the given data, and returns a newly-allocated VertexBufferContext pointer to reference it.
virtual PT (Texture) make_shadow_buffer(const NodePath &light_np
virtual PT (GeomMunger) make_geom_munger(const RenderState *state
virtual PT (OcclusionQueryContext) end_occlusion_query()
void ref () const
 Explicitly increments the reference count.
void release_all ()
 Releases all prepared objects.
int release_all_geoms ()
 Frees the resources for all geoms associated with this GSG.
int release_all_index_buffers ()
 Frees the resources for all index buffers associated with this GSG.
int release_all_textures ()
 Frees the resources for all textures associated with this GSG.
int release_all_vertex_buffers ()
 Frees the resources for all vertex buffers associated with this GSG.
virtual void release_geom (GeomContext *gc)
 Frees the resources previously allocated via a call to prepare_geom(), including deleting the GeomContext itself, if it is non-NULL.
virtual void release_index_buffer (IndexBufferContext *ibc)
 Frees the GL resources previously allocated for the data.
void release_shader (ShaderContext *sc)
 Releases the resources allocated by prepare_shader.
virtual void release_texture (TextureContext *tc)
 Frees the GL resources previously allocated for the texture.
virtual void release_vertex_buffer (VertexBufferContext *vbc)
 Frees the GL resources previously allocated for the data.
virtual void remove_window (GraphicsOutputBase *window)
 This is simply a transparent call to GraphicsEngine::remove_window().
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.
virtual void reset ()
 Resets all internal state as if the gsg were newly created.
bool reset_if_new ()
 Calls reset() to initialize the GSG, but only if it hasn't been called yet.
void reset_render_states (void)
void restore_gamma ()
 Restore original gamma.
void set_active (bool active)
 Sets the active flag associated with the GraphicsStateGuardian.
void set_coordinate_system (CoordinateSystem cs)
 Changes the coordinate system in effect on this particular gsg.
void set_current_properties (const FrameBufferProperties *properties)
 Notifies the gsg that it is about to render into a window/buffer with the given FrameBufferProperties.
void set_flash_texture (Texture *tex)
 Sets the "flash texture".
bool set_gamma (float gamma)
 Non static version of setting gamma.
void set_incomplete_render (bool incomplete_render)
 Sets the incomplete_render flag.
void set_loader (Loader *loader)
 Sets the Loader object that will be used by this GSG to load textures when necessary, if get_incomplete_render() is true.
HRESULT set_render_state (D3DRENDERSTATETYPE state, DWORD value)
 This function creates a common layer between DX and Panda for SetRenderState.
HRESULT set_sampler_state (DWORD sampler, D3DSAMPLERSTATETYPE type, DWORD value)
 This function creates a common layer between DX and Panda.
bool set_scene (SceneSetup *scene_setup)
 Sets the SceneSetup object that indicates the initial camera position, etc.
void set_shader_model (int shader_model)
 Sets the ShaderModel.
virtual void set_state_and_transform (const RenderState *state, const TransformState *transform)
 Simultaneously resets the render state and the transform state.
void set_texture_quality_override (Texture::QualityLevel quality_level)
 Specifies the global quality_level to be imposed for all Textures rendered by this GSG.
HRESULT set_texture_stage_state (DWORD stage, D3DTEXTURESTAGESTATETYPE type, DWORD value)
 This function creates a common layer between DX and Panda.
bool test_ref_count_integrity () const
 Does some easy checks to make sure that the reference count isn't completely bogus.
bool test_ref_count_nonzero () const
 Does some easy checks to make sure that the reference count isn't zero, or completely bogus.
void traverse_prepared_textures (TextureCallback *func, void *callback_arg)
 Calls the indicated function on all currently-prepared textures, or until the callback function returns false.
virtual bool unref () const
 Explicitly decrements the reference count.
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.
virtual bool update_texture (TextureContext *tc, bool force)
 Ensures that the current Texture data is refreshed onto the GSG.
bool upload_texture (DXTextureContext9 *dtc, bool force)
 Creates a texture surface on the graphics card and fills it with its pixel data.
void weak_ref (WeakPointerToVoid *ptv)
 Adds the indicated PointerToVoid as a weak reference to this object.
void weak_unref (WeakPointerToVoid *ptv)
 Removes the indicated PointerToVoid as a weak reference to this object.
virtual void write_datagram (BamWriter *manager, Datagram &dg)
 Writes the contents of this object to the datagram for shipping out to a Bam file.

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.
static void atexit_function (void)
 This function is passed to the atexit function.
static DWORD Colorf_to_D3DCOLOR (const Colorf &cColorf)
 Converts Panda's floating-point Colorf structure to DirectX's D3DCOLOR packed structure.
static void create_gamma_table (float gamma, unsigned short *red_table, unsigned short *green_table, unsigned short *blue_table)
 Create a gamma table.
static bool decode_raw_from_bam_stream (TypedWritable *&ptr, ReferenceCount *&ref_ptr, const string &data, BamReader *reader=NULL)
 Reads the string created by a previous call to encode_to_bam_stream(), and extracts the single object on that string.
static TextureStageget_alpha_scale_texture_stage ()
 Returns the TextureStage that will be used to apply an alpha scale, if get_alpha_scale_via_texture() returns true.
static TypeHandle get_class_type ()
static GraphicsStateGuardianBaseget_default_gsg ()
 Returns a pointer to the "default" GSG.
static bool get_gamma_table (void)
 Static function for getting the original gamma.
static GraphicsStateGuardianBaseget_gsg (int n)
 Returns the nth GSG in the universe.
static D3DFORMAT get_index_type (Geom::NumericType numeric_type)
 Maps from the Geom's internal numeric type symbols to DirectX's.
static int get_num_gsgs ()
 Returns the total number of GSG's in the universe.
static void init_type ()
static PT (TypedWritableReferenceCount) decode_from_bam_stream(const string &data
static void remove_gsg (GraphicsStateGuardianBase *gsg)
 Called by a GSG destructor to remove a GSG from the available list.
static void set_cg_device (LPDIRECT3DDEVICE9 cg_device)
 Sets the global Cg device pointer.
static void set_default_gsg (GraphicsStateGuardianBase *default_gsg)
 Specifies a particular GSG to use as the "default" GSG.
static bool static_set_gamma (bool restore, float gamma)
 Static function for setting gamma which is needed for atexit.

Public Attributes

DXScreenData_screen
virtual Threadcurrent_thread
virtual GraphicsOutputBasehost
static BamReaderreader = NULL)

Static Public Attributes

static PStatCollector _clear_pcollector
static PStatCollector _create_index_buffer_pcollector
static PStatCollector _create_vertex_buffer_pcollector
static PStatCollector _data_transferred_pcollector
static PStatCollector _draw_primitive_pcollector
static PStatCollector _draw_set_state_alpha_test_pcollector
static PStatCollector _draw_set_state_antialias_pcollector
static PStatCollector _draw_set_state_blending_pcollector
static PStatCollector _draw_set_state_clip_plane_pcollector
static PStatCollector _draw_set_state_color_pcollector
static PStatCollector _draw_set_state_cull_face_pcollector
static PStatCollector _draw_set_state_depth_offset_pcollector
static PStatCollector _draw_set_state_depth_test_pcollector
static PStatCollector _draw_set_state_depth_write_pcollector
static PStatCollector _draw_set_state_fog_pcollector
static PStatCollector _draw_set_state_light_pcollector
static PStatCollector _draw_set_state_material_pcollector
static PStatCollector _draw_set_state_pcollector
static PStatCollector _draw_set_state_render_mode_pcollector
static PStatCollector _draw_set_state_rescale_normal_pcollector
static PStatCollector _draw_set_state_scissor_pcollector
static PStatCollector _draw_set_state_shade_model_pcollector
static PStatCollector _draw_set_state_shader_parameters_pcollector
static PStatCollector _draw_set_state_shader_pcollector
static PStatCollector _draw_set_state_stencil_pcollector
static PStatCollector _draw_set_state_tex_gen_pcollector
static PStatCollector _draw_set_state_tex_matrix_pcollector
static PStatCollector _draw_set_state_texture_pcollector
static PStatCollector _draw_set_state_transform_pcollector
static PStatCollector _flush_pcollector
static PStatCollector _index_buffer_switch_pcollector
static PStatCollector _load_index_buffer_pcollector
static PStatCollector _load_texture_pcollector
static PStatCollector _load_vertex_buffer_pcollector
static PStatCollector _primitive_batches_other_pcollector
static PStatCollector _primitive_batches_pcollector
static PStatCollector _primitive_batches_tri_pcollector
static PStatCollector _primitive_batches_trifan_pcollector
static PStatCollector _primitive_batches_tristrip_pcollector
static PStatCollector _state_pcollector
static PStatCollector _texmgrmem_resident_pcollector
static PStatCollector _texmgrmem_total_pcollector
static PStatCollector _texture_state_pcollector
static PStatCollector _transform_state_pcollector
static PStatCollector _vertex_buffer_switch_pcollector
static PStatCollector _vertices_indexed_tristrip_pcollector
static PStatCollector _vertices_other_pcollector
static PStatCollector _vertices_tri_pcollector
static PStatCollector _vertices_trifan_pcollector
static PStatCollector _vertices_tristrip_pcollector
static PStatCollector _wait_occlusion_pcollector
static TypedWritable *const Null = (TypedWritable*)0L

Protected Types

typedef pmap< NodePath, D3DLIGHT9 > DirectionalLights
enum  DxgsgFogType { None, PerVertexFog = D3DRS_FOGVERTEXMODE, PerPixelFog = D3DRS_FOGTABLEMODE }

Protected Member Functions

void async_reload_texture (TextureContext *tc)
 Should be called when a texture is encountered that needs to have its RAM image reloaded, and get_incomplete_render() is true.
virtual void begin_bind_clip_planes ()
 Called immediately before bind_clip_plane() is called, this is intended to provide the derived class a hook in which to set up some state (like transform) that might apply to several planes.
virtual void begin_bind_lights ()
 Called immediately before bind_light() is called, this is intended to provide the derived class a hook in which to set up some state (like transform) that might apply to several lights.
virtual void bind_clip_plane (const NodePath &plane, int plane_id)
 Called the first time a particular clip_plane has been bound to a given id within a frame, this should set up the associated hardware clip_plane with the clip_plane's properties.
bool check_cooperative_level ()
virtual void close_gsg ()
 This is called by the associated GraphicsWindow when close_window() is called.
 CLP (ShaderContext)*_current_shader_context
 CLP (ShaderContext)*_vertex_array_shader_context
 CLP (ShaderContext)*_texture_binding_shader_context
void copy_pres_reset (DXScreenData *new_context)
 copies the PresReset from passed DXScreenData
 CPT (Lens) _current_lens
 CPT (TransformState) _internal_transform
 CPT (TextureAttrib) _target_texture
 CPT (TexGenAttrib) _target_tex_gen
 CPT (ShaderAttrib) _state_shader
 CPT (GeomMunger) _munger
 CPT (DisplayRegion) _current_display_region
bool create_swap_chain (DXScreenData *new_context)
void determine_light_color_scale ()
 Called whenever the color or color scale is changed, if _color_scale_via_lighting is true.
void determine_target_texture ()
 Assigns _target_texture and _target_tex_gen based on the _target_rs.
void disable_standard_texture_bindings ()
void do_auto_rescale_normal ()
 Issues the appropriate DX commands to either rescale or normalize the normals according to the current transform.
void do_issue_alpha_test ()
void do_issue_blending ()
 Called after any of the things that might change blending state have changed, this function is responsible for setting the appropriate color blending mode based on the current properties.
void do_issue_color_write ()
void do_issue_cull_face ()
void do_issue_depth_offset ()
void do_issue_depth_test ()
void do_issue_depth_write ()
void do_issue_fog ()
void do_issue_material ()
void do_issue_render_mode ()
void do_issue_rescale_normal ()
void do_issue_scissor ()
void do_issue_shade_model ()
void do_issue_shader ()
void do_issue_stencil ()
 Set stencil render states.
void do_issue_tex_gen ()
void do_issue_texture ()
void do_issue_transform ()
 Sends the indicated transform matrix to the graphics API to be applied to future vertices.
bool do_test_ref_count_integrity () const
 Does some easy checks to make sure that the reference count isn't completely bogus.
bool do_test_ref_count_nonzero () const
 Returns true if the reference count is nonzero, false otherwise.
void draw_indexed_primitive_up (D3DPRIMITIVETYPE primitive_type, unsigned int min_index, unsigned int max_index, unsigned int num_primitives, const unsigned char *index_data, D3DFORMAT index_type, const unsigned char *buffer, size_t stride)
 Issues the DrawIndexedPrimitiveUP call to draw the indicated primitive_type from the given buffer.
void draw_primitive_up (D3DPRIMITIVETYPE primitive_type, unsigned int primitive_count, unsigned int first_vertex, unsigned int num_vertices, const unsigned char *buffer, size_t stride)
 Issues the DrawPrimitiveUP call to draw the indicated primitive_type from the given buffer.
void dx_cleanup ()
 Clean up the DirectX environment, accounting for exit()
virtual void enable_clip_plane (int plane_id, bool enable)
 Intended to be overridden by a derived class to enable the indicated clip_plane id.
virtual void enable_clip_planes (bool enable)
 Intended to be overridden by a derived class to enable or disable the use of clipping planes overall.
virtual void enable_light (int light_id, bool enable)
 Intended to be overridden by a derived class to enable the indicated light id.
virtual void enable_lighting (bool enable)
 Intended to be overridden by a derived class to enable or disable the use of lighting overall.
virtual void end_bind_clip_planes ()
 Called after before bind_clip_plane() has been called one or more times (but before any geometry is issued or additional state is changed), this is intended to clean up any temporary changes to the state that may have been made by begin_bind_clip_planes().
virtual void end_bind_lights ()
 Called after before bind_light() has been called one or more times (but before any geometry is issued or additional state is changed), this is intended to clean up any temporary changes to the state that may have been made by begin_bind_lights().
void free_d3d_device ()
 setup for re-calling dx_init(), this is not the final exit cleanup routine (see dx_cleanup)
void free_nondx_resources ()
 Frees some memory that was explicitly allocated within the dxgsg.
virtual void free_pointers ()
 Frees some memory that was explicitly allocated within the glgsg.
const D3DCOLORVALUE & get_light_color (Light *light) const
 Returns the array of four floats that should be issued as the light's color, as scaled by the current value of _light_color_scale, in the case of color_scale_via_lighting.
DWORD get_texture_argument (TextureStage::CombineSource source, TextureStage::CombineOperand operand) const
 Returns the D3DTA value corresponding to the indicated TextureStage::CombineSource and TextureStage::CombineOperand enumerated types.
void panic_deactivate ()
 This is called internally when it is determined that things are just fubar.
 PT (SceneSetup) _scene_null
 PT (Shader) _current_shader
 PT (Loader) _loader
 PT (Shader) _vertex_array_shader
 PT (Shader) _texture_binding_shader
 PT (PreparedGraphicsObjects) _prepared_objects
 PT (Texture) _flash_texture
virtual void reissue_transforms ()
 Called by clear_state_and_transform() to ensure that the current modelview and projection matrices are properly loaded in the graphics state, after a callback might have mucked them up.
bool release_swap_chain (DXScreenData *new_context)
 Release the swap chain on this DXScreenData.
void report_texmgr_stats ()
 Reports the DX texture manager's activity to PStats.
HRESULT reset_d3d_device (D3DPRESENT_PARAMETERS *p_presentation_params, DXScreenData **screen=NULL)
 This function checks current device's framebuffer dimension against passed p_presentation_params backbuffer dimension to determine a device reset if there is only one window or it is the main window or fullscreen mode then, it resets the device.
virtual void set_ambient_light (const Colorf &color)
 Intended to be overridden by a derived class to indicate the color of the ambient light that should be in effect.
void set_context (DXScreenData *new_context)
void set_draw_buffer (const RenderBuffer &rb)
 Sets up the glDrawBuffer to render into the buffer indicated by the RenderBuffer object.
void set_read_buffer (const RenderBuffer &rb)
 Vestigial analog of glReadBuffer.
void set_render_target ()
 Set render target to the backbuffer of current swap chain.
void set_texture_blend_mode (int i, const TextureStage *stage)
void show_frame ()
 redraw primary buffer
void update_standard_texture_bindings ()

Static Protected Member Functions

static D3DBLEND get_blend_func (ColorBlendAttrib::Operand operand)
 Maps from ColorBlendAttrib::Operand to D3DBLEND value.
static D3DTEXTUREFILTERTYPE get_d3d_min_type (Texture::FilterType filter_type)
static D3DTEXTUREFILTERTYPE get_d3d_mip_type (Texture::FilterType filter_type)
static D3DFOGMODE get_fog_mode_type (Fog::Mode m)
 Maps from the fog types to gl version.
static unsigned char * get_safe_buffer_start ()
 Returns the address of a 64K buffer that is allocated at the beginning of a 64K block.
static D3DTRANSFORMSTATETYPE get_tex_mat_sym (int stage_index)
 Returns the nth D3DTS_TEXTURE(n) constant.
static DWORD get_texture_argument_modifier (TextureStage::CombineOperand operand)
 Returns the extra bits that modify the D3DTA argument, according to the indicated TextureStage::CombineOperand enumerated type.
static D3DTEXTUREOP get_texture_operation (TextureStage::CombineMode mode, int scale)
 Returns the D3DTEXTUREOP value corresponding to the indicated TextureStage::CombineMode enumerated type.
static D3DTEXTUREADDRESS get_texture_wrap_mode (Texture::WrapMode wm)
 Maps from the Texture's internal wrap mode symbols to GL's.
static PT (TextureStage) _alpha_scale_texture_stage

Protected Attributes

bool _active
const DXIndexBufferContext9_active_ibuffer
const DXVertexBufferContext9_active_vbuffer
bool _alpha_scale_via_texture
int _auto_detect_shader_model
bool _auto_rescale_normal
UINT _available_texture_memory
DWORD _clip_plane_bits
bool _clip_planes_enabled
bool _closing_gsg
bool _color_blend_involves_color_scale
bool _color_scale_enabled
bool _color_scale_via_lighting
unsigned int _color_write_mask
BitMask32 _compressed_texture_formats
DWORD _constant_color_operand
CoordinateSystem _coordinate_system
bool _copy_texture_inverted
CullFaceAttrib::Mode _cull_face_mode
RenderBuffer::Type _cur_read_pixel_buffer
LVecBase4f _current_color_scale
RenderModeAttrib::Mode _current_fill_mode
const FrameBufferProperties_current_properties
Lens::StereoChannel _current_stereo_channel
D3DVIEWPORT9 _current_viewport
LPDIRECT3DDEVICE9 _d3d_device
const
GeomVertexDataPipelineReader
_data_reader
DirectionalLights _dlights
DxgsgFogType _do_fog_type
bool _dx_is_ready
bool _effective_incomplete_render
float _gamma
list< wdxGraphicsBuffer9 ** > _graphics_buffer_list
int _gsg_managed_index_buffers
int _gsg_managed_textures
int _gsg_managed_vertex_buffers
bool _has_material_force_color
bool _has_scene_graph_color
bool _has_texture_alpha_scale
bool _incomplete_render
CoordinateSystem _internal_coordinate_system
bool _is_hardware
bool _is_valid
DWORD _last_fvf
int _last_max_stage_index
HRESULT _last_testcooplevel_result
LVecBase4f _light_color_scale
bool _lighting_enabled
float _material_ambient
float _material_diffuse
float _material_emission
Colorf _material_force_color
float _material_shininess
float _material_specular
int _max_3d_texture_dimension
int _max_clip_planes
int _max_cube_map_dimension
int _max_lights
int _max_texture_dimension
int _max_texture_stages
int _max_vertex_transform_indices
int _max_vertex_transforms
int _max_vertices_per_array
int _max_vertices_per_primitive
int _maximum_simultaneous_render_targets
bool _needs_reset
int _num_active_texture_stages
bool _overlay_windows_supported
char * _pixel_shader_profile
int _pixel_shader_version_major
int _pixel_shader_version_minor
bool _prefers_triangle_strips
D3DPRESENT_PARAMETERS _presentation_reset
DWORD _render_state_array [256]
bool _runtime_color_scale
Colorf _scene_graph_color
Shader::ShaderCaps _shader_caps
ShaderGenerator_shader_generator
int _shader_model
RenderState::SlotMask _state_mask
StencilRenderStates_stencil_render_states
int _stereo_buffer_mask
int _supported_geom_rendering
bool _supports_3d_texture
bool _supports_basic_shaders
bool _supports_compressed_texture
bool _supports_cube_map
bool _supports_depth_bias
bool _supports_depth_stencil
bool _supports_depth_texture
bool _supports_framebuffer_blit
bool _supports_framebuffer_multisample
int _supports_gamma_calibration
bool _supports_generate_mipmap
bool _supports_geometry_instancing
bool _supports_glsl
bool _supports_multisample
bool _supports_occlusion_query
bool _supports_render_texture
bool _supports_shadow_filter
bool _supports_stencil
bool _supports_stencil_wrap
bool _supports_stream_offset
bool _supports_tex_non_pow2
bool _supports_texture_combine
bool _supports_texture_constant_color
bool _supports_texture_dot3
bool _supports_texture_saved_result
bool _supports_two_sided_stencil
IDirect3DSwapChain9 * _swap_chain
bool _tex_gen_modifies_mat
bool _tex_gen_point_sprite
bool _tex_stats_retrieval_impossible
bool _texture_involves_color_scale
Texture::QualityLevel _texture_quality_override
TextureRenderStates _texture_render_states_array [16]
TextureStageStates _texture_stage_states_array [D3D_MAXTEXTURESTAGES]
bool _transform_stale
bool _vertex_blending_enabled
bool _vertex_colors_enabled
int _vertex_shader_maximum_constants
char * _vertex_shader_profile
int _vertex_shader_version_major
int _vertex_shader_version_minor

Static Protected Attributes

static LPDIRECT3DDEVICE9 _cg_device = NULL
static D3DMATRIX _d3d_ident_mat
static unsigned char * _safe_buffer_start = NULL
static unsigned char * _temp_buffer = NULL

Friends

class DXIndexBufferContext9
class DXShaderContext9
class DXTextureContext9
class DXVertexBufferContext9
class wdxGraphicsBuffer9
class wdxGraphicsPipe9
class wdxGraphicsWindow9
class wdxGraphicsWindowGroup9

Detailed Description

A GraphicsStateGuardian for rendering into DirectX9 contexts.

Definition at line 66 of file dxGraphicsStateGuardian9.h.


Member Function Documentation

void GraphicsStateGuardianBase::add_gsg ( GraphicsStateGuardianBase gsg) [static, inherited]

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

Definition at line 90 of file graphicsStateGuardianBase.cxx.

Referenced by TinyGraphicsStateGuardian::reset(), reset(), and DXGraphicsStateGuardian8::reset().

bool DXGraphicsStateGuardian9::apply_index_buffer ( IndexBufferContext ibc,
const GeomPrimitivePipelineReader reader,
bool  force 
)
void DXGraphicsStateGuardian9::apply_texture ( int  i,
TextureContext tc 
)
bool DXGraphicsStateGuardian9::apply_vertex_buffer ( VertexBufferContext vbc,
CLP(ShaderContext)*  shader_context,
const GeomVertexArrayDataHandle reader,
bool  force,
string  name 
)
ReferenceCount * TypedWritableReferenceCount::as_reference_count ( ) [virtual, inherited]

Returns the pointer cast to a ReferenceCount pointer, if it is in fact of that type.

Reimplemented from TypedWritable.

Definition at line 26 of file typedWritableReferenceCount.cxx.

TypedObject * TypedObject::as_typed_object ( ) [inline, inherited]

Returns the object, upcast (if necessary) to a TypedObject pointer.

Definition at line 99 of file typedObject.I.

const TypedObject * TypedObject::as_typed_object ( ) const [inline, inherited]

Returns the object, upcast (if necessary) to a TypedObject pointer.

Definition at line 110 of file typedObject.I.

void GraphicsStateGuardian::async_reload_texture ( TextureContext tc) [protected, inherited]

Should be called when a texture is encountered that needs to have its RAM image reloaded, and get_incomplete_render() is true.

This will fire off a thread on the current Loader object that will request the texture to load its image. The image will be available at some point in the future (no event will be generated).

Definition at line 2539 of file graphicsStateGuardian.cxx.

References AsyncTaskCollection::get_num_tasks(), AsyncTask::get_priority(), AsyncTaskCollection::get_task(), TextureContext::get_texture(), TypedObject::is_exact_type(), and AsyncTask::set_priority().

Referenced by DXGraphicsStateGuardian8::upload_texture(), and upload_texture().

void DXGraphicsStateGuardian9::atexit_function ( void  ) [static]

This function is passed to the atexit function.

Definition at line 5710 of file dxGraphicsStateGuardian9.cxx.

References set_cg_device(), and static_set_gamma().

void GraphicsStateGuardian::begin_bind_clip_planes ( ) [protected, virtual, inherited]

Called immediately before bind_clip_plane() is called, this is intended to provide the derived class a hook in which to set up some state (like transform) that might apply to several planes.

The sequence is: begin_bind_clip_planes() will be called, then one or more bind_clip_plane() calls, then end_bind_clip_planes().

Definition at line 2323 of file graphicsStateGuardian.cxx.

Referenced by GraphicsStateGuardian::do_issue_clip_plane().

void GraphicsStateGuardian::begin_bind_lights ( ) [protected, virtual, inherited]

Called immediately before bind_light() is called, this is intended to provide the derived class a hook in which to set up some state (like transform) that might apply to several lights.

The sequence is: begin_bind_lights() will be called, then one or more bind_light() calls, then end_bind_lights().

Definition at line 2270 of file graphicsStateGuardian.cxx.

Referenced by GraphicsStateGuardian::do_issue_light().

bool DXGraphicsStateGuardian9::begin_draw_primitives ( const GeomPipelineReader geom_reader,
const GeomMunger munger,
const GeomVertexDataPipelineReader data_reader,
bool  force 
) [virtual]
bool DXGraphicsStateGuardian9::begin_frame ( Thread current_thread) [virtual]

Called before each frame is rendered, to allow the GSG a chance to do any internal cleanup before beginning the frame.

The return value is true if successful (in which case the frame will be drawn and end_frame() will be called later), or false if unsuccessful (in which case nothing will be drawn and end_frame() will not be called).

Reimplemented from GraphicsStateGuardian.

Definition at line 1048 of file dxGraphicsStateGuardian9.cxx.

void DXGraphicsStateGuardian9::begin_occlusion_query ( ) [virtual]

Begins a new occlusion query.

After this call, you may call begin_draw_primitives() and draw_triangles()/draw_whatever() repeatedly. Eventually, you should call end_occlusion_query() before the end of the frame; that will return a new OcclusionQueryContext object that will tell you how many pixels represented by the bracketed geometry passed the depth test.

It is not valid to call begin_occlusion_query() between another begin_occlusion_query() .. end_occlusion_query() sequence.

Reimplemented from GraphicsStateGuardian.

Definition at line 781 of file dxGraphicsStateGuardian9.cxx.

bool DXGraphicsStateGuardian9::begin_scene ( ) [virtual]

Called between begin_frame() and end_frame() to mark the beginning of drawing commands for a "scene" (usually a particular DisplayRegion) within a frame.

All 3-D drawing commands, except the clear operation, must be enclosed within begin_scene() .. end_scene().

The return value is true if successful (in which case the scene will be drawn and end_scene() will be called later), or false if unsuccessful (in which case nothing will be drawn and end_scene() will not be called).

Reimplemented from GraphicsStateGuardian.

Definition at line 1097 of file dxGraphicsStateGuardian9.cxx.

References GraphicsStateGuardian::begin_scene().

void DXGraphicsStateGuardian9::bind_clip_plane ( const NodePath plane,
int  plane_id 
) [protected, virtual]

Called the first time a particular clip_plane has been bound to a given id within a frame, this should set up the associated hardware clip_plane with the clip_plane's properties.

Reimplemented from GraphicsStateGuardian.

Definition at line 4146 of file dxGraphicsStateGuardian9.cxx.

References LMatrix4f::convert_mat(), PlaneNode::get_plane(), NodePath::get_transform(), and NodePath::node().

void DXGraphicsStateGuardian9::bind_light ( PointLight light_obj,
const NodePath light,
int  light_id 
) [virtual]

Called the first time a particular light has been bound to a given id within a frame, this should set up the associated hardware light with the light's properties.

Reimplemented from GraphicsStateGuardian.

Definition at line 3450 of file dxGraphicsStateGuardian9.cxx.

References LMatrix4f::convert_mat(), PointLight::get_attenuation(), LVecBase3f::get_data(), LVecBase4f::get_data(), get_light_color(), PointLight::get_point(), PointLight::get_specular_color(), and NodePath::get_transform().

void DXGraphicsStateGuardian9::bind_light ( DirectionalLight light_obj,
const NodePath light,
int  light_id 
) [virtual]

Called the first time a particular light has been bound to a given id within a frame, this should set up the associated hardware light with the light's properties.

Reimplemented from GraphicsStateGuardian.

Definition at line 3496 of file dxGraphicsStateGuardian9.cxx.

References LMatrix4f::convert_mat(), LVecBase3f::get_data(), LVecBase4f::get_data(), DirectionalLight::get_direction(), get_light_color(), DirectionalLight::get_specular_color(), and NodePath::get_transform().

void DXGraphicsStateGuardian9::bind_light ( Spotlight light_obj,
const NodePath light,
int  light_id 
) [virtual]

Called the first time a particular light has been bound to a given id within a frame, this should set up the associated hardware light with the light's properties.

Reimplemented from GraphicsStateGuardian.

Definition at line 3552 of file dxGraphicsStateGuardian9.cxx.

References LMatrix4f::convert_mat(), Spotlight::get_attenuation(), LVecBase3f::get_data(), LVecBase4f::get_data(), Spotlight::get_exponent(), Lens::get_hfov(), LensNode::get_lens(), get_light_color(), Lens::get_nodal_point(), Spotlight::get_specular_color(), NodePath::get_transform(), and Lens::get_view_vector().

FrameBufferProperties DXGraphicsStateGuardian9::calc_fb_properties ( DWORD  cformat,
DWORD  dformat,
DWORD  multisampletype,
DWORD  multisamplequality 
)

Convert DirectX framebuffer format ids into a FrameBufferProperties structure.

Definition at line 5512 of file dxGraphicsStateGuardian9.cxx.

bool DXGraphicsStateGuardian9::check_dx_allocation ( HRESULT  result,
int  allocation_size,
int  attempts 
)

This function is called after the creation of textures, vertex buffers, and index buffers to check if DirectX is out of memory.

If DirectX is out of memory and the LRU is being used, then page out some memory. This function is a fail-safe just in case another process allocates video memory, DirectX is fragmented, or there are some borderline memory allocation cases, ...

Definition at line 5258 of file dxGraphicsStateGuardian9.cxx.

void DXGraphicsStateGuardian9::clear ( DrawableRegion clearable) [virtual]

Clears all of the indicated buffers to their assigned colors.

Reimplemented from GraphicsStateGuardian.

Definition at line 853 of file dxGraphicsStateGuardian9.cxx.

void GraphicsStateGuardian::clear_before_callback ( ) [virtual, inherited]

Resets any non-standard graphics state that might give a callback apoplexy.

Some drivers require that the graphics state be restored to neutral before performing certain operations. In OpenGL, for instance, this closes any open vertex buffers.

Implements GraphicsStateGuardianBase.

Definition at line 1316 of file graphicsStateGuardian.cxx.

void GraphicsStateGuardian::clear_flash_texture ( ) [inherited]

Resets the "flash texture", so that no textures will flash.

See set_flash_texture().

Definition at line 515 of file graphicsStateGuardian.cxx.

void GraphicsStateGuardian::clear_state_and_transform ( ) [virtual, inherited]

Forgets the current graphics state and current transform, so that the next call to set_state_and_transform() will have to reload everything.

This is a good thing to call when you are no longer sure what the graphics state is. This should only be called from the draw thread.

Implements GraphicsStateGuardianBase.

Definition at line 1330 of file graphicsStateGuardian.cxx.

References BitMask< WType, nbits >::clear(), and GraphicsStateGuardian::reissue_transforms().

Referenced by DisplayRegionDrawCallbackData::upcall().

void DXGraphicsStateGuardian9::close_gsg ( ) [protected, virtual]

This is called by the associated GraphicsWindow when close_window() is called.

It should null out the _win pointer and possibly free any open resources associated with the GSG.

Reimplemented from GraphicsStateGuardian.

Definition at line 4174 of file dxGraphicsStateGuardian9.cxx.

References Thread::get_current_thread(), and GraphicsStateGuardian::release_all().

DWORD DXGraphicsStateGuardian9::Colorf_to_D3DCOLOR ( const Colorf cColorf) [inline, static]

Converts Panda's floating-point Colorf structure to DirectX's D3DCOLOR packed structure.

Definition at line 23 of file dxGraphicsStateGuardian9.I.

Referenced by apply_texture(), and set_ambient_light().

int TypedWritable::complete_pointers ( TypedWritable **  p_list,
BamReader manager 
) [virtual, inherited]

Receives an array of pointers, one for each time manager->read_pointer() was called in fillin().

Returns the number of pointers processed.

This is the callback function that is made by the BamReader at some later point, after all of the required pointers have been filled in. It is necessary because there might be forward references in a bam file; when we call read_pointer() in fillin(), the object may not have been read from the file yet, so we do not have a pointer available at that time. Thus, instead of returning a pointer, read_pointer() simply reserves a later callback. This function provides that callback. The calling object is responsible for keeping track of the number of times it called read_pointer() and extracting the same number of pointers out of the supplied vector, and storing them appropriately within the object.

Reimplemented in CFDoCullCommand, AnimBundleNode, AnimChannelMatrixDynamic, AnimChannelScalarDynamic, AnimGroup, MovingPartBase, PartBundle, PartBundleNode, PartGroup, Character, CharacterJoint, CharacterJointEffect, CharacterVertexSlider, JointVertexTransform, CollisionNode, DataNodeTransmit, GeomVertexArrayData, GeomVertexArrayFormat, GeomVertexData, GeomVertexFormat, SliderTable, TextureStage, TransformBlendTable, TransformTable, PiecewiseCurve, ClipPlaneAttrib, FogAttrib, LensNode, LightAttrib, MaterialAttrib, PortalNode, RenderEffects, RenderState, TexGenAttrib, TexMatrixAttrib, TexProjectorEffect, TextureAttrib, BamCacheIndex, RecorderFrame, EggFile, ImageFile, PaletteGroup, PaletteGroups, PaletteImage, PalettePage, Palettizer, SourceTextureImage, TextureImage, TexturePlacement, TextureProperties, and TextureReference.

Definition at line 103 of file typedWritable.cxx.

float GraphicsStateGuardian::compute_distance_to ( const LPoint3f point) const [virtual, inherited]

This function may only be called during a render traversal; it will compute the distance to the indicated point, assumed to be in eye coordinates, from the camera plane.

Implements GraphicsStateGuardianBase.

Definition at line 851 of file graphicsStateGuardian.cxx.

void DXGraphicsStateGuardian9::copy_pres_reset ( DXScreenData new_context) [protected]

copies the PresReset from passed DXScreenData

Definition at line 4963 of file dxGraphicsStateGuardian9.cxx.

Referenced by wdxGraphicsWindow9::open_window().

void GraphicsStateGuardian::create_gamma_table ( float  gamma,
unsigned short *  red_table,
unsigned short *  green_table,
unsigned short *  blue_table 
) [static, inherited]

Create a gamma table.

Definition at line 2183 of file graphicsStateGuardian.cxx.

bool TypedWritable::decode_raw_from_bam_stream ( TypedWritable *&  ptr,
ReferenceCount *&  ref_ptr,
const string &  data,
BamReader reader = NULL 
) [static, inherited]

Reads the string created by a previous call to encode_to_bam_stream(), and extracts the single object on that string.

Returns true on success, false on on error.

This variant sets the TypedWritable and ReferenceCount pointers separately; both are pointers to the same object. The reference count is not incremented; it is the caller's responsibility to manage the reference count.

Note that this method cannot be used to retrieve objects that do not inherit from ReferenceCount, because these objects cannot persist beyond the lifetime of the BamReader that reads them. To retrieve these objects from a bam stream, you must construct a BamReader directly.

If you happen to know that the particular object in question inherits from TypedWritableReferenceCount or PandaNode, consider calling the variant of decode_from_bam_stream() defined for those methods, which presents a simpler interface.

Definition at line 353 of file typedWritable.cxx.

References BamReader::init(), DatagramInputFile::open(), DatagramInputFile::read_header(), BamReader::read_object(), ReferenceCount::ref(), BamReader::resolve(), BamReader::set_source(), and ReferenceCount::unref().

bool GraphicsStateGuardian::depth_offset_decals ( ) [virtual, inherited]

Returns true if this GSG can implement decals using a DepthOffsetAttrib, or false if that is unreliable and the three-step rendering process should be used instead.

Implements GraphicsStateGuardianBase.

Reimplemented in TinyGraphicsStateGuardian.

Definition at line 1522 of file graphicsStateGuardian.cxx.

void GraphicsStateGuardian::determine_light_color_scale ( ) [protected, inherited]

Called whenever the color or color scale is changed, if _color_scale_via_lighting is true.

This will rederive _material_force_color and _light_color_scale appropriately.

Definition at line 2459 of file graphicsStateGuardian.cxx.

Referenced by GraphicsStateGuardian::do_issue_color().

void GraphicsStateGuardian::determine_target_texture ( ) [protected, inherited]
void DXGraphicsStateGuardian9::do_auto_rescale_normal ( ) [protected]

Issues the appropriate DX commands to either rescale or normalize the normals according to the current transform.

Definition at line 4281 of file dxGraphicsStateGuardian9.cxx.

References set_render_state().

Referenced by do_issue_transform().

bool DXGraphicsStateGuardian9::do_framebuffer_copy_to_ram ( Texture tex,
int  z,
const DisplayRegion dr,
const RenderBuffer rb,
bool  inverted 
)

This is the implementation of framebuffer_copy_to_ram(); it adds one additional parameter, which should be true if the framebuffer is to be inverted during the copy (as in the same way it copies to texture memory).

Definition at line 2164 of file dxGraphicsStateGuardian9.cxx.

References DXTextureContext9::d3d_surface_to_texture(), Texture::get_component_type(), Texture::get_format(), DisplayRegion::get_region_pixels_i(), Texture::get_texture_type(), Texture::get_x_size(), Texture::get_y_size(), Texture::get_z_size(), Texture::has_ram_image(), set_read_buffer(), and Texture::setup_texture().

Referenced by framebuffer_copy_to_ram(), and framebuffer_copy_to_texture().

void DXGraphicsStateGuardian9::do_issue_blending ( ) [protected]

Called after any of the things that might change blending state have changed, this function is responsible for setting the appropriate color blending mode based on the current properties.

Definition at line 3962 of file dxGraphicsStateGuardian9.cxx.

References get_blend_func(), ColorWriteAttrib::get_channels(), ColorBlendAttrib::get_mode(), TransparencyAttrib::get_mode(), and set_render_state().

Referenced by set_state_and_transform().

void GraphicsStateGuardian::do_issue_clip_plane ( ) [inherited]
void GraphicsStateGuardian::do_issue_color ( ) [inherited]

This method is defined in the base class because it is likely that this functionality will be used for all (or at least most) kinds of GraphicsStateGuardians--it's not specific to any one rendering backend.

The ColorAttribute just changes the interpretation of the color on the vertices, and fiddles with _vertex_colors_enabled, etc.

Definition at line 1892 of file graphicsStateGuardian.cxx.

References BitMask< WType, nbits >::clear_bit(), GraphicsStateGuardian::determine_light_color_scale(), ColorAttrib::get_color(), and ColorAttrib::get_color_type().

Referenced by TinyGraphicsStateGuardian::set_state_and_transform(), DXGraphicsStateGuardian8::set_state_and_transform(), and set_state_and_transform().

void GraphicsStateGuardian::do_issue_light ( ) [virtual, inherited]

This implementation of do_issue_light() assumes we have a limited number of hardware lights available.

This function assigns each light to a different hardware light id, trying to keep each light associated with the same id where possible, but reusing id's when necessary. When it is no longer possible to reuse existing id's (e.g. all id's are in use), the next sequential id is assigned (if available).

It will call apply_light() each time a light is assigned to a particular id for the first time in a given frame, and it will subsequently call enable_light() to enable or disable each light as the frame is rendered, as well as enable_lighting() to enable or disable overall lighting.

Reimplemented in TinyGraphicsStateGuardian.

Definition at line 1991 of file graphicsStateGuardian.cxx.

References PandaNode::as_light(), GraphicsStateGuardian::begin_bind_lights(), GraphicsStateGuardian::enable_light(), GraphicsStateGuardian::enable_lighting(), GraphicsStateGuardian::end_bind_lights(), NodePath::is_empty(), NodePath::node(), and GraphicsStateGuardian::set_ambient_light().

Referenced by DXGraphicsStateGuardian8::set_state_and_transform(), and set_state_and_transform().

void DXGraphicsStateGuardian9::do_issue_stencil ( ) [protected]

Set stencil render states.

Definition at line 5414 of file dxGraphicsStateGuardian9.cxx.

Referenced by set_state_and_transform().

void DXGraphicsStateGuardian9::do_issue_transform ( ) [protected]

Sends the indicated transform matrix to the graphics API to be applied to future vertices.

This transform is the internal_transform, already converted into the GSG's internal coordinate system.

Definition at line 2883 of file dxGraphicsStateGuardian9.cxx.

References do_auto_rescale_normal(), LMatrix4f::get_data(), and TransformState::get_mat().

Referenced by reissue_transforms(), and set_state_and_transform().

bool ReferenceCount::do_test_ref_count_integrity ( ) const [protected, inherited]

Does some easy checks to make sure that the reference count isn't completely bogus.

Returns true if ok, false otherwise.

Reimplemented in NodeReferenceCount, CachedTypedWritableReferenceCount, and NodeCachedReferenceCount.

Definition at line 29 of file referenceCount.cxx.

Referenced by ReferenceCount::do_test_ref_count_nonzero(), and ReferenceCount::test_ref_count_integrity().

bool ReferenceCount::do_test_ref_count_nonzero ( ) const [protected, inherited]

Returns true if the reference count is nonzero, false otherwise.

Definition at line 56 of file referenceCount.cxx.

References ReferenceCount::do_test_ref_count_integrity().

Referenced by ReferenceCount::test_ref_count_nonzero().

void DXGraphicsStateGuardian9::draw_indexed_primitive_up ( D3DPRIMITIVETYPE  primitive_type,
unsigned int  min_index,
unsigned int  max_index,
unsigned int  num_primitives,
const unsigned char *  index_data,
D3DFORMAT  index_type,
const unsigned char *  buffer,
size_t  stride 
) [protected]

Issues the DrawIndexedPrimitiveUP call to draw the indicated primitive_type from the given buffer.

As in draw_primitive_up(), above, the parameter list is not exactly one-for-one with the DrawIndexedPrimitiveUP() call, but it's similar (in particular, we pass max_index instead of NumVertices, which always seemed ambiguous to me).

Definition at line 5209 of file dxGraphicsStateGuardian9.cxx.

References get_safe_buffer_start().

Referenced by draw_lines(), draw_triangles(), draw_trifans(), and draw_tristrips().

bool DXGraphicsStateGuardian9::draw_lines ( const GeomPrimitivePipelineReader reader,
bool  force 
) [virtual]
bool DXGraphicsStateGuardian9::draw_linestrips ( const GeomPrimitivePipelineReader reader,
bool  force 
) [virtual]

Draws a series of line strips.

Reimplemented from GraphicsStateGuardian.

Definition at line 1923 of file dxGraphicsStateGuardian9.cxx.

bool DXGraphicsStateGuardian9::draw_points ( const GeomPrimitivePipelineReader reader,
bool  force 
) [virtual]
void DXGraphicsStateGuardian9::draw_primitive_up ( D3DPRIMITIVETYPE  primitive_type,
unsigned int  primitive_count,
unsigned int  first_vertex,
unsigned int  num_vertices,
const unsigned char *  buffer,
size_t  stride 
) [protected]

Issues the DrawPrimitiveUP call to draw the indicated primitive_type from the given buffer.

We add the num_vertices parameter, so we can determine the size of the buffer.

Definition at line 5159 of file dxGraphicsStateGuardian9.cxx.

References get_safe_buffer_start().

Referenced by draw_lines(), draw_points(), draw_triangles(), draw_trifans(), and draw_tristrips().

bool DXGraphicsStateGuardian9::draw_triangles ( const GeomPrimitivePipelineReader reader,
bool  force 
) [virtual]
bool DXGraphicsStateGuardian9::draw_trifans ( const GeomPrimitivePipelineReader reader,
bool  force 
) [virtual]
bool DXGraphicsStateGuardian9::draw_tristrips ( const GeomPrimitivePipelineReader reader,
bool  force 
) [virtual]
void DXGraphicsStateGuardian9::dx_cleanup ( ) [protected]

Clean up the DirectX environment, accounting for exit()

Definition at line 4682 of file dxGraphicsStateGuardian9.cxx.

References free_nondx_resources().

Referenced by wdxGraphicsWindow9::open_window().

void DXGraphicsStateGuardian9::enable_clip_plane ( int  plane_id,
bool  enable 
) [protected, virtual]

Intended to be overridden by a derived class to enable the indicated clip_plane id.

A specific PlaneNode will already have been bound to this id via bind_clip_plane().

Reimplemented from GraphicsStateGuardian.

Definition at line 4128 of file dxGraphicsStateGuardian9.cxx.

References set_render_state().

void GraphicsStateGuardian::enable_clip_planes ( bool  enable) [protected, virtual, inherited]

Intended to be overridden by a derived class to enable or disable the use of clipping planes overall.

This is called by do_issue_clip_plane() according to whether any planes are in use or not.

Definition at line 2295 of file graphicsStateGuardian.cxx.

Referenced by GraphicsStateGuardian::do_issue_clip_plane().

void DXGraphicsStateGuardian9::enable_light ( int  light_id,
bool  enable 
) [protected, virtual]

Intended to be overridden by a derived class to enable the indicated light id.

A specific Light will already have been bound to this id via bind_light().

Reimplemented from GraphicsStateGuardian.

Definition at line 4109 of file dxGraphicsStateGuardian9.cxx.

void DXGraphicsStateGuardian9::enable_lighting ( bool  enable) [protected, virtual]

Intended to be overridden by a derived class to enable or disable the use of lighting overall.

This is called by issue_light() according to whether any lights are in use or not.

Reimplemented from GraphicsStateGuardian.

Definition at line 4078 of file dxGraphicsStateGuardian9.cxx.

References set_render_state().

string TypedWritable::encode_to_bam_stream ( ) const [inline, inherited]

Converts the TypedWritable object into a single stream of data using a BamWriter, and returns that data as a string string.

Returns empty string on failure.

This is a convenience method particularly useful for cases when you are only serializing a single object. If you have many objects to process, it is more efficient to use the same BamWriter to serialize all of them together.

Definition at line 86 of file typedWritable.I.

bool TypedWritable::encode_to_bam_stream ( string &  data,
BamWriter writer = NULL 
) const [inherited]

Converts the TypedWritable object into a single stream of data using a BamWriter, and stores that data in the indicated string.

Returns true on success, false on failure.

This is a convenience method particularly useful for cases when you are only serializing a single object. If you have many objects to process, it is more efficient to use the same BamWriter to serialize all of them together.

Definition at line 283 of file typedWritable.cxx.

References BamWriter::init(), DatagramOutputFile::open(), BamWriter::set_target(), DatagramOutputFile::write_header(), and BamWriter::write_object().

void GraphicsStateGuardian::end_bind_clip_planes ( ) [protected, virtual, inherited]

Called after before bind_clip_plane() has been called one or more times (but before any geometry is issued or additional state is changed), this is intended to clean up any temporary changes to the state that may have been made by begin_bind_clip_planes().

Definition at line 2348 of file graphicsStateGuardian.cxx.

Referenced by GraphicsStateGuardian::do_issue_clip_plane().

void GraphicsStateGuardian::end_bind_lights ( ) [protected, virtual, inherited]

Called after before bind_light() has been called one or more times (but before any geometry is issued or additional state is changed), this is intended to clean up any temporary changes to the state that may have been made by begin_bind_lights().

Definition at line 2283 of file graphicsStateGuardian.cxx.

Referenced by GraphicsStateGuardian::do_issue_light().

void DXGraphicsStateGuardian9::end_draw_primitives ( ) [virtual]

Called after a sequence of draw_primitive() functions are called, this should do whatever cleanup is appropriate.

Reimplemented from GraphicsStateGuardian.

Definition at line 1971 of file dxGraphicsStateGuardian9.cxx.

References set_render_state().

void DXGraphicsStateGuardian9::end_frame ( Thread current_thread) [virtual]

Called after each frame is rendered, to allow the GSG a chance to do any internal cleanup after rendering the frame, and before the window flips.

Reimplemented from GraphicsStateGuardian.

Definition at line 1188 of file dxGraphicsStateGuardian9.cxx.

References report_texmgr_stats().

void DXGraphicsStateGuardian9::end_scene ( ) [virtual]

Called between begin_frame() and end_frame() to mark the end of drawing commands for a "scene" (usually a particular DisplayRegion) within a frame.

All 3-D drawing commands, except the clear operation, must be enclosed within begin_scene() .. end_scene().

Reimplemented from GraphicsStateGuardian.

Definition at line 1137 of file dxGraphicsStateGuardian9.cxx.

bool DXGraphicsStateGuardian9::extract_texture_data ( Texture tex) [virtual]

This method should only be called by the GraphicsEngine.

Do not call it directly; call GraphicsEngine::extract_texture_data() instead.

This method will be called in the draw thread to download the texture memory's image into its ram_image value. It returns true on success, false otherwise.

Reimplemented from GraphicsStateGuardian.

Definition at line 411 of file dxGraphicsStateGuardian9.cxx.

References DXTextureContext9::extract_texture_data(), GraphicsStateGuardian::get_prepared_objects(), and Texture::prepare_now().

const LMatrix4f * GraphicsStateGuardian::fetch_specified_part ( Shader::ShaderMatInput  input,
InternalName name,
LMatrix4f t 
) [inherited]
const LMatrix4f * GraphicsStateGuardian::fetch_specified_value ( Shader::ShaderMatSpec spec,
int  altered 
) [inherited]

The gsg contains a large number of useful matrices:

the world transform, the modelview matrix, the cs_transform, etc, etc.

A shader can request any of these values, and furthermore, it can request that various compositions, inverses, and transposes be performed. The ShaderMatSpec is a data structure indicating what datum is desired and what conversions to perform. This routine, fetch_specified_value, is responsible for doing the actual retrieval and conversions.

Some values, like the following, aren't matrices:

window size texture coordinates of card center

This routine can fetch these values as well, by shoehorning them into a matrix. In this way, we avoid the need for a separate routine to fetch these values.

The "altered" bits indicate what parts of the state_and_transform have changed since the last time this particular ShaderMatSpec was evaluated. This may allow data to be cached and not reevaluated.

Definition at line 907 of file graphicsStateGuardian.cxx.

References GraphicsStateGuardian::fetch_specified_part(), LMatrix4f::get_row3(), LMatrix4f::ident_mat(), LVecBase3f::normalize(), LMatrix4f::set_row(), LMatrix4f::xform_point(), and LMatrix4f::xform_vec().

void TypedWritable::fillin ( DatagramIterator scan,
BamReader manager 
) [virtual, inherited]

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.

It is also called directly by the BamReader to re-read the data for an object that has been placed on the stream for an update.

Reimplemented in CFDoCullCommand, AnimBundle, AnimBundleNode, AnimChannelBase, AnimChannelMatrixDynamic, AnimChannelMatrixFixed, AnimChannelMatrixXfmTable, AnimChannelScalarDynamic, AnimChannelScalarTable, AnimGroup, AnimPreloadTable, MovingPart< SwitchType >, MovingPartBase, PartBundle, PartBundleNode, PartGroup, Character, CharacterJoint, CharacterJointEffect, CharacterVertexSlider, JointVertexTransform, CollisionBox, CollisionDSSolid, CollisionFloorMesh, CollisionInvSphere, CollisionLine, CollisionNode, CollisionParabola, CollisionPlane, CollisionPolygon, CollisionRay, CollisionSegment, CollisionSolid, CollisionSphere, CollisionTube, DataNode, DataNodeTransmit, ButtonEventList, EventStoreValue< Type >, Geom, GeomPrimitive, GeomVertexArrayData, GeomVertexArrayFormat, GeomVertexData, GeomVertexFormat, Lens, Material, SliderTable, TextureStage, TransformBlendTable, TransformTable, UserVertexSlider, UserVertexTransform, VertexSlider, VertexTransform, CubicCurveseg, HermiteCurve, NurbsCurve, ParametricCurve, PiecewiseCurve, RopeNode, SheetNode, AlphaTestAttrib, AntialiasAttrib, AudioVolumeAttrib, AuxBitplaneAttrib, BillboardEffect, Camera, ClipPlaneAttrib, ColorAttrib, ColorBlendAttrib, ColorScaleAttrib, ColorWriteAttrib, CompassEffect, CullBinAttrib, CullFaceAttrib, DecalEffect, DepthOffsetAttrib, DepthTestAttrib, DepthWriteAttrib, Fog, FogAttrib, GeomNode, LensNode, LightAttrib, LightRampAttrib, MaterialAttrib, ModelNode, ModelRoot, PandaNode, PlaneNode, PolylightNode, PortalNode, RenderAttrib, RenderEffect, RenderEffects, RenderModeAttrib, RenderState, RescaleNormalAttrib, ScissorAttrib, ScissorEffect, ShadeModelAttrib, ShowBoundsEffect, StencilAttrib, TexGenAttrib, TexMatrixAttrib, TexProjectorEffect, TextureAttrib, TransformState, TransparencyAttrib, UvScrollNode, AmbientLight, CallbackNode, DirectionalLight, FadeLODNode, LightLensNode, LightNode, LODNode, PointLight, SequenceNode, Spotlight, SwitchNode, BamCacheIndex, BamCacheRecord, MouseRecorder, RecorderFrame, RecorderHeader, RecorderTable, DestTextureImage, EggFile, ImageFile, PaletteGroup, PaletteGroups, PaletteImage, PalettePage, Palettizer, SourceTextureImage, TextureImage, TexturePlacement, TexturePosition, TextureProperties, TextureReference, MovingPart< ACScalarSwitchType >, and MovingPart< ACMatrixSwitchType >.

Definition at line 133 of file typedWritable.cxx.

Referenced by EventStoreValue< Type >::fillin().

void TypedWritable::finalize ( BamReader manager) [virtual, inherited]

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.

Reimplemented in PartBundle, Geom, GeomPrimitive, GeomVertexArrayData, GeomVertexArrayFormat, GeomVertexData, InternalName, GeomNode, LightAttrib, RenderAttrib, RenderEffect, RenderEffects, RenderState, PaletteGroup, and Palettizer.

Definition at line 145 of file typedWritable.cxx.

Referenced by BamReader::finalize_now().

void GraphicsStateGuardian::finish_decal ( ) [virtual, inherited]

Called during draw to clean up after decals are finished.

Implements GraphicsStateGuardianBase.

Definition at line 1612 of file graphicsStateGuardian.cxx.

bool DXGraphicsStateGuardian9::framebuffer_copy_to_ram ( Texture tex,
int  z,
const DisplayRegion dr,
const RenderBuffer rb 
) [virtual]

Copy the pixels within the indicated display region from the framebuffer into system memory, not texture memory.

Returns true on success, false on failure.

This completely redefines the ram image of the indicated texture.

Reimplemented from GraphicsStateGuardian.

Definition at line 2149 of file dxGraphicsStateGuardian9.cxx.

References do_framebuffer_copy_to_ram().

bool DXGraphicsStateGuardian9::framebuffer_copy_to_texture ( Texture tex,
int  z,
const DisplayRegion dr,
const RenderBuffer rb 
) [virtual]
void DXGraphicsStateGuardian9::free_d3d_device ( ) [protected]

setup for re-calling dx_init(), this is not the final exit cleanup routine (see dx_cleanup)

Definition at line 4213 of file dxGraphicsStateGuardian9.cxx.

References BitMask< WType, nbits >::clear(), free_nondx_resources(), and GraphicsStateGuardian::release_all().

void DXGraphicsStateGuardian9::free_nondx_resources ( ) [protected]

Frees some memory that was explicitly allocated within the dxgsg.

Definition at line 4203 of file dxGraphicsStateGuardian9.cxx.

Referenced by dx_cleanup(), and free_d3d_device().

void GraphicsStateGuardian::free_pointers ( ) [protected, virtual, inherited]

Frees some memory that was explicitly allocated within the glgsg.

Reimplemented in TinyGraphicsStateGuardian.

Definition at line 2387 of file graphicsStateGuardian.cxx.

Referenced by GraphicsStateGuardian::close_gsg().

TextureStage * GraphicsStateGuardian::get_alpha_scale_texture_stage ( ) [inline, static, inherited]

Returns the TextureStage that will be used to apply an alpha scale, if get_alpha_scale_via_texture() returns true.

Definition at line 753 of file graphicsStateGuardian.I.

Referenced by GraphicsStateGuardian::determine_target_texture().

bool GraphicsStateGuardian::get_alpha_scale_via_texture ( ) const [inline, inherited]

Returns true if this particular GSG can implement (or would prefer to implement) an alpha scale via an additional Texture layer, or false if we need to actually munge the alpha.

Definition at line 724 of file graphicsStateGuardian.I.

Referenced by StandardMunger::StandardMunger().

bool GraphicsStateGuardian::get_alpha_scale_via_texture ( const TextureAttrib tex_attrib) const [inline, inherited]

This variant of get_alpha_scale_via_texture() answers the question of whether the GSG can implement an alpha scale via an additional Texture layer, considering the current TextureAttrib that will be in effect.

This considers whether there is at least one additional texture slot available on the GSG.

Definition at line 739 of file graphicsStateGuardian.I.

References GraphicsStateGuardian::get_max_texture_stages().

UpdateSeq TypedWritable::get_bam_modified ( ) const [inline, inherited]

Returns the current bam_modified counter.

This counter is normally incremented automatically whenever the object is modified.

Definition at line 66 of file typedWritable.I.

Referenced by BamWriter::consider_update(), and BamWriter::write_pointer().

D3DBLEND DXGraphicsStateGuardian9::get_blend_func ( ColorBlendAttrib::Operand  operand) [static, protected]

Maps from ColorBlendAttrib::Operand to D3DBLEND value.

Definition at line 4317 of file dxGraphicsStateGuardian9.cxx.

Referenced by do_issue_blending().

bool GraphicsStateGuardian::get_color_scale_via_lighting ( ) const [inline, inherited]

Returns true if this particular GSG can implement (or would prefer to implement) set color and/or color scale using materials and/or ambient lights, or false if we need to actually munge the color.

Definition at line 711 of file graphicsStateGuardian.I.

Referenced by StandardMunger::StandardMunger().

CoordinateSystem GraphicsStateGuardian::get_coordinate_system ( ) const [inline, inherited]

Returns the coordinate system in effect on this particular gsg.

Normally, this will be the default coordinate system, but it might be set differently at runtime.

Definition at line 783 of file graphicsStateGuardian.I.

bool GraphicsStateGuardian::get_copy_texture_inverted ( ) const [inline, inherited]

Returns true if this particular GSG has the property that any framebuffer-to-texture copy results in a texture that is upside-down and backwards from Panda's usual convention; that is, it copies into a texture from the bottom up instead of from the top down.

If this is true, then on offscreen GraphicsBuffer created for the purposes of rendering into a texture should be created with the invert flag set true, to compensate. Panda will do this automatically if you create an offscreen buffer using GraphicsOutput::make_texture_buffer().

Definition at line 534 of file graphicsStateGuardian.I.

References ConfigVariableBase::has_value().

Referenced by ParasiteBuffer::ParasiteBuffer().

const TransformState * GraphicsStateGuardian::get_cs_transform ( ) const [virtual, inherited]

Returns a transform that converts from the GSG's external coordinate system (as returned by get_coordinate_system()) to its internal coordinate system (as returned by get_internal_coordinate_system()).

This is used for rendering.

Implements GraphicsStateGuardianBase.

Definition at line 1817 of file graphicsStateGuardian.cxx.

const DisplayRegion * GraphicsStateGuardian::get_current_display_region ( ) const [inline, inherited]

Returns the current display region being rendered to, as set by the last call to prepare_display_region().

Definition at line 881 of file graphicsStateGuardian.I.

const Lens * GraphicsStateGuardian::get_current_lens ( ) const [inline, inherited]

Returns the current lens being used to render, according to the scene specified via the last call to set_scene().

Definition at line 904 of file graphicsStateGuardian.I.

Lens::StereoChannel GraphicsStateGuardian::get_current_stereo_channel ( ) const [inline, inherited]

Returns the current stereo channel being rendered to, as set by the last call to prepare_display_region().

Definition at line 892 of file graphicsStateGuardian.I.

GraphicsStateGuardianBase * GraphicsStateGuardianBase::get_default_gsg ( ) [static, inherited]

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 37 of file graphicsStateGuardianBase.cxx.

Referenced by Texture::adjust_size(), Texture::consider_auto_process_ram_image(), and SceneGraphReducer::set_gsg().

bool GraphicsStateGuardian::get_effective_incomplete_render ( ) const [inline, virtual, inherited]

Returns true if the GSG is effectively in incomplete_render state, considering both the GSG's incomplete_render and its current DisplayRegion's incomplete_render flags.

It only makes sense to call this during the draw traversal; at other times this return value will be meaningless.

See CullTraverser::get_effective_incomplete_render() for this same information during the cull traversal.

Implements GraphicsStateGuardianBase.

Definition at line 176 of file graphicsStateGuardian.I.

GraphicsEngine * GraphicsStateGuardian::get_engine ( ) const [inherited]

Returns the graphics engine that created this GSG.

Since there is normally only one GraphicsEngine object in an application, this is usually the same as the global GraphicsEngine.

Definition at line 275 of file graphicsStateGuardian.cxx.

Referenced by NonlinearImager::add_viewer(), DXTextureContext9::create_texture(), DXTextureContext8::create_texture(), GraphicsEngine::make_output(), GraphicsOutput::make_texture_buffer(), reset_d3d_device(), and DXGraphicsStateGuardian8::reset_d3d_device().

Texture * GraphicsStateGuardian::get_flash_texture ( ) const [inherited]

Returns the current "flash texture", if any, or NULL if none.

See set_flash_texture().

Definition at line 528 of file graphicsStateGuardian.cxx.

D3DFOGMODE DXGraphicsStateGuardian9::get_fog_mode_type ( Fog::Mode  m) [inline, static, protected]

Maps from the fog types to gl version.

Definition at line 105 of file dxGraphicsStateGuardian9.I.

float GraphicsStateGuardian::get_gamma ( float  gamma) [inherited]

Get the current gamma setting.

Definition at line 407 of file graphicsStateGuardian.cxx.

bool DXGraphicsStateGuardian9::get_gamma_table ( void  ) [static]

Static function for getting the original gamma.

Definition at line 5624 of file dxGraphicsStateGuardian9.cxx.

GraphicsStateGuardianBase * GraphicsStateGuardianBase::get_gsg ( int  n) [static, inherited]

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 78 of file graphicsStateGuardianBase.cxx.

Referenced by PipeOcclusionCullTraverser::end_traverse(), GraphicsEngine::remove_window(), and PipeOcclusionCullTraverser::set_scene().

bool GraphicsStateGuardian::get_incomplete_render ( ) const [inline, virtual, inherited]

Returns the incomplete_render flag.

See set_incomplete_render().

Implements GraphicsStateGuardianBase.

Definition at line 158 of file graphicsStateGuardian.I.

D3DFORMAT DXGraphicsStateGuardian9::get_index_type ( Geom::NumericType  numeric_type) [static]

Maps from the Geom's internal numeric type symbols to DirectX's.

Definition at line 3611 of file dxGraphicsStateGuardian9.cxx.

Referenced by DXIndexBufferContext9::allocate_ibuffer(), draw_lines(), draw_triangles(), draw_trifans(), and draw_tristrips().

CoordinateSystem GraphicsStateGuardian::get_internal_coordinate_system ( ) const [virtual, inherited]

Returns the coordinate system used internally by the GSG.

This may be the same as the external coordinate system reported by get_coordinate_system(), or it may be something different.

In any case, vertices that have been transformed before being handed to the GSG (that is, vertices with a contents value of C_clip_point) will be expected to be in this coordinate system.

Implements GraphicsStateGuardianBase.

Definition at line 373 of file graphicsStateGuardian.cxx.

const TransformState * GraphicsStateGuardian::get_inv_cs_transform ( ) const [inline, inherited]

Returns the inverse of the transform returned by get_cs_transform().

Definition at line 915 of file graphicsStateGuardian.I.

const D3DCOLORVALUE & DXGraphicsStateGuardian9::get_light_color ( Light light) const [protected]

Returns the array of four floats that should be issued as the light's color, as scaled by the current value of _light_color_scale, in the case of color_scale_via_lighting.

Definition at line 4300 of file dxGraphicsStateGuardian9.cxx.

References Light::get_color(), and LVecBase4f::get_data().

Referenced by bind_light().

Loader * GraphicsStateGuardian::get_loader ( ) const [inline, inherited]

Returns the Loader object that will be used by this GSG to load textures when necessary, if get_incomplete_render() is true.

Definition at line 200 of file graphicsStateGuardian.I.

int GraphicsStateGuardian::get_max_3d_texture_dimension ( ) const [inline, inherited]

Returns the largest possible texture size in any one dimension for a 3-d texture, or -1 if there is no particular limit.

Returns 0 if 3-d textures are not supported.

The value returned may not be meaningful until after the graphics context has been fully created (e.g. the window has been opened).

Definition at line 328 of file graphicsStateGuardian.I.

int GraphicsStateGuardian::get_max_clip_planes ( ) const [inline, inherited]

Returns the maximum number of simultaneous clip planes that may be applied to geometry, or -1 if there is no particular limit.

The value returned may not be meaningful until after the graphics context has been fully created (e.g. the window has been opened).

Definition at line 474 of file graphicsStateGuardian.I.

int GraphicsStateGuardian::get_max_cube_map_dimension ( ) const [inline, inherited]

Returns the largest possible texture size in any one dimension for a cube map texture, or -1 if there is no particular limit.

Returns 0 if cube map textures are not supported.

The value returned may not be meaningful until after the graphics context has been fully created (e.g. the window has been opened).

Definition at line 345 of file graphicsStateGuardian.I.

Referenced by GraphicsOutput::make_cube_map().

int GraphicsStateGuardian::get_max_lights ( ) const [inline, inherited]

Returns the maximum number of simultaneous lights that may be rendered on geometry, or -1 if there is no particular limit.

The value returned may not be meaningful until after the graphics context has been fully created (e.g. the window has been opened).

Definition at line 458 of file graphicsStateGuardian.I.

int GraphicsStateGuardian::get_max_texture_dimension ( ) const [inline, virtual, inherited]

Returns the largest possible texture size in any one dimension supported by the GSG, or -1 if there is no particular limit.

The value returned may not be meaningful until after the graphics context has been fully created (e.g. the window has been opened).

Implements GraphicsStateGuardianBase.

Definition at line 311 of file graphicsStateGuardian.I.

int GraphicsStateGuardian::get_max_texture_stages ( ) const [inline, inherited]

Returns the maximum number of simultaneous textures that may be applied to geometry with multitexturing, as supported by this particular GSG.

If you exceed this number, the lowest-priority texture stages will not be applied. Use TextureStage::set_priority() to adjust the relative importance of the different texture stages.

The value returned may not be meaningful until after the graphics context has been fully created (e.g. the window has been opened).

Definition at line 292 of file graphicsStateGuardian.I.

Referenced by GraphicsStateGuardian::determine_target_texture(), and GraphicsStateGuardian::get_alpha_scale_via_texture().

int GraphicsStateGuardian::get_max_vertex_transform_indices ( ) const [inline, inherited]

Returns the maximum number of transforms there may be in a single TransformTable for this graphics hardware.

If this number is 0 (but get_max_transforms() is nonzero), then the graphics hardware (or API) doesn't support indexed transforms, but can support direct transform references.

The value returned may not be meaningful until after the graphics context has been fully created (e.g. the window has been opened).

Definition at line 512 of file graphicsStateGuardian.I.

int GraphicsStateGuardian::get_max_vertex_transforms ( ) const [inline, inherited]

Returns the maximum number of transform matrices that may be simultaneously used to transform any one vertex by the graphics hardware.

If this number is 0, then the hardware (or the graphics backend) doesn't support soft-skinned vertices (in which case Panda will animate the vertices in software).

The value returned may not be meaningful until after the graphics context has been fully created (e.g. the window has been opened).

Definition at line 493 of file graphicsStateGuardian.I.

int GraphicsStateGuardian::get_max_vertices_per_array ( ) const [inline, virtual, inherited]

Returns the maximum number of vertices that should be put into any one GeomVertexData object for use with this GSG.

Implements GraphicsStateGuardianBase.

Definition at line 260 of file graphicsStateGuardian.I.

int GraphicsStateGuardian::get_max_vertices_per_primitive ( ) const [inline, virtual, inherited]

Returns the maximum number of vertex indices that should be put into any one GeomPrimitive object for use with this GSG.

Implements GraphicsStateGuardianBase.

Definition at line 272 of file graphicsStateGuardian.I.

int GraphicsStateGuardian::get_maximum_simultaneous_render_targets ( ) const [inline, inherited]

Returns the maximum simultaneous render targets supported.

Definition at line 674 of file graphicsStateGuardian.I.

int GraphicsStateGuardianBase::get_num_gsgs ( ) [static, inherited]

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

Definition at line 66 of file graphicsStateGuardianBase.cxx.

GraphicsPipe * GraphicsStateGuardian::get_pipe ( ) const [inline, inherited]

Returns the graphics pipe on which this GSG was created.

Definition at line 211 of file graphicsStateGuardian.I.

Referenced by GraphicsEngine::make_buffer(), GraphicsEngine::make_output(), wdxGraphicsWindow9::open_window(), and wdxGraphicsWindow8::open_window().

PreparedGraphicsObjects * GraphicsStateGuardian::get_prepared_objects ( ) [virtual, inherited]
int ReferenceCount::get_ref_count ( ) const [inline, inherited]
RenderBuffer GraphicsStateGuardian::get_render_buffer ( int  buffer_type,
const FrameBufferProperties prop 
) [inherited]

Returns a RenderBuffer object suitable for operating on the requested set of buffers.

buffer_type is the union of all the desired RenderBuffer::Type values.

Definition at line 1802 of file graphicsStateGuardian.cxx.

References FrameBufferProperties::get_buffer_mask().

Referenced by DisplayRegion::get_screenshot().

bool GraphicsStateGuardian::get_runtime_color_scale ( ) const [inline, inherited]

Returns true if this particular GSG can implement (or would prefer to implement) set color and/or color scale directly, without requiring any munging of vertices or tricks with lighting.

Definition at line 770 of file graphicsStateGuardian.I.

Referenced by StandardMunger::StandardMunger().

unsigned char * DXGraphicsStateGuardian9::get_safe_buffer_start ( ) [inline, static, protected]

Returns the address of a 64K buffer that is allocated at the beginning of a 64K block.

Definition at line 135 of file dxGraphicsStateGuardian9.I.

Referenced by draw_indexed_primitive_up(), and draw_primitive_up().

SceneSetup * GraphicsStateGuardian::get_scene ( ) const [virtual, inherited]

Returns the current SceneSetup object.

Implements GraphicsStateGuardianBase.

Definition at line 564 of file graphicsStateGuardian.cxx.

Referenced by GraphicsStateGuardian::fetch_specified_part().

int GraphicsStateGuardian::get_shader_model ( ) const [inline, inherited]

Returns the ShaderModel.

Definition at line 684 of file graphicsStateGuardian.I.

int GraphicsStateGuardian::get_supported_geom_rendering ( ) const [virtual, inherited]

Returns the union of Geom::GeomRendering values that this particular GSG can support directly.

If a Geom needs to be rendered that requires some additional properties, the StandardMunger and/or the CullableObject will convert it as needed.

This method is declared virtual solely so that it can be queried from cullableObject.cxx.

Implements GraphicsStateGuardianBase.

Definition at line 311 of file graphicsStateGuardian.cxx.

Referenced by StandardMunger::munge_geom_impl(), and StandardMunger::premunge_geom_impl().

bool GraphicsStateGuardian::get_supports_3d_texture ( ) const [inline, inherited]

Returns true if this GSG can render 3-d (volumetric) textures.

Definition at line 396 of file graphicsStateGuardian.I.

bool GraphicsStateGuardian::get_supports_basic_shaders ( ) const [inline, inherited]

Returns true if this particular GSG supports arbfp1+arbvp1 or above.

Definition at line 616 of file graphicsStateGuardian.I.

bool DXGraphicsStateGuardian9::get_supports_cg_profile ( const string &  name) const [virtual]

Returns true if this particular GSG supports the specified Cg Shader Profile.

Reimplemented from GraphicsStateGuardian.

Definition at line 5722 of file dxGraphicsStateGuardian9.cxx.

bool GraphicsStateGuardian::get_supports_compressed_texture ( ) const [inline, inherited]

Returns true if this GSG can compress textures as it loads them into texture memory, and/or accept pre-compressed textures for storing.

Definition at line 429 of file graphicsStateGuardian.I.

bool GraphicsStateGuardian::get_supports_compressed_texture_format ( int  compression_mode) const [inline, virtual, inherited]

Returns true if this GSG can accept textures pre-compressed in the indicated format.

compression_mode may be any of the Texture::CompressionMode enums.

Implements GraphicsStateGuardianBase.

Definition at line 442 of file graphicsStateGuardian.I.

References BitMask< WType, nbits >::get_bit().

Referenced by DXGraphicsStateGuardian8::prepare_texture(), prepare_texture(), DXGraphicsStateGuardian8::upload_texture(), and upload_texture().

bool GraphicsStateGuardian::get_supports_cube_map ( ) const [inline, inherited]

Returns true if this GSG can render cube map textures.

Definition at line 406 of file graphicsStateGuardian.I.

Referenced by GraphicsOutput::make_cube_map().

bool GraphicsStateGuardian::get_supports_depth_stencil ( ) const [inline, inherited]

Returns true if this particular GSG supports textures whose format is F_depth_stencil.

This only returns true if the GSG supports the full packed depth-stencil functionality.

Definition at line 594 of file graphicsStateGuardian.I.

bool GraphicsStateGuardian::get_supports_depth_texture ( ) const [inline, inherited]

Returns true if this particular GSG supports textures whose format is F_depth_stencil.

This returns true if the GSG supports GL_DEPTH_COMPONENT textures, which are considered a limited but still valid case of F_depth_stencil.

Definition at line 581 of file graphicsStateGuardian.I.

bool GraphicsStateGuardian::get_supports_generate_mipmap ( ) const [inline, inherited]

Returns true if this particular GSG can generate mipmaps for a texture automatically, or if they must be generated in software.

If this is true, then mipmaps can safely be enabled for rendered textures (e.g. using the MultitexReducer).

Definition at line 554 of file graphicsStateGuardian.I.

bool GraphicsStateGuardian::get_supports_geometry_instancing ( ) const [inline, inherited]

Returns true if this particular GSG supports hardware geometry instancing: the ability to render multiple copies of a model.

In OpenGL, this is done using the EXT_draw_instanced extension.

Definition at line 663 of file graphicsStateGuardian.I.

bool GraphicsStateGuardian::get_supports_glsl ( ) const [inline, inherited]

Returns true if this particular GSG supports GLSL shaders.

Definition at line 627 of file graphicsStateGuardian.I.

bool GraphicsStateGuardian::get_supports_multisample ( ) const [virtual, inherited]

Returns true if this particular GSG supports using the multisample bits to provide antialiasing, and also supports M_multisample and M_multisample_mask transparency modes.

If this is not true for a particular GSG, Panda will map the M_multisample modes to M_binary.

This method is declared virtual solely so that it can be queried from cullResult.cxx.

Implements GraphicsStateGuardianBase.

Definition at line 294 of file graphicsStateGuardian.cxx.

bool GraphicsStateGuardian::get_supports_occlusion_query ( ) const [virtual, inherited]

Returns true if this GSG supports an occlusion query.

If this is true, then begin_occlusion_query() and end_occlusion_query() may be called to bracket a sequence of draw_triangles() (or whatever) calls to measure pixels that pass the depth test.

Implements GraphicsStateGuardianBase.

Definition at line 736 of file graphicsStateGuardian.cxx.

bool GraphicsStateGuardian::get_supports_render_texture ( ) const [inline, inherited]

Returns true if this particular GSG can render directly into a texture, or false if it must always copy-to-texture at the end of each frame to achieve this effect.

Definition at line 567 of file graphicsStateGuardian.I.

bool GraphicsStateGuardian::get_supports_shadow_filter ( ) const [inline, virtual, inherited]

Returns true if this particular GSG supports the filter mode FT_shadow for depth textures.

Implements GraphicsStateGuardianBase.

Definition at line 605 of file graphicsStateGuardian.I.

bool GraphicsStateGuardian::get_supports_stencil ( ) const [inline, inherited]

Returns true if this particular GSG supports stencil buffers at all.

Definition at line 638 of file graphicsStateGuardian.I.

bool GraphicsStateGuardian::get_supports_tex_non_pow2 ( ) const [inline, inherited]

Returns true if this GSG can handle non power of two sized textures.

Definition at line 417 of file graphicsStateGuardian.I.

bool GraphicsStateGuardian::get_supports_texture_combine ( ) const [inline, inherited]

Returns true if this particular GSG can use the TextureStage::M_combine mode, which includes all of the texture blend modes specified by set_combine_rgb() and/or set_combine_alpha().

If this is false, you must limit yourself to using the simpler blend modes.

Definition at line 360 of file graphicsStateGuardian.I.

bool GraphicsStateGuardian::get_supports_texture_dot3 ( ) const [inline, inherited]

Returns true if this GSG can use the TextureStage::CM_dot3_rgb or CM_dot3_rgba combine modes.

Definition at line 385 of file graphicsStateGuardian.I.

bool GraphicsStateGuardian::get_supports_texture_saved_result ( ) const [inline, inherited]

Returns true if this GSG can use the TextureStage::CS_last_saved_result source, which allows you to save the result of a TextureStage and re-use it for multiple inputs.

Definition at line 373 of file graphicsStateGuardian.I.

bool GraphicsStateGuardian::get_supports_two_sided_stencil ( ) const [inline, inherited]

Returns true if this particular GSG supports two sided stencil: different stencil settings for the front and back side of the same polygon.

Definition at line 650 of file graphicsStateGuardian.I.

D3DTRANSFORMSTATETYPE DXGraphicsStateGuardian9::get_tex_mat_sym ( int  stage_index) [inline, static, protected]

Returns the nth D3DTS_TEXTURE(n) constant.

Definition at line 124 of file dxGraphicsStateGuardian9.I.

DWORD DXGraphicsStateGuardian9::get_texture_argument ( TextureStage::CombineSource  source,
TextureStage::CombineOperand  operand 
) const [protected]

Returns the D3DTA value corresponding to the indicated TextureStage::CombineSource and TextureStage::CombineOperand enumerated types.

Definition at line 5095 of file dxGraphicsStateGuardian9.cxx.

References get_texture_argument_modifier().

DWORD DXGraphicsStateGuardian9::get_texture_argument_modifier ( TextureStage::CombineOperand  operand) [static, protected]

Returns the extra bits that modify the D3DTA argument, according to the indicated TextureStage::CombineOperand enumerated type.

Definition at line 5128 of file dxGraphicsStateGuardian9.cxx.

Referenced by get_texture_argument().

D3DTEXTUREOP DXGraphicsStateGuardian9::get_texture_operation ( TextureStage::CombineMode  mode,
int  scale 
) [static, protected]

Returns the D3DTEXTUREOP value corresponding to the indicated TextureStage::CombineMode enumerated type.

Definition at line 5046 of file dxGraphicsStateGuardian9.cxx.

Texture::QualityLevel GraphicsStateGuardian::get_texture_quality_override ( ) const [inline, inherited]

Returns the global quality_level override specified by set_texture_quality_override.

This is mainly useful for the tinydisplay software renderer. See Texture::set_quality_level().

Definition at line 815 of file graphicsStateGuardian.I.

D3DTEXTUREADDRESS DXGraphicsStateGuardian9::get_texture_wrap_mode ( Texture::WrapMode  wm) [inline, static, protected]

Maps from the Texture's internal wrap mode symbols to GL's.

Definition at line 82 of file dxGraphicsStateGuardian9.I.

Referenced by apply_texture().

const GraphicsThreadingModel & GraphicsStateGuardian::get_threading_model ( ) const [inline, inherited]

Returns the threading model that was used to create this GSG.

Definition at line 222 of file graphicsStateGuardian.I.

Referenced by GraphicsEngine::extract_texture_data(), and GraphicsEngine::make_output().

int TypedObject::get_type_index ( ) const [inline, inherited]

Returns the internal index number associated with this object's TypeHandle, a unique number for each different type.

This is equivalent to get_type().get_index().

Definition at line 52 of file typedObject.I.

References TypeHandle::get_index().

WeakReferenceList * ReferenceCount::get_weak_list ( ) const [inline, inherited]

Returns the WeakReferenceList associated with this ReferenceCount object.

If there has never been a WeakReferenceList associated with this object, creates one now.

Definition at line 307 of file referenceCount.I.

Referenced by ReferenceCount::weak_ref().

bool ReferenceCount::has_weak_list ( ) const [inline, inherited]

Returns true if this particular ReferenceCount object has a WeakReferenceList created, false otherwise.

In general, this will be true if there was ever a WeakPointerTo created for this object (even if there is not any for it now).

Definition at line 294 of file referenceCount.I.

Referenced by ReferenceCount::weak_unref().

bool GraphicsStateGuardian::is_active ( ) const [inline, inherited]

Returns the active flag associated with the GraphicsStateGuardian.

Definition at line 91 of file graphicsStateGuardian.I.

bool TypedObject::is_exact_type ( TypeHandle  handle) const [inline, inherited]
bool GraphicsStateGuardian::is_hardware ( ) const [inline, inherited]

Returns true if this GSG appears to be hardware-accelerated, or false if it is known to be software only.

Definition at line 234 of file graphicsStateGuardian.I.

bool TypedObject::is_of_type ( TypeHandle  handle) const [inline, inherited]

Returns true if the current object is or derives from the indicated type.

Definition at line 63 of file typedObject.I.

References TypeHandle::is_derived_from().

Referenced by EggSliderData::add_back_pointer(), EggJointData::add_back_pointer(), CIntervalManager::add_c_interval(), XFileNode::add_child(), CollisionTraverser::add_collider(), CollisionHandlerPhysical::add_collider(), EggXfmSAnim::add_data(), CharacterJointBundle::add_node(), NonlinearImager::add_screen(), EggGroupNode::apply_first_attribute(), EggGroupNode::apply_last_attribute(), DeferredNodeProperty::apply_to_node(), RecorderController::begin_playback(), NodePath::clear_clip_plane(), EggGroupNode::clear_connected_shading(), NodePath::clear_light(), EggBase::convert_paths(), NodePath::decode_from_bam_stream(), VrpnClient::disconnect_device(), PhysicsManager::do_physics(), GraphicsStateGuardian::fetch_specified_part(), EggRenderState::fill_state(), AnimBundleNode::find_anim_bundle(), EggGroupNode::find_coordsys_entry(), XFile::find_data_object(), Character::find_joint(), EggGroupNode::find_materials(), Character::find_slider(), XFile::find_template(), EggGroupNode::find_textures(), EggMaterialCollection::find_used_materials(), EggTextureCollection::find_used_textures(), EggGroupNode::force_filenames(), EggJointData::force_initial_rest_frame(), WindowFramework::get_aspect_2d(), EggPoolUniquifier::get_category(), EggGroupUniquifier::get_category(), EggGroupNode::get_connected_shading(), PandaFramework::get_mouse(), FactoryParams::get_param_of_type(), EggGroupNode::has_absolute_pathnames(), NodePath::has_clip_plane(), NodePath::has_clip_plane_off(), NodePath::has_light(), PandaFramework::hide_collision_solids(), x11GraphicsWindow::open_window(), eglGraphicsWindow::open_window(), EggNode::parse_egg(), CharacterMaker::part_to_node(), EggGroupNode::post_apply_flat_attribute(), EggBinner::prepare_node(), PortalClipper::prepare_portal(), NodePath::project_texture(), EggMatrixTablePointer::quantize_channels(), ParametricCurveCollection::r_add_curves(), SceneGraphReducer::r_collect_vertex_data(), EggGroupNode::r_load_externals(), EggGroupNode::rebuild_vertex_pools(), EggGroupNode::recompute_polygon_normals(), EggGroupNode::remove_invalid_primitives(), EggGroupNode::remove_unused_vertices(), EggLoader::reparent_decals(), EggMaterialCollection::replace_materials(), EggTextureCollection::replace_textures(), EggGroupNode::resolve_filenames(), EggGroupNode::reverse_vertex_ordering(), NodePath::set_clip_plane(), NodePath::set_clip_plane_off(), NodePath::set_light(), ProjectionScreen::set_projector(), NonlinearImager::set_source_camera(), EggXfmSAnim::set_value(), NonlinearImager::set_viewer_camera(), PandaFramework::show_collision_solids(), BamCache::store(), XFileToEggConverter::strip_nodes(), EggGroupNode::strip_normals(), DataGraphTraverser::traverse(), DataGraphTraverser::traverse_below(), EggGroupNode::triangulate_polygons(), EggGroupNode::unify_attributes(), EggNameUniquifier::uniquify(), NodeCullCallbackData::upcall(), PhysicsCollisionHandler::validate_target(), EggXfmSAnim::write(), EggGroup::write(), EggToDXFLayer::write_3d_face(), and EggToDXFLayer::write_entities().

bool GraphicsStateGuardian::is_valid ( ) const [inline, inherited]

Returns true if the GSG has been correctly initialized within a graphics context, false if there has been some problem or it hasn't been initialized yet.

Definition at line 104 of file graphicsStateGuardian.I.

Referenced by GraphicsEngine::make_output(), and TinyGraphicsBuffer::open_buffer().

void ReferenceCount::local_object ( ) [inline, inherited]

This function should be called, once, immediately after creating a new instance of some ReferenceCount-derived object on the stack.

This allows the object to be passed to functions that will increment and decrement the object's reference count temporarily, and it will prevent the object from being deleted (inappropriately), when the reference count returns to zero. It actually achieves this by setting a large positive value in the reference count field.

Definition at line 276 of file referenceCount.I.

Referenced by PGTop::cull_callback(), BoundingSphere::extend_by_hexahedron(), AsyncTaskManager::find_task(), AsyncTaskManager::find_tasks(), and AsyncTaskManager::find_tasks_matching().

void TypedWritable::mark_bam_modified ( ) [inline, inherited]
void GraphicsStateGuardian::mark_new ( ) [inline, inherited]

Marks the GSG as "new", so that the next call to reset_if_new() will be effective.

Definition at line 842 of file graphicsStateGuardian.I.

Referenced by reset_d3d_device(), and DXGraphicsStateGuardian8::reset_d3d_device().

bool GraphicsStateGuardian::needs_reset ( ) const [inline, inherited]

Returns true if the gsg is marked as needing a reset.

Definition at line 115 of file graphicsStateGuardian.I.

Referenced by GraphicsEngine::make_output().

void GraphicsStateGuardian::panic_deactivate ( ) [protected, inherited]

This is called internally when it is determined that things are just fubar.

It temporarily deactivates the GSG just so things don't get out of hand, and throws an event so the application can deal with this if it needs to.

Definition at line 2441 of file graphicsStateGuardian.cxx.

References GraphicsStateGuardian::set_active().

bool GraphicsStateGuardian::prefers_triangle_strips ( ) const [inline, virtual, inherited]

Returns true if this GSG strongly prefers triangle strips to individual triangles (such as SGI), or false if it prefers to minimize the number of primitive batches, even at the expense of triangle strips (such as most PC hardware).

Implements GraphicsStateGuardianBase.

Definition at line 248 of file graphicsStateGuardian.I.

void DXGraphicsStateGuardian9::prepare_display_region ( DisplayRegionPipelineReader dr,
Lens::StereoChannel  stereo_channel 
) [virtual]

Prepare a display region for rendering (set up scissor region and viewport)

Reimplemented from GraphicsStateGuardian.

Definition at line 931 of file dxGraphicsStateGuardian9.cxx.

References DisplayRegionPipelineReader::get_region_pixels_i(), and set_render_state().

GeomContext * GraphicsStateGuardian::prepare_geom ( Geom geom) [virtual, inherited]

Prepares the indicated Geom for retained-mode rendering, by creating whatever structures are necessary in the GSG (for instance, vertex buffers).

Returns the newly-allocated GeomContext that can be used to render the geom.

Implements GraphicsStateGuardianBase.

Definition at line 645 of file graphicsStateGuardian.cxx.

IndexBufferContext * DXGraphicsStateGuardian9::prepare_index_buffer ( GeomPrimitive data) [virtual]

Creates a new retained-mode representation of the given data, and returns a newly-allocated IndexBufferContext pointer to reference it.

It is the responsibility of the calling function to later call release_index_buffer() with this same pointer (which will also delete the pointer).

This function should not be called directly to prepare a buffer. Instead, call Geom::prepare().

Reimplemented from GraphicsStateGuardian.

Definition at line 688 of file dxGraphicsStateGuardian9.cxx.

bool DXGraphicsStateGuardian9::prepare_lens ( ) [virtual]

Makes the current lens (whichever lens was most recently specified with set_scene()) active, so that it will transform future rendered geometry.

Normally this is only called from the draw process, and usually it is called by set_scene().

The return value is true if the lens is acceptable, false if it is not.

Reimplemented from GraphicsStateGuardian.

Definition at line 1027 of file dxGraphicsStateGuardian9.cxx.

Referenced by reissue_transforms().

ShaderContext * DXGraphicsStateGuardian9::prepare_shader ( Shader shader) [virtual]

Compile a vertex/fragment shader body.

Reimplemented from GraphicsStateGuardian.

Definition at line 425 of file dxGraphicsStateGuardian9.cxx.

TextureContext * DXGraphicsStateGuardian9::prepare_texture ( Texture tex) [virtual]

Creates a new retained-mode representation of the given texture, and returns a newly-allocated TextureContext pointer to reference it.

It is the responsibility of the calling function to later call release_texture() with this same pointer (which will also delete the pointer).

This function should not be called directly to prepare a texture. Instead, call Texture::prepare().

Reimplemented from GraphicsStateGuardian.

Definition at line 198 of file dxGraphicsStateGuardian9.cxx.

References Texture::get_ram_image_compression(), GraphicsStateGuardian::get_supports_compressed_texture_format(), and TextureContext::get_texture().

VertexBufferContext * DXGraphicsStateGuardian9::prepare_vertex_buffer ( GeomVertexArrayData data) [virtual]

Creates a new retained-mode representation of the given data, and returns a newly-allocated VertexBufferContext pointer to reference it.

It is the responsibility of the calling function to later call release_vertex_buffer() with this same pointer (which will also delete the pointer).

This function should not be called directly to prepare a buffer. Instead, call Geom::prepare().

Reimplemented from GraphicsStateGuardian.

Definition at line 458 of file dxGraphicsStateGuardian9.cxx.

void ReferenceCount::ref ( ) const [inline, inherited]

Explicitly increments the reference count.

User code should avoid using ref() and unref() directly, which can result in missed reference counts. Instead, let a PointerTo object manage the reference counting automatically.

This function is const, even though it changes the object, because generally fiddling with an object's reference count isn't considered part of fiddling with the object. An object might be const in other ways, but we still need to accurately count the number of references to it.

Definition at line 179 of file referenceCount.I.

References ReferenceCount::test_ref_count_integrity().

Referenced by CachedTypedWritableReferenceCount::cache_ref(), TypedWritable::decode_raw_from_bam_stream(), NodeCachedReferenceCount::node_ref(), NodeReferenceCount::node_ref(), BamCacheRecord::set_data(), CullableObject::set_draw_callback(), and ModelRoot::set_reference().

void DXGraphicsStateGuardian9::reissue_transforms ( ) [protected, virtual]

Called by clear_state_and_transform() to ensure that the current modelview and projection matrices are properly loaded in the graphics state, after a callback might have mucked them up.

Reimplemented from GraphicsStateGuardian.

Definition at line 4064 of file dxGraphicsStateGuardian9.cxx.

References do_issue_transform(), and prepare_lens().

void GraphicsStateGuardian::release_all ( ) [inline, inherited]
int GraphicsStateGuardian::release_all_geoms ( ) [inline, inherited]

Frees the resources for all geoms associated with this GSG.

Definition at line 44 of file graphicsStateGuardian.I.

int GraphicsStateGuardian::release_all_index_buffers ( ) [inline, inherited]

Frees the resources for all index buffers associated with this GSG.

Definition at line 66 of file graphicsStateGuardian.I.

Referenced by reset_d3d_device(), and DXGraphicsStateGuardian8::reset_d3d_device().

int GraphicsStateGuardian::release_all_textures ( ) [inline, inherited]

Frees the resources for all textures associated with this GSG.

Definition at line 33 of file graphicsStateGuardian.I.

int GraphicsStateGuardian::release_all_vertex_buffers ( ) [inline, inherited]

Frees the resources for all vertex buffers associated with this GSG.

Definition at line 55 of file graphicsStateGuardian.I.

Referenced by reset_d3d_device(), and DXGraphicsStateGuardian8::reset_d3d_device().

void GraphicsStateGuardian::release_geom ( GeomContext gc) [virtual, inherited]

Frees the resources previously allocated via a call to prepare_geom(), including deleting the GeomContext itself, if it is non-NULL.

This function should not be called directly to prepare a Geom. Instead, call Geom::prepare().

Implements GraphicsStateGuardianBase.

Definition at line 660 of file graphicsStateGuardian.cxx.

void DXGraphicsStateGuardian9::release_index_buffer ( IndexBufferContext ibc) [virtual]

Frees the GL resources previously allocated for the data.

This function should never be called directly; instead, call Data::release() (or simply let the Data destruct).

Reimplemented from GraphicsStateGuardian.

Definition at line 759 of file dxGraphicsStateGuardian9.cxx.

void DXGraphicsStateGuardian9::release_shader ( ShaderContext sc) [virtual]

Releases the resources allocated by prepare_shader.

Reimplemented from GraphicsStateGuardian.

Definition at line 439 of file dxGraphicsStateGuardian9.cxx.

bool DXGraphicsStateGuardian9::release_swap_chain ( DXScreenData new_context) [protected]

Release the swap chain on this DXScreenData.

Definition at line 4945 of file dxGraphicsStateGuardian9.cxx.

Referenced by wdxGraphicsWindow9::close_window(), and wdxGraphicsWindow9::reset_window().

void DXGraphicsStateGuardian9::release_texture ( TextureContext tc) [virtual]

Frees the GL resources previously allocated for the texture.

Reimplemented from GraphicsStateGuardian.

Definition at line 393 of file dxGraphicsStateGuardian9.cxx.

void DXGraphicsStateGuardian9::release_vertex_buffer ( VertexBufferContext vbc) [virtual]

Frees the GL resources previously allocated for the data.

This function should never be called directly; instead, call Data::release() (or simply let the Data destruct).

Reimplemented from GraphicsStateGuardian.

Definition at line 669 of file dxGraphicsStateGuardian9.cxx.

void GraphicsStateGuardianBase::remove_gsg ( GraphicsStateGuardianBase gsg) [static, inherited]

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

Definition at line 112 of file graphicsStateGuardianBase.cxx.

void GraphicsStateGuardian::remove_window ( GraphicsOutputBase window) [virtual, inherited]

This is simply a transparent call to GraphicsEngine::remove_window().

It exists primary to support removing a window from that compiles before the display module, and therefore has no knowledge of a GraphicsEngine object.

Implements GraphicsStateGuardianBase.

Definition at line 1349 of file graphicsStateGuardian.cxx.

References GraphicsEngine::remove_window().

void DXGraphicsStateGuardian9::report_texmgr_stats ( ) [protected]

Reports the DX texture manager's activity to PStats.

Definition at line 4380 of file dxGraphicsStateGuardian9.cxx.

Referenced by end_frame().

bool TypedWritable::require_fully_complete ( ) const [virtual, inherited]

Some objects require all of their nested pointers to have been completed before the objects themselves can be completed.

If this is the case, override this method to return true, and be careful with circular references (which would make the object unreadable from a bam file).

Reimplemented in GeomVertexData, ClipPlaneAttrib, and RenderEffects.

Definition at line 118 of file typedWritable.cxx.

void DXGraphicsStateGuardian9::reset ( ) [virtual]

Resets all internal state as if the gsg were newly created.

The GraphicsWindow pointer represents a typical window that might be used for this context; it may be required to set up the frame buffer properly the first time.

Reimplemented from GraphicsStateGuardian.

Definition at line 2375 of file dxGraphicsStateGuardian9.cxx.

References GraphicsStateGuardianBase::add_gsg(), set_cg_device(), set_render_state(), and set_texture_stage_state().

HRESULT DXGraphicsStateGuardian9::reset_d3d_device ( D3DPRESENT_PARAMETERS *  presentation_params,
DXScreenData **  screen = NULL 
) [protected]

This function checks current device's framebuffer dimension against passed p_presentation_params backbuffer dimension to determine a device reset if there is only one window or it is the main window or fullscreen mode then, it resets the device.

Finally it returns the new DXScreenData through parameter screen

Definition at line 4710 of file dxGraphicsStateGuardian9.cxx.

References Thread::get_current_thread(), GraphicsStateGuardian::get_engine(), GraphicsStateGuardian::mark_new(), GraphicsStateGuardian::release_all(), GraphicsStateGuardian::release_all_index_buffers(), GraphicsStateGuardian::release_all_vertex_buffers(), and GraphicsEngine::reset_all_windows().

bool GraphicsStateGuardian::reset_if_new ( ) [inline, inherited]

Calls reset() to initialize the GSG, but only if it hasn't been called yet.

Returns true if the GSG was new, false otherwise.

Definition at line 827 of file graphicsStateGuardian.I.

References GraphicsStateGuardian::reset().

Referenced by TinyGraphicsBuffer::begin_frame(), and TinyGraphicsBuffer::open_buffer().

void DXGraphicsStateGuardian9::restore_gamma ( ) [virtual]

Restore original gamma.

Reimplemented from GraphicsStateGuardian.

Definition at line 5700 of file dxGraphicsStateGuardian9.cxx.

References static_set_gamma().

void GraphicsStateGuardian::set_active ( bool  active) [inline, inherited]

Sets the active flag associated with the GraphicsStateGuardian.

If the GraphicsStateGuardian is marked inactive, nothing is rendered. This is not normally turned off unless there is a problem with the rendering detected at a low level.

Definition at line 80 of file graphicsStateGuardian.I.

Referenced by GraphicsStateGuardian::panic_deactivate().

void DXGraphicsStateGuardian9::set_ambient_light ( const Colorf color) [protected, virtual]

Intended to be overridden by a derived class to indicate the color of the ambient light that should be in effect.

This is called by issue_light() after all other lights have been enabled or disabled.

Reimplemented from GraphicsStateGuardian.

Definition at line 4091 of file dxGraphicsStateGuardian9.cxx.

References Colorf_to_D3DCOLOR(), and set_render_state().

void DXGraphicsStateGuardian9::set_cg_device ( LPDIRECT3DDEVICE9  cg_device) [static]

Sets the global Cg device pointer.

TODO: make this thread-safe somehow. Maybe Cg is inherently not thread-safe.

Definition at line 5744 of file dxGraphicsStateGuardian9.cxx.

Referenced by atexit_function(), wdxGraphicsWindow9::close_window(), and reset().

void GraphicsStateGuardian::set_coordinate_system ( CoordinateSystem  cs) [inherited]

Changes the coordinate system in effect on this particular gsg.

This is also called the "external" coordinate system, since it is the coordinate system used by the scene graph, external to to GSG.

Normally, this will be the default coordinate system, but it might be set differently at runtime.

Definition at line 338 of file graphicsStateGuardian.cxx.

References LMatrix4f::convert_mat().

void GraphicsStateGuardian::set_current_properties ( const FrameBufferProperties properties) [inline, inherited]

Notifies the gsg that it is about to render into a window/buffer with the given FrameBufferProperties.

Definition at line 926 of file graphicsStateGuardian.I.

void GraphicsStateGuardianBase::set_default_gsg ( GraphicsStateGuardianBase default_gsg) [static, inherited]

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

See get_default_gsg().

Definition at line 49 of file graphicsStateGuardianBase.cxx.

void DXGraphicsStateGuardian9::set_draw_buffer ( const RenderBuffer rb) [protected]

Sets up the glDrawBuffer to render into the buffer indicated by the RenderBuffer object.

This only sets up the color bits; it does not affect the depth, stencil, accum layers.

Definition at line 4249 of file dxGraphicsStateGuardian9.cxx.

void GraphicsStateGuardian::set_flash_texture ( Texture tex) [inherited]

Sets the "flash texture".

This is a debug feature; when enabled, the specified texture will begin flashing in the scene, helping you to find it visually.

The texture also flashes with a color code: blue for mipmap level 0, yellow for mipmap level 1, and red for mipmap level 2 or higher (even for textures that don't have mipmaps). This gives you an idea of the choice of the texture size. If it is blue, the texture is being drawn the proper size or magnified; if it is yellow, it is being minified a little bit; and if it red, it is being minified considerably. If you see a red texture when you are right in front of it, you should consider reducing the size of the texture to avoid wasting texture memory.

Not all rendering backends support the flash_texture feature. Presently, it is only supported by OpenGL.

Definition at line 502 of file graphicsStateGuardian.cxx.

bool DXGraphicsStateGuardian9::set_gamma ( float  gamma) [virtual]

Non static version of setting gamma.

Returns true on success.

Reimplemented from GraphicsStateGuardian.

Definition at line 5683 of file dxGraphicsStateGuardian9.cxx.

References static_set_gamma().

void GraphicsStateGuardian::set_incomplete_render ( bool  incomplete_render) [inline, inherited]

Sets the incomplete_render flag.

When this is true, the frame will be rendered even if some of the geometry or textures in the scene are not available (e.g. they have been temporarily paged out). When this is false, the frame will be held up while this data is reloaded.

Setting this true allows for a smoother frame rate, but occasionally parts of the frame will be invisible or missing (they will generally come in within a second or two). Setting this false guarantees that every frame will be complete, but may cause more chugs as things are loaded up at runtime.

You may want to set this false during loading screens, to guarantee that all of your assets are available by the time you take the loading screen down.

This flag may also be set individually on each DisplayRegion. It will be considered true for a given DisplayRegion only if it is true on both the GSG and on the DisplayRegion.

Definition at line 147 of file graphicsStateGuardian.I.

void GraphicsStateGuardian::set_loader ( Loader loader) [inline, inherited]

Sets the Loader object that will be used by this GSG to load textures when necessary, if get_incomplete_render() is true.

Definition at line 188 of file graphicsStateGuardian.I.

void DXGraphicsStateGuardian9::set_read_buffer ( const RenderBuffer rb) [protected]

Vestigial analog of glReadBuffer.

Definition at line 4260 of file dxGraphicsStateGuardian9.cxx.

Referenced by do_framebuffer_copy_to_ram(), and framebuffer_copy_to_texture().

HRESULT DXGraphicsStateGuardian9::set_render_state ( D3DRENDERSTATETYPE  state,
DWORD  value 
) [inline]

This function creates a common layer between DX and Panda for SetRenderState.

It also keeps avoids setting redundant render states.

Definition at line 158 of file dxGraphicsStateGuardian9.I.

Referenced by begin_draw_primitives(), do_auto_rescale_normal(), do_issue_blending(), enable_clip_plane(), enable_lighting(), end_draw_primitives(), prepare_display_region(), reset(), and set_ambient_light().

void DXGraphicsStateGuardian9::set_render_target ( ) [protected]

Set render target to the backbuffer of current swap chain.

Definition at line 4475 of file dxGraphicsStateGuardian9.cxx.

Referenced by wdxGraphicsWindow9::begin_frame().

HRESULT DXGraphicsStateGuardian9::set_sampler_state ( DWORD  sampler,
D3DSAMPLERSTATETYPE  type,
DWORD  value 
) [inline]

This function creates a common layer between DX and Panda.

It also keeps avoids setting redundant render states.

Definition at line 202 of file dxGraphicsStateGuardian9.I.

Referenced by apply_texture().

bool GraphicsStateGuardian::set_scene ( SceneSetup scene_setup) [inherited]

Sets the SceneSetup object that indicates the initial camera position, etc.

This must be called before traversal begins. Returns true if the scene is acceptable, false if something's wrong. This should be called in the draw thread only.

Definition at line 543 of file graphicsStateGuardian.cxx.

References SceneSetup::get_lens(), and GraphicsStateGuardian::prepare_lens().

Referenced by PipeOcclusionCullTraverser::set_scene(), and DisplayRegionDrawCallbackData::upcall().

void GraphicsStateGuardian::set_shader_model ( int  shader_model) [inline, inherited]

Sets the ShaderModel.

This will override the auto- detected shader model during GSG reset. Useful for testing lower-end shaders.

Definition at line 696 of file graphicsStateGuardian.I.

void DXGraphicsStateGuardian9::set_state_and_transform ( const RenderState target,
const TransformState transform 
) [virtual]

Simultaneously resets the render state and the transform state.

This transform specified is the "internal" net transform, already converted into the GSG's internal coordinate space by composing it to get_cs_transform(). (Previously, this used to be the "external" net transform, with the assumption that that GSG would convert it internally, but that is no longer the case.)

Special case: if (state==NULL), then the target state is already stored in _target.

Reimplemented from GraphicsStateGuardian.

Definition at line 3227 of file dxGraphicsStateGuardian9.cxx.

References BitMask< WType, nbits >::clear_bit(), GraphicsStateGuardian::determine_target_texture(), do_issue_blending(), GraphicsStateGuardian::do_issue_clip_plane(), GraphicsStateGuardian::do_issue_color(), GraphicsStateGuardian::do_issue_light(), do_issue_stencil(), do_issue_transform(), BitMask< WType, nbits >::get_bit(), and BitMask< WType, nbits >::set_bit().

void GraphicsStateGuardian::set_texture_quality_override ( Texture::QualityLevel  quality_level) [inline, inherited]

Specifies the global quality_level to be imposed for all Textures rendered by this GSG.

This overrides the value set on individual textures via Texture::set_quality_level(). Set this to Texture::QL_default in order to allow the individual texture quality levels to be respected.

This is mainly useful for the tinydisplay software renderer. See Texture::set_quality_level().

Definition at line 801 of file graphicsStateGuardian.I.

HRESULT DXGraphicsStateGuardian9::set_texture_stage_state ( DWORD  stage,
D3DTEXTURESTAGESTATETYPE  type,
DWORD  value 
) [inline]

This function creates a common layer between DX and Panda.

It also keeps avoids setting redundant render states.

Definition at line 180 of file dxGraphicsStateGuardian9.I.

Referenced by apply_texture(), and reset().

void DXGraphicsStateGuardian9::show_frame ( ) [protected]

redraw primary buffer

Definition at line 4891 of file dxGraphicsStateGuardian9.cxx.

Referenced by wdxGraphicsWindow9::end_flip().

bool DXGraphicsStateGuardian9::static_set_gamma ( bool  restore,
float  gamma 
) [static]

Static function for setting gamma which is needed for atexit.

Definition at line 5651 of file dxGraphicsStateGuardian9.cxx.

Referenced by atexit_function(), restore_gamma(), and set_gamma().

bool ReferenceCount::test_ref_count_integrity ( ) const [inline, inherited]
bool ReferenceCount::test_ref_count_nonzero ( ) const [inline, inherited]

Does some easy checks to make sure that the reference count isn't zero, or completely bogus.

Returns true if ok, false otherwise.

Definition at line 252 of file referenceCount.I.

References ReferenceCount::do_test_ref_count_nonzero().

Referenced by CopyOnWritePointer::test_ref_count_nonzero().

void GraphicsStateGuardian::traverse_prepared_textures ( GraphicsStateGuardian::TextureCallback *  func,
void *  callback_arg 
) [inherited]

Calls the indicated function on all currently-prepared textures, or until the callback function returns false.

Definition at line 463 of file graphicsStateGuardian.cxx.

bool ReferenceCount::unref ( ) const [inline, virtual, inherited]

Explicitly decrements the reference count.

Note that the object will not be implicitly deleted by unref() simply because the reference count drops to zero. (Having a member function delete itself is problematic.) However, see the helper function unref_delete().

User code should avoid using ref() and unref() directly, which can result in missed reference counts. Instead, let a PointerTo object manage the reference counting automatically.

This function is const, even though it changes the object, because generally fiddling with an object's reference count isn't considered part of fiddling with the object. An object might be const in other ways, but we still need to accurately count the number of references to it.

The return value is true if the new reference count is nonzero, false if it is zero.

Reimplemented in GeomVertexArrayFormat, GeomVertexFormat, InternalName, RenderAttrib, RenderEffects, RenderState, and TransformState.

Definition at line 214 of file referenceCount.I.

References ReferenceCount::test_ref_count_integrity().

Referenced by CachedTypedWritableReferenceCount::cache_unref(), TypedWritable::decode_raw_from_bam_stream(), RenderEffect::finalize(), NodeCachedReferenceCount::node_unref(), NodeReferenceCount::node_unref(), TransformState::unref(), RenderState::unref(), RenderEffects::unref(), RenderAttrib::unref(), InternalName::unref(), GeomVertexFormat::unref(), and GeomVertexArrayFormat::unref().

void TypedWritable::update_bam_nested ( BamWriter manager) [virtual, inherited]

Called by the BamWriter when this object has not itself been modified recently, but it should check its nested objects for updates.

Reimplemented in CFDoCullCommand, and PandaNode.

Definition at line 77 of file typedWritable.cxx.

bool DXGraphicsStateGuardian9::update_texture ( TextureContext tc,
bool  force 
) [virtual]

Ensures that the current Texture data is refreshed onto the GSG.

This means updating the texture properties and/or re-uploading the texture image, if necessary. This should only be called within the draw thread.

If force is true, this function will not return until the texture has been fully uploaded. If force is false, the function may choose to upload a simple version of the texture instead, if the texture is not fully resident (and if get_incomplete_render() is true).

Reimplemented from GraphicsStateGuardian.

Definition at line 326 of file dxGraphicsStateGuardian9.cxx.

References AdaptiveLruPage::enqueue_lru(), TextureContext::get_texture(), upload_texture(), and TextureContext::was_modified().

Referenced by apply_texture().

bool DXGraphicsStateGuardian9::upload_texture ( DXTextureContext9 dtc,
bool  force 
)
void ReferenceCount::weak_ref ( WeakPointerToVoid ptv) [inline, inherited]

Adds the indicated PointerToVoid as a weak reference to this object.

Definition at line 321 of file referenceCount.I.

References WeakReferenceList::add_reference(), and ReferenceCount::get_weak_list().

void ReferenceCount::weak_unref ( WeakPointerToVoid ptv) [inline, inherited]

Removes the indicated PointerToVoid as a weak reference to this object.

It must have previously been added via a call to weak_ref().

Definition at line 334 of file referenceCount.I.

References WeakReferenceList::clear_reference(), and ReferenceCount::has_weak_list().

void TypedWritable::write_datagram ( BamWriter manager,
Datagram dg 
) [virtual, inherited]

Writes the contents of this object to the datagram for shipping out to a Bam file.

Reimplemented in CFDoCullCommand, AnimBundle, AnimBundleNode, AnimChannelBase, AnimChannelMatrixDynamic, AnimChannelMatrixFixed, AnimChannelMatrixXfmTable, AnimChannelScalarDynamic, AnimChannelScalarTable, AnimGroup, AnimPreloadTable, MovingPart< SwitchType >, MovingPartBase, PartBundle, PartBundleNode, PartGroup, Character, CharacterJoint, CharacterJointEffect, CharacterVertexSlider, JointVertexTransform, CollisionBox, CollisionDSSolid, CollisionFloorMesh, CollisionInvSphere, CollisionLine, CollisionNode, CollisionParabola, CollisionPlane, CollisionPolygon, CollisionRay, CollisionSegment, CollisionSolid, CollisionSphere, CollisionTube, DataNode, DataNodeTransmit, ButtonEventList, EventStoreValue< Type >, Geom, GeomPrimitive, GeomVertexArrayData, GeomVertexArrayFormat, GeomVertexData, GeomVertexFormat, InternalName, Lens, Material, SliderTable, Texture, TextureStage, TransformBlendTable, TransformTable, UserVertexSlider, UserVertexTransform, VertexSlider, VertexTransform, CubicCurveseg, HermiteCurve, NurbsCurve, ParametricCurve, PiecewiseCurve, RopeNode, SheetNode, AlphaTestAttrib, AntialiasAttrib, AudioVolumeAttrib, AuxBitplaneAttrib, BillboardEffect, Camera, ClipPlaneAttrib, ColorAttrib, ColorBlendAttrib, ColorScaleAttrib, ColorWriteAttrib, CompassEffect, CullBinAttrib, CullFaceAttrib, DecalEffect, DepthOffsetAttrib, DepthTestAttrib, DepthWriteAttrib, Fog, FogAttrib, GeomNode, LensNode, LightAttrib, LightRampAttrib, MaterialAttrib, ModelNode, ModelRoot, PandaNode, PlaneNode, PolylightNode, PortalNode, RenderAttrib, RenderEffect, RenderEffects, RenderModeAttrib, RenderState, RescaleNormalAttrib, ScissorAttrib, ScissorEffect, ShadeModelAttrib, ShowBoundsEffect, StencilAttrib, TexGenAttrib, TexMatrixAttrib, TexProjectorEffect, TextureAttrib, TransformState, TransparencyAttrib, UvScrollNode, AmbientLight, CallbackNode, DirectionalLight, FadeLODNode, LightLensNode, LightNode, LODNode, PointLight, SequenceNode, Spotlight, SwitchNode, PNMFileType, BamCacheIndex, BamCacheRecord, WritableConfigurable, MouseRecorder, RecorderFrame, RecorderHeader, RecorderTable, DestTextureImage, EggFile, ImageFile, PaletteGroup, PaletteGroups, PaletteImage, PalettePage, Palettizer, SourceTextureImage, TextureImage, TexturePlacement, TexturePosition, TextureProperties, TextureReference, MovingPart< ACScalarSwitchType >, and MovingPart< ACMatrixSwitchType >.

Definition at line 66 of file typedWritable.cxx.

Referenced by GeomPrimitive::write_datagram(), and EventStoreValue< Type >::write_datagram().


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