修复若干问题
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "render_3D/Datoviz_Visuals.h"
|
||||
|
||||
#include "render_3D/Scene_Context.hpp"
|
||||
#include <renderive/scene/Scene.hpp>
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "render_3D/Point_Demo.h"
|
||||
#include "render_3D/Point_Scene.h"
|
||||
|
||||
#include <renderive/scene/base/Scene_Base.hpp>
|
||||
|
||||
@@ -15,6 +15,26 @@
|
||||
namespace renderive::render_3d {
|
||||
namespace {
|
||||
|
||||
struct Test_Point_Scene {
|
||||
std::shared_ptr<Point_Visual> visual;
|
||||
std::unique_ptr<Point_Scene> scene;
|
||||
};
|
||||
|
||||
Test_Point_Scene make_test_scene(Scene_Options options) {
|
||||
std::vector<Point> points{
|
||||
{{-0.72F, -0.38F, 0.15F}, {245, 70, 78, 255}, 42.0F},
|
||||
{{0.00F, 0.48F, -0.05F}, {65, 220, 132, 255}, 48.0F},
|
||||
{{0.72F, 0.0F, 0.30F}, {75, 135, 255, 255}, 54.0F},
|
||||
{{-0.35F, 0.10F, -0.45F}, {250, 205, 75, 255}, 30.0F},
|
||||
{{0.38F, -0.12F, -0.25F}, {205, 95, 245, 255}, 34.0F},
|
||||
};
|
||||
Point_State state;
|
||||
state.style = {{12, 16, 24, 255}, 2.0F, Point_Aspect::Outline};
|
||||
auto visual = Point_Visual::Builder{state}.build(std::move(points));
|
||||
auto scene = std::make_unique<Point_Scene>(options, visual);
|
||||
return {std::move(visual), std::move(scene)};
|
||||
}
|
||||
|
||||
struct Event_Point {
|
||||
float x{};
|
||||
float y{};
|
||||
@@ -38,7 +58,7 @@ std::size_t colored_pixel_count(const Pixel_Frame& frame) {
|
||||
|
||||
TEST(PointRenderIntegration, RendersRealRgbaAndResizes) {
|
||||
try {
|
||||
auto demo = make_point_demo(Scene_Options{.viewport = {320, 200}});
|
||||
auto demo = make_test_scene(Scene_Options{.viewport = {320, 200}});
|
||||
ASSERT_TRUE(demo.scene->request_frame());
|
||||
auto first = demo.scene->latest_frame();
|
||||
ASSERT_NE(first, nullptr);
|
||||
@@ -60,7 +80,7 @@ TEST(PointRenderIntegration, RendersRealRgbaAndResizes) {
|
||||
|
||||
TEST(PointRenderIntegration, KernelEventsReachDatovizArcballOnItsDomain) {
|
||||
try {
|
||||
auto demo = make_point_demo(Scene_Options{.viewport = {320, 200}});
|
||||
auto demo = make_test_scene(Scene_Options{.viewport = {320, 200}});
|
||||
ASSERT_TRUE(demo.scene->request_frame());
|
||||
const auto before = demo.scene->latest_frame()->rgba8;
|
||||
|
||||
@@ -106,7 +126,7 @@ TEST(PointRenderIntegration, KernelEventsReachDatovizArcballOnItsDomain) {
|
||||
TEST(PointRenderIntegration,
|
||||
CapturesExternalGpuLifetimeAndSeparatedBackendPhases) {
|
||||
try {
|
||||
auto demo = make_point_demo(Scene_Options{.viewport = {320, 200}});
|
||||
auto demo = make_test_scene(Scene_Options{.viewport = {320, 200}});
|
||||
auto& kernel_scene = demo.scene->render_scene();
|
||||
const Capture_Session_Id capture = kernel_scene.capture_next_frame();
|
||||
ASSERT_TRUE(demo.scene->request_frame());
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "render_3D/detail/Point_Core.h"
|
||||
|
||||
#include <renderive/frame_control/Frame_Control.hpp>
|
||||
#include "render_3D/Scene_Context.hpp"
|
||||
#include <renderive/scene/Scene.hpp>
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
Reference in New Issue
Block a user