Documentation for module: Graphics

Former-commit-id: 1757c33318443aade1dc38e16d053240d7dc885c
This commit is contained in:
Gawaboumga
2016-05-30 14:21:36 +02:00
parent 7721fd2284
commit 2c941827ed
94 changed files with 4858 additions and 504 deletions

View File

@@ -22,6 +22,18 @@ namespace Nz
static VertexBufferRef s_vertexBuffer;
}
/*!
* \ingroup graphics
* \class Nz::SkyboxBackground
* \brief Graphics class that represents a background with a cubemap texture
*/
/*!
* \brief Constructs a SkyboxBackground object with a cubemap texture
*
* \param cubemapTexture Cubemap texture
*/
SkyboxBackground::SkyboxBackground(TextureRef cubemapTexture) :
m_movementOffset(Vector3f::Zero()),
m_movementScale(0.f)
@@ -31,6 +43,12 @@ namespace Nz
SetTexture(std::move(cubemapTexture));
}
/*!
* \brief Draws this relatively to the viewer
*
* \param viewer Viewer for the background
*/
void SkyboxBackground::Draw(const AbstractViewer* viewer) const
{
Matrix4f skyboxMatrix(viewer->GetViewMatrix());
@@ -65,14 +83,26 @@ namespace Nz
Renderer::SetMatrix(MatrixType_View, viewer->GetViewMatrix());
}
/*!
* \brief Gets the background type
* \return Type of background
*/
BackgroundType SkyboxBackground::GetBackgroundType() const
{
return BackgroundType_Skybox;
}
/*!
* \brief Initializes the skybox
* \return true If successful
*
* \remark Produces a NazaraError if initialization failed
*/
bool SkyboxBackground::Initialize()
{
const UInt16 indices[6*6] =
const UInt16 indices[6 * 6] =
{
0, 1, 2, 0, 2, 3,
3, 2, 6, 3, 6, 7,
@@ -170,6 +200,10 @@ namespace Nz
return true;
}
/*!
* \brief Uninitializes the skybox
*/
void SkyboxBackground::Uninitialize()
{
s_indexBuffer.Reset();