浏览代码

ui: fix wrong IBO/VBO bind order.

legacy
Sam Hocevar 5 年前
父节点
当前提交
a1d5089f8d
共有 2 个文件被更改,包括 10 次插入3 次删除
  1. +7
    -1
      src/ui/gui.cpp
  2. +3
    -2
      src/ui/gui.h

+ 7
- 1
src/ui/gui.cpp 查看文件

@@ -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 查看文件

@@ -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);


正在加载...
取消
保存