diff --git a/CMakeLists.txt b/CMakeLists.txt index bfdf0e9ac1..0c6f8f43ee 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -253,8 +253,10 @@ add_library(topaz STATIC # tz::ren src/tz/ren/animation.cpp src/tz/ren/animation.hpp + src/tz/ren/api.hpp src/tz/ren/mesh.cpp src/tz/ren/mesh.hpp + src/tz/ren/tz_ren.hpp ) if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows") diff --git a/src/tz/gl/tz_gl.hpp b/src/tz/gl/tz_gl.hpp index b34ceb5808..6bf074497b 100644 --- a/src/tz/gl/tz_gl.hpp +++ b/src/tz/gl/tz_gl.hpp @@ -8,7 +8,7 @@ namespace tz::gl /** * @ingroup tz_cpp * @defgroup tz_gl2 Graphics Library - * Hardware-accelerated 3D graphics library. + * Low-level 3D graphics library. * * Rendering 3D graphics in Topaz is achieved by doing the following: * - Populate a @ref tz::gl::renderer_info describing how to render what you want. diff --git a/src/tz/ren/api.hpp b/src/tz/ren/api.hpp new file mode 100644 index 0000000000..8d98575ad7 --- /dev/null +++ b/src/tz/ren/api.hpp @@ -0,0 +1,20 @@ +#ifndef TOPAZ_REN_API_HPP +#define TOPAZ_REN_API_HPP + +namespace tz::ren +{ + /** + * @ingroup tz_ren + * Interface for a high-level `tz::ren` renderer class. + */ + class ihigh_level_renderer + { + public: + /** + * Append this renderer to the end of the render-graph, without specifying any dependencies. + */ + virtual void append_to_render_graph() = 0; + }; +} + +#endif // TOPAZ_REN_API_HPP \ No newline at end of file diff --git a/src/tz/ren/mesh.hpp b/src/tz/ren/mesh.hpp index 7c80ea5ffd..174bc0bcc6 100644 --- a/src/tz/ren/mesh.hpp +++ b/src/tz/ren/mesh.hpp @@ -1,5 +1,6 @@ #ifndef TOPAZ_REN_MESH_HPP #define TOPAZ_REN_MESH_HPP +#include "tz/ren/api.hpp" #include "tz/gl/renderer.hpp" #include "tz/core/data/vector.hpp" #include "tz/core/matrix.hpp" @@ -85,7 +86,7 @@ namespace tz::ren * todo: document * a two-pass (compute gpu command generation => render) mesh renderer. pbr? */ - class mesh_renderer + class mesh_renderer : public ihigh_level_renderer { struct object_tag_t{}; public: @@ -123,7 +124,7 @@ namespace tz::ren void remove_object(object_handle oh); texture_handle add_texture(tz::vec2ui dimensions, std::span image_data); - void append_to_render_graph(); + virtual void append_to_render_graph() override; tz::trs get_camera_transform() const; void set_camera_transform(tz::trs camera_transform); diff --git a/src/tz/ren/tz_ren.hpp b/src/tz/ren/tz_ren.hpp new file mode 100644 index 0000000000..634cf38871 --- /dev/null +++ b/src/tz/ren/tz_ren.hpp @@ -0,0 +1,15 @@ +#ifndef TOPAZ_REN_TZ_REN_HPP +#define TOPAZ_REN_TZ_REN_HPP + +namespace tz::ren +{ + /** + * @ingroup tz_cpp + * @defgroup tz_ren Rendering Library + * High-level 3D rendering library. Built ontop of @ref tz_gl2. + * + * The rendering library is mostly comprised of high-level renderer classes. + */ +} + +#endif // TOPAZ_REN_TZ_REN_HPP \ No newline at end of file