diff --git a/demo/tz/tz_triangle_demo.cpp b/demo/tz/tz_triangle_demo.cpp index def2228bdf..2f1adb301e 100644 --- a/demo/tz/tz_triangle_demo.cpp +++ b/demo/tz/tz_triangle_demo.cpp @@ -47,6 +47,13 @@ int tz_main() while(tz::os::window_is_open()) { tz::os::window_update(); + auto windims = static_cast(tz::v2u{tz::os::window_get_width(), tz::os::window_get_height()}); + ImGui::GetIO().DisplaySize = {windims[0], windims[1]}; + ImGui::NewFrame(); + ImGui::Begin("123"); + ImGui::Text("hello world"); + ImGui::End(); + ImGui::EndFrame(); tz::gpu::execute(graph); } diff --git a/include/tz/core/vector.hpp b/include/tz/core/vector.hpp index 325caff4d3..263906b62a 100644 --- a/include/tz/core/vector.hpp +++ b/include/tz/core/vector.hpp @@ -3,6 +3,7 @@ #include #include #include +#include namespace tz { @@ -96,6 +97,14 @@ namespace tz /// Divide one vector by another. vector operator/(const vector& rhs) const{auto cpy = *this; return cpy /= rhs;} + template + operator vector() const requires(std::is_convertible_v) + { + std::array arr; + std::transform(this->arr.begin(), this->arr.end(), arr.begin(), [](const T& t)->C{return static_cast(t);}); + return {arr}; + } + /// Retrieve the magnitude of the vector. T length() const; /// Retrieve the dot (scalar) product of two vectors. diff --git a/src/tz/imgui.cpp b/src/tz/imgui.cpp index 02b944e0f6..5c7715c6df 100644 --- a/src/tz/imgui.cpp +++ b/src/tz/imgui.cpp @@ -104,8 +104,14 @@ namespace tz { (void)graph; // we have a graph that could be completely wrong. + ImGui::Render(); ImDrawData* draws = ImGui::GetDrawData(); - (void)draws; + if(draws == nullptr) + { + return; + } + + impl_write_vertices_and_indices(draws); } void impl_write_vertices_and_indices(ImDrawData* draw)