From 6ea003c7b5ec97d0a754197654cdf6e7fccdba24 Mon Sep 17 00:00:00 2001 From: Tony Wasserka Date: Sun, 17 Aug 2014 14:06:58 +0200 Subject: Pica: Add debug utility functions for dumping geometry data. --- src/video_core/debug_utils/debug_utils.h | 40 ++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 src/video_core/debug_utils/debug_utils.h (limited to 'src/video_core/debug_utils/debug_utils.h') diff --git a/src/video_core/debug_utils/debug_utils.h b/src/video_core/debug_utils/debug_utils.h new file mode 100644 index 00000000..9b4dce53 --- /dev/null +++ b/src/video_core/debug_utils/debug_utils.h @@ -0,0 +1,40 @@ +// Copyright 2014 Citra Emulator Project +// Licensed under GPLv2 +// Refer to the license.txt file included. + +#pragma once + +#include +#include + +#include "video_core/pica.h" + +namespace Pica { + +namespace DebugUtils { + +using TriangleTopology = Regs::TriangleTopology; + +// Simple utility class for dumping geometry data to an OBJ file +class GeometryDumper { +public: + void AddVertex(std::array pos, TriangleTopology topology); + + void Dump(); + +private: + struct Vertex { + std::array pos; + }; + + struct Face { + int index[3]; + }; + + std::vector vertices; + std::vector faces; +}; + +} // namespace + +} // namespace -- cgit v1.2.3