All Projects → T0b1-iOS → draw_manager

T0b1-iOS / draw_manager

Licence: other
A threadsafe implementation-independent drawing wrapper

Programming Languages

C++
36643 projects - #6 most used programming language
HLSL
714 projects

draw_manager

basic multithreaded drawing

Setting up

To get drawing to work you need to implement a class which extends draw_manager and implements the virtual functions. How to actually draw is pretty specific to your environment but to get an idea you can look at the d3d9 implementation provided or how ImGui does drawing, it's pretty similar.

You also need to provide freetype headers & binaries(https://www.freetype.org/download.html) as well as stb_rectpack.h(https://github.com/nothings/stb/blob/master/stb_rect_pack.h)

Usage for Drawing

// Register buffer once somewhere
static const auto buffer_idx = draw_manager->register_buffer();

// Each time you do a draw pass get a pointer to the buffer
const auto buffer = draw_manager->get_buffer(buffer_idx);
// do the drawing stuff
// so for example
buffer->rectangle_filled({0.f, 0.f}, draw_manager->get_screen_size(), math::color_rgba::white());
// then swap
draw_manager->swap_buffers(buffer_idx);

Feature List

  • drawing of primitives & text(freetype) into a vertex/index buffer consisting of triangles
  • multithreading as it operates like a swapchain
  • multiple independent buffers which can be sorted by priority & parent-child hierarchy
  • independent of actual drawing implementation(confirmed to work for d3d9 & csgo's surface)
  • supports bluring, color-keying & circle scissors if they are implemented

Looks like this (after a resize and with the d3d9 implementation)

preview

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].