Documentation for module: Graphics

Former-commit-id: 5e3ee3c61779fbdd1a083117f537a45e1bad820b
This commit is contained in:
Gawaboumga
2016-05-30 14:21:36 +02:00
parent 6400ba2e28
commit 96b958d655
94 changed files with 4858 additions and 504 deletions

View File

@@ -11,6 +11,19 @@
namespace Nz
{
/*!
* \ingroup graphics
* \class Nz::Sprite
* \brief Graphics class that represents the rendering of a sprite
*/
/*!
* \brief Adds the sprite to the rendering queue
*
* \param renderQueue Queue to be added
* \param instanceData Data for the instance
*/
void Sprite::AddToRenderQueue(AbstractRenderQueue* renderQueue, const InstanceData& instanceData) const
{
if (!m_material)
@@ -20,11 +33,21 @@ namespace Nz
renderQueue->AddSprites(instanceData.renderOrder, m_material, vertices, 1);
}
/*!
* \brief Makes the bounding volume of this text
*/
void Sprite::MakeBoundingVolume() const
{
m_boundingVolume.Set(Vector3f(0.f), m_size.x*Vector3f::Right() + m_size.y*Vector3f::Down());
}
/*!
* \brief Updates the data of the sprite
*
* \param instanceData Data of the instance
*/
void Sprite::UpdateData(InstanceData* instanceData) const
{
instanceData->data.resize(4 * sizeof(VertexStruct_XYZ_Color_UV));
@@ -51,6 +74,13 @@ namespace Nz
*texCoordPtr++ = m_textureCoords.GetCorner(RectCorner_RightBottom);
}
/*!
* \brief Initializes the sprite librairies
* \return true If successful
*
* \remark Produces a NazaraError if the sprite library failed to be initialized
*/
bool Sprite::Initialize()
{
if (!SpriteLibrary::Initialize())
@@ -62,6 +92,10 @@ namespace Nz
return true;
}
/*!
* \brief Uninitializes the sprite librairies
*/
void Sprite::Uninitialize()
{
SpriteLibrary::Uninitialize();