Replace the OpenGL rendering backend with Vulkan across the engine: - Graphics: add VulkanContext (instance/device/swapchain/renderpass with depth-stencil), port Canvas to nanovg-on-Vulkan and DebugGUI to the imgui Vulkan backend, drop GLEW. Wait for the Wayland configure handshake before the first present and rebuild the swapchain to the confirmed size so the window maps reliably on fractional-scale outputs. - RasterRender: reimplement RenderBuffer, shaders and object pipeline on Vulkan (offscreen VkImage target with MSAA resolve, SPIR-V pipelines, push-constant MVP, depth remap for Vulkan clip space). - Sketch3D: port the stroke renderer (geometry-shader line expansion) and stroke GPU buffers to Vulkan. - 3DEditor: port the path-tracer texture upload to a Vulkan staging upload and keep raster/path-tracer viewports oriented consistently. - Add a nanovg external-VkImage bridge plus a render-target registry so 3D render targets can be shown inside the 2D canvas. - Prefer the Wayland platform in GLFW regardless of DISPLAY. - Widgets: make BasicLayout size distribution converge with a sub-pixel epsilon instead of an exact-zero comparison, which could otherwise spin forever on fractional-scale displays and block the first frame. Vendor nanovg_vulkan and add a standalone VulkanGraphics module.
30 lines
496 B
C++
30 lines
496 B
C++
|
|
#include "GraphicApplication.hpp"
|
|
|
|
#include "imgui.h"
|
|
|
|
using namespace tp;
|
|
|
|
class ExampleApplication : public Application {
|
|
public:
|
|
ExampleApplication() = default;
|
|
|
|
void processFrame(EventHandler* eventHandler, halnf) override {
|
|
// example
|
|
}
|
|
|
|
virtual void drawFrame(Canvas* canvas) override {
|
|
ImGui::ShowDemoWindow();
|
|
|
|
drawDebug();
|
|
}
|
|
|
|
bool forceNewFrame() override { return false; }
|
|
|
|
virtual ~ExampleApplication() = default;
|
|
};
|
|
|
|
int main() {
|
|
ExampleApplication app;
|
|
app.run();
|
|
}
|