Browse Source

ui: fix wrong IBO/VBO bind order.

legacy
Sam Hocevar 5 years ago
parent
commit
a1d5089f8d
2 changed files with 10 additions and 3 deletions
  1. +7
    -1
      src/ui/gui.cpp
  2. +3
    -2
      src/ui/gui.h

+ 7
- 1
src/ui/gui.cpp View File

@@ -261,6 +261,12 @@ void gui::tick_draw(float seconds, Scene &scene)
scene.AddPrimitiveRenderer(this, std::make_shared<primitive>());
}

bool gui::release_draw()
{
m_vdecl.reset();
return true;
}

void gui::primitive::Render(Scene& scene, std::shared_ptr<PrimitiveSource> prim)
{
UNUSED(scene, prim);
@@ -353,8 +359,8 @@ void gui::render_draw_lists(ImDrawData* draw_data)
memcpy(indices, command_list.IdxBuffer.Data, command_list.IdxBuffer.Size * sizeof(ImDrawIdx));
ibo->Unlock();

ibo->Bind();
m_vdecl->Bind();
ibo->Bind();
m_vdecl->SetStream(vbo, m_attribs[0], m_attribs[1], m_attribs[2]);

const ImDrawIdx* idx_buffer_offset = 0;


+ 3
- 2
src/ui/gui.h View File

@@ -57,8 +57,9 @@ private:
typedef entity super;

protected:
virtual void tick_game(float seconds);
virtual void tick_draw(float seconds, Scene &scene);
virtual void tick_game(float seconds) override;
virtual void tick_draw(float seconds, Scene &scene) override;
virtual bool release_draw() override;

static void static_set_clipboard(void *data, const char* text);
static const char* static_get_clipboard(void *data);


Loading…
Cancel
Save