1
0

Merging r6468 through r6486 from trunk to ogl-es branch

Also updating ES&ES2 interface to work with removal of IMaterialRendererServices::setBasicRenderStates


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/branches/ogl-es@6487 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
cutealien
2023-05-05 19:28:40 +00:00
parent e4bb544079
commit 1670db617b
34 changed files with 700 additions and 433 deletions

View File

@@ -15,6 +15,20 @@ namespace scene
class IShadowVolumeSceneNode;
class IMesh;
//! Option for nodes how to register themeselves at the SceneManager
enum ENodeRegistration
{
//! Each node registers once and renders all it's mesh-buffers
ENR_DEFAULT,
//! Register a new node per mesh-buffer at the SceneManager
//! It allows the SceneManager to sort in each render stage per buffer instead of per node.
//! This can be useful when having several transparent buffers in a mesh.
//! Depending on the scene (and hardware) this can have a positive or negative effect on performance.
//! It can avoid texture-switches, but adds nodes to sort and more matrix transformations are set.
ENR_PER_MESH_BUFFER
};
//! A scene node displaying a static mesh
class IMeshSceneNode : public ISceneNode
@@ -28,9 +42,11 @@ public:
const core::vector3df& position = core::vector3df(0,0,0),
const core::vector3df& rotation = core::vector3df(0,0,0),
const core::vector3df& scale = core::vector3df(1,1,1))
: ISceneNode(parent, mgr, id, position, rotation, scale) {}
: ISceneNode(parent, mgr, id, position, rotation, scale)
, NodeRegistration(ENR_DEFAULT)
{}
//! Sets a new mesh to display
//! Sets a new mesh to display or update mesh when it changed
/** \param mesh Mesh to display. */
virtual void setMesh(IMesh* mesh) = 0;
@@ -73,6 +89,23 @@ public:
/** This flag can be set by setReadOnlyMaterials().
\return Whether the materials are read-only. */
virtual bool isReadOnlyMaterials() const = 0;
//! Set how the node registers itself to the SceneManager
/** Note: Derived classes can ignore this flag, so think of it as a hint. */
virtual void setNodeRegistration(ENodeRegistration nodeRegistration)
{
NodeRegistration = nodeRegistration;
}
//! How does a node register itself to the SceneManager
/** Note: Derived classes may ignore this flag */
virtual ENodeRegistration getNodeRegistration() const
{
return NodeRegistration;
}
protected:
ENodeRegistration NodeRegistration;
};
} // end namespace scene