22 _prepared_objects->release_all();
30 return _prepared_objects->release_all_textures();
38 return _prepared_objects->release_all_samplers();
46 return _prepared_objects->release_all_geoms();
54 return _prepared_objects->release_all_vertex_buffers();
62 return _prepared_objects->release_all_index_buffers();
70 return _prepared_objects->release_all_shader_buffers();
87 INLINE
bool GraphicsStateGuardian::
89 return _active && _is_valid;
97 INLINE
bool GraphicsStateGuardian::
132 _incomplete_render = incomplete_render;
138 INLINE
bool GraphicsStateGuardian::
139 get_incomplete_render()
const {
140 return _incomplete_render;
153 INLINE
bool GraphicsStateGuardian::
154 get_effective_incomplete_render()
const {
155 return _effective_incomplete_render;
171 INLINE
Loader *GraphicsStateGuardian::
182 _shader_generator = shader_generator;
190 get_shader_generator()
const {
191 return _shader_generator;
207 return _threading_model;
227 return _prefers_triangle_strips;
234 INLINE
int GraphicsStateGuardian::
235 get_max_vertices_per_array()
const {
236 return _max_vertices_per_array;
243 INLINE
int GraphicsStateGuardian::
244 get_max_vertices_per_primitive()
const {
245 return _max_vertices_per_primitive;
258 INLINE
int GraphicsStateGuardian::
259 get_max_texture_stages()
const {
260 if (max_texture_stages > 0) {
261 return std::min(_max_texture_stages, (
int)max_texture_stages);
263 return _max_texture_stages;
273 INLINE
int GraphicsStateGuardian::
274 get_max_texture_dimension()
const {
275 return _max_texture_dimension;
286 INLINE
int GraphicsStateGuardian::
287 get_max_3d_texture_dimension()
const {
288 return _max_3d_texture_dimension;
298 INLINE
int GraphicsStateGuardian::
299 get_max_2d_texture_array_layers()
const {
300 return _max_2d_texture_array_layers;
311 INLINE
int GraphicsStateGuardian::
312 get_max_cube_map_dimension()
const {
313 return _max_cube_map_dimension;
323 INLINE
int GraphicsStateGuardian::
324 get_max_buffer_texture_size()
const {
325 return _max_buffer_texture_size;
334 INLINE
bool GraphicsStateGuardian::
335 get_supports_texture_combine()
const {
336 return _supports_texture_combine;
344 INLINE
bool GraphicsStateGuardian::
345 get_supports_texture_saved_result()
const {
346 return _supports_texture_saved_result;
353 INLINE
bool GraphicsStateGuardian::
354 get_supports_texture_dot3()
const {
355 return _supports_texture_dot3;
361 INLINE
bool GraphicsStateGuardian::
362 get_supports_3d_texture()
const {
363 return _supports_3d_texture;
369 INLINE
bool GraphicsStateGuardian::
370 get_supports_2d_texture_array()
const {
371 return _supports_2d_texture_array;
377 INLINE
bool GraphicsStateGuardian::
378 get_supports_cube_map()
const {
379 return _supports_cube_map;
385 INLINE
bool GraphicsStateGuardian::
386 get_supports_buffer_texture()
const {
387 return _supports_buffer_texture;
393 INLINE
bool GraphicsStateGuardian::
394 get_supports_cube_map_array()
const {
395 return _supports_cube_map_array;
401 INLINE
bool GraphicsStateGuardian::
402 get_supports_tex_non_pow2()
const {
403 return _supports_tex_non_pow2;
409 INLINE
bool GraphicsStateGuardian::
410 get_supports_texture_srgb()
const {
411 return _supports_texture_srgb;
418 INLINE
bool GraphicsStateGuardian::
419 get_supports_compressed_texture()
const {
420 return _supports_compressed_texture;
430 return _compressed_texture_formats.
get_bit(compression_mode);
440 INLINE
int GraphicsStateGuardian::
441 get_max_lights()
const {
452 INLINE
int GraphicsStateGuardian::
453 get_max_clip_planes()
const {
454 return _max_clip_planes;
467 INLINE
int GraphicsStateGuardian::
468 get_max_vertex_transforms()
const {
469 return _max_vertex_transforms;
482 INLINE
int GraphicsStateGuardian::
483 get_max_vertex_transform_indices()
const {
484 return _max_vertex_transform_indices;
498 INLINE
bool GraphicsStateGuardian::
499 get_copy_texture_inverted()
const {
502 return copy_texture_inverted;
506 return _copy_texture_inverted;
515 INLINE
bool GraphicsStateGuardian::
516 get_supports_generate_mipmap()
const {
517 return _supports_generate_mipmap;
526 INLINE
bool GraphicsStateGuardian::
527 get_supports_depth_texture()
const {
528 return _supports_depth_texture;
536 INLINE
bool GraphicsStateGuardian::
537 get_supports_depth_stencil()
const {
538 return _supports_depth_stencil;
544 INLINE
bool GraphicsStateGuardian::
545 get_supports_luminance_texture()
const {
546 return _supports_luminance_texture;
553 INLINE
bool GraphicsStateGuardian::
554 get_supports_shadow_filter()
const {
555 return _supports_shadow_filter;
565 INLINE
bool GraphicsStateGuardian::
566 get_supports_sampler_objects()
const {
567 return _supports_sampler_objects;
573 INLINE
bool GraphicsStateGuardian::
574 get_supports_basic_shaders()
const {
575 return _supports_basic_shaders;
581 INLINE
bool GraphicsStateGuardian::
582 get_supports_geometry_shaders()
const {
583 return _supports_geometry_shaders;
589 INLINE
bool GraphicsStateGuardian::
590 get_supports_tessellation_shaders()
const {
591 return _supports_tessellation_shaders;
597 INLINE
bool GraphicsStateGuardian::
598 get_supports_compute_shaders()
const {
599 return _supports_compute_shaders;
605 INLINE
bool GraphicsStateGuardian::
606 get_supports_glsl()
const {
607 return _supports_glsl;
613 INLINE
bool GraphicsStateGuardian::
614 get_supports_hlsl()
const {
615 return _supports_hlsl;
621 INLINE
bool GraphicsStateGuardian::
622 get_supports_stencil()
const {
623 return _supports_stencil;
630 INLINE
bool GraphicsStateGuardian::
631 get_supports_two_sided_stencil()
const {
632 return _supports_two_sided_stencil;
640 INLINE
bool GraphicsStateGuardian::
641 get_supports_geometry_instancing()
const {
642 return _supports_geometry_instancing;
649 INLINE
bool GraphicsStateGuardian::
650 get_supports_indirect_draw()
const {
651 return _supports_indirect_draw;
660 bool GraphicsStateGuardian::
661 get_supports_occlusion_query()
const {
662 return _supports_occlusion_query;
668 bool GraphicsStateGuardian::
669 get_supports_timer_query()
const {
670 return _supports_timer_query;
676 bool GraphicsStateGuardian::
677 get_timer_queries_active()
const {
679 return _timer_queries_active;
695 INLINE
int GraphicsStateGuardian::
696 get_max_color_targets()
const {
697 if (max_color_targets > 0) {
698 return std::min(_max_color_targets, (
int)max_color_targets);
700 return _max_color_targets;
707 INLINE
bool GraphicsStateGuardian::
708 get_supports_dual_source_blending()
const {
709 return _supports_dual_source_blending;
724 INLINE GraphicsStateGuardian::ShaderModel GraphicsStateGuardian::
725 get_shader_model()
const {
726 return _shader_model;
735 if (shader_model <= _auto_detect_shader_model) {
736 _shader_model = shader_model;
747 return _color_scale_via_lighting;
757 return _alpha_scale_via_texture;
769 return _alpha_scale_via_texture &&
770 (tex_attrib ==
nullptr ||
780 if (_alpha_scale_texture_stage ==
nullptr) {
781 _alpha_scale_texture_stage =
new TextureStage(
"alpha-scale");
782 _alpha_scale_texture_stage->set_sort(1000000000);
784 return _alpha_scale_texture_stage;
794 return _runtime_color_scale;
802 INLINE CoordinateSystem GraphicsStateGuardian::
803 get_coordinate_system()
const {
804 return _coordinate_system;
818 _texture_quality_override = quality_level;
828 INLINE Texture::QualityLevel GraphicsStateGuardian::
829 get_texture_quality_override()
const {
830 return _texture_quality_override;
861 get_external_transform()
const {
862 return _inv_cs_transform->compose(_internal_transform);
871 get_internal_transform()
const {
872 return _internal_transform;
880 get_current_display_region()
const {
881 return _current_display_region;
888 INLINE Lens::StereoChannel GraphicsStateGuardian::
889 get_current_stereo_channel()
const {
890 return _current_stereo_channel;
897 INLINE
int GraphicsStateGuardian::
898 get_current_tex_view_offset()
const {
899 return _current_tex_view_offset;
906 INLINE
const Lens *GraphicsStateGuardian::
907 get_current_lens()
const {
908 return _current_lens;
915 get_inv_cs_transform()
const {
916 return _inv_cs_transform;
923 INLINE
void GraphicsStateGuardian::
925 _current_properties = prop;
set_shader_generator
Sets the ShaderGenerator object that will be used by this GSG to generate shaders when necessary.
set_shader_model
Sets the ShaderModel.
bool get_runtime_color_scale() const
Returns true if this particular GSG can implement (or would prefer to implement) set color and/or col...
set_active
Sets the active flag associated with the GraphicsStateGuardian.
virtual bool prefers_triangle_strips() const
Returns true if this GSG strongly prefers triangle strips to individual triangles (such as SGI),...
A base class for any number of different kinds of lenses, linear and otherwise.
bool get_color_scale_via_lighting() const
Returns true if this particular GSG can implement (or would prefer to implement) set color and/or col...
int get_maximum_simultaneous_render_targets() const
Deprecated.
get_num_on_stages
Returns the number of stages that are turned on by the attribute.
void release_all()
Releases all prepared objects.
bool reset_if_new()
Calls reset() to initialize the GSG, but only if it hasn't been called yet.
int release_all_textures()
Frees the resources for all textures associated with this GSG.
get_max_color_targets
Returns the maximum number of simultaneous color textures that may be attached for render-to-texture,...
A convenient class for loading models from disk, in bam or egg format (or any of a number of other fo...
get_max_texture_stages
Returns the maximum number of simultaneous textures that may be applied to geometry with multitexturi...
set_loader
Sets the Loader object that will be used by this GSG to load textures when necessary,...
bool is_hardware() const
Returns true if this GSG appears to be hardware-accelerated, or false if it is known to be software o...
bool get_alpha_scale_via_texture() const
Returns true if this particular GSG can implement (or would prefer to implement) an alpha scale via a...
Indicates the set of TextureStages and their associated Textures that should be applied to (or remove...
bool get_bit(int index) const
Returns true if the nth bit is set, false if it is cleared.
set_texture_quality_override
Specifies the global quality_level to be imposed for all Textures rendered by this GSG.
void mark_new()
Marks the GSG as "new", so that the next call to reset_if_new() will be effective.
An object to create GraphicsOutputs that share a particular 3-D API.
This represents the user's specification of how a particular frame is handled by the various threads.
set_incomplete_render
Sets the incomplete_render flag.
int release_all_geoms()
Frees the resources for all geoms associated with this GSG.
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 has_value() const
Returns true if this variable has an explicit value, either from a prc file or locally set,...
int release_all_index_buffers()
Frees the resources for all index buffers associated with this GSG.
A rectangular subregion within a window for rendering into.
bool needs_reset() const
Returns true if the gsg is marked as needing a reset.
int release_all_vertex_buffers()
Frees the resources for all vertex buffers associated with this GSG.
CPT(TransformState) GraphicsStateGuardian
Fetches the external net transform.
int release_all_samplers()
Frees the resources for all samplers associated with this GSG.
virtual void reset()
Resets all internal state as if the gsg were newly created.
A container for the various kinds of properties we might ask to have on a graphics frameBuffer before...
int release_all_shader_buffers()
Frees the resources for all index buffers associated with this GSG.
Defines the properties of a named stage of the multitexture pipeline.
static TextureStage * get_alpha_scale_texture_stage()
Returns the TextureStage that will be used to apply an alpha scale, if get_alpha_scale_via_texture() ...
const GraphicsThreadingModel & get_threading_model() const
Returns the threading model that was used to create this GSG.