stuff-from-scratch/test/graphics/TestDirectXRendering.cpp
2023-12-27 12:20:02 +00:00

37 lines
No EOL
929 B
C++

#include "TestCase.h"
#include "TestCaseRunner.h"
#include "TestUiApplication.h"
#include "TestFramework.h"
#include "DesktopManager.h"
#include "MeshPrimitives.h"
#include "MeshNode.h"
#include "TextNode.h"
#include "Scene.h"
#include "Widget.h"
#include "Pointer.h"
#include "String.h"
#include <iostream>
TEST_CASE(TestDirectXRendering, "graphics")
{
auto gui_app = TestCaseRunner::getInstance().getTestApplication();
auto drawing_context = gui_app->getDesktopManager()->getWindowManager()->getMainWindow();
auto scene = drawing_context->getScene();
auto mesh = MeshPrimitives::buildRectangleAsTriMesh();
auto mesh_node = std::make_unique<MeshNode>(Transform(DiscretePoint(0, 0)));
mesh_node->setMesh(mesh.get());
scene->addNode(mesh_node.get());
auto text_node = std::make_unique<TextNode>("Test", Transform(DiscretePoint(100, 100)));
scene->addNode(text_node.get());
scene->update();
gui_app->run();
};