Remade sprite rendering

Added VertexColor shader flag
Added color sprite attribute
Added VertexStruct_XY_Color(_UV) struct & declaration


Former-commit-id: b664f4520aa55f4502f85f9dedab9b92040a8c16
This commit is contained in:
Lynix
2015-01-04 13:19:07 +01:00
parent 97ff9bc4ac
commit 4de17fdffb
22 changed files with 264 additions and 145 deletions

View File

@@ -10,6 +10,7 @@
#include <Nazara/Prerequesites.hpp>
#include <Nazara/Graphics/Material.hpp>
#include <Nazara/Graphics/SceneNode.hpp>
#include <Nazara/Utility/VertexStruct.hpp>
class NAZARA_API NzSprite : public NzSceneNode
{
@@ -23,6 +24,7 @@ class NAZARA_API NzSprite : public NzSceneNode
void AddToRenderQueue(NzAbstractRenderQueue* renderQueue) const override;
const NzBoundingVolumef& GetBoundingVolume() const override;
const NzColor& GetColor() const;
NzMaterial* GetMaterial() const;
nzSceneNodeType GetSceneNodeType() const override;
const NzVector2f& GetSize() const;
@@ -30,6 +32,7 @@ class NAZARA_API NzSprite : public NzSceneNode
bool IsDrawable() const;
void SetColor(const NzColor& color);
void SetMaterial(NzMaterial* material, bool resizeSprite = true);
void SetSize(const NzVector2f& size);
void SetSize(float sizeX, float sizeY);
@@ -42,12 +45,16 @@ class NAZARA_API NzSprite : public NzSceneNode
void Register() override;
void Unregister() override;
void UpdateBoundingVolume() const;
void UpdateVertices() const;
mutable NzBoundingVolumef m_boundingVolume;
NzColor m_color;
NzMaterialRef m_material;
NzRectf m_textureCoords;
NzVector2f m_size;
mutable NzVertexStruct_XYZ_Color_UV m_vertices[4];
mutable bool m_boundingVolumeUpdated;
mutable bool m_verticesUpdated;
};
#endif // NAZARA_SPRITE_HPP