Skip to content

Commit

Permalink
[CelestialObject] Now using default index buffer.
Browse files Browse the repository at this point in the history
  • Loading branch information
Unarelith committed Oct 29, 2023
1 parent 05854bb commit 91135a2
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
9 changes: 1 addition & 8 deletions source/client/graphics/CelestialObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,6 @@

CelestialObject::CelestialObject() {
m_vbo.setupDefaultLayout();

static const u16 indices[] = {
0, 1, 3,
3, 1, 2
};

m_ibo.init(indices, sizeof(indices));
}

void CelestialObject::setTexture(const std::string &textureName) {
Expand Down Expand Up @@ -172,5 +165,5 @@ void CelestialObject::draw(RenderTarget &target, RenderStates states) const {
if (m_texture)
states.texture = m_texture;

target.drawElements(m_vbo, m_ibo, 0, 0, states);
target.drawElements(m_vbo, target.defaultIndexBuffer(), 0, 6, states);
}
2 changes: 0 additions & 2 deletions source/client/graphics/CelestialObject.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
#include <gk/graphics/Color.hpp>

#include "Drawable.hpp"
#include "IndexBuffer.hpp"
#include "VertexBuffer.hpp"

class CelestialObject : public Drawable, public gk::Transformable {
Expand All @@ -57,7 +56,6 @@ class CelestialObject : public Drawable, public gk::Transformable {
void draw(RenderTarget &target, RenderStates states) const override;

mutable VertexBuffer m_vbo;
IndexBuffer m_ibo;

gk::Color m_color = gk::Color::White;

Expand Down

0 comments on commit 91135a2

Please sign in to comment.