Panda3D
panda
src
dxgsg9
dxGeomMunger9.I
1
// Filename: dxGeomMunger9.I
2
// Created by: drose (11Mar05)
3
//
4
////////////////////////////////////////////////////////////////////
5
//
6
// PANDA 3D SOFTWARE
7
// Copyright (c) Carnegie Mellon University. All rights reserved.
8
//
9
// All use of this software is subject to the terms of the revised BSD
10
// license. You should have received a copy of this license along
11
// with this source code in a file named "LICENSE."
12
//
13
////////////////////////////////////////////////////////////////////
14
15
16
////////////////////////////////////////////////////////////////////
17
// Function: DXGeomMunger9::Constructor
18
// Access: Public
19
// Description:
20
////////////////////////////////////////////////////////////////////
21
INLINE DXGeomMunger9::
22
DXGeomMunger9(
GraphicsStateGuardian
*gsg,
const
RenderState
*state) :
23
StandardMunger
(gsg, state, 1, NT_packed_dabc, C_color),
24
_texture(DCAST(
TextureAttrib
, state->get_attrib(
TextureAttrib
::get_class_slot()))),
25
_tex_gen(DCAST(
TexGenAttrib
, state->get_attrib(
TexGenAttrib
::get_class_slot())))
26
{
27
_filtered_texture = (
TextureAttrib
*)NULL;
28
_reffed_filtered_texture =
false
;
29
if
(_texture != (
TextureAttrib
*)NULL) {
30
_filtered_texture = _texture->filter_to_max(gsg->
get_max_texture_stages
());
31
if
(_filtered_texture != _texture) {
32
_filtered_texture->
ref
();
33
_reffed_filtered_texture =
true
;
34
}
35
}
36
// Set a callback to unregister ourselves when either the Texture or
37
// the TexGen object gets deleted.
38
_texture.set_callback(
this
);
39
_tex_gen.set_callback(
this
);
40
}
41
StandardMunger
Performs some generic munging that is appropriate for all GSG types; for instance, applies ColorAttrib and ColorScaleAttrib to the vertices, and checks for hardware-accelerated animation capabilities.
Definition:
standardMunger.h:34
TextureAttrib
Indicates the set of TextureStages and their associated Textures that should be applied to (or remove...
Definition:
textureAttrib.h:34
GraphicsStateGuardian::get_max_texture_stages
int get_max_texture_stages() const
Returns the maximum number of simultaneous textures that may be applied to geometry with multitexturi...
Definition:
graphicsStateGuardian.I:327
ReferenceCount::ref
void ref() const
Explicitly increments the reference count.
Definition:
referenceCount.I:179
RenderState
This represents a unique collection of RenderAttrib objects that correspond to a particular renderabl...
Definition:
renderState.h:53
GraphicsStateGuardian
Encapsulates all the communication with a particular instance of a given rendering backend...
Definition:
graphicsStateGuardian.h:67
TexGenAttrib
Computes texture coordinates for geometry automatically based on vertex position and/or normal...
Definition:
texGenAttrib.h:36
Generated on Wed May 17 2017 23:41:19 for Panda3D by
1.8.13