stuff-from-scratch/test/graphics/TestDirectXRendering.cpp
2023-01-11 14:31:29 +00:00

37 lines
No EOL
902 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 <memory>
#include <string>
#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>(DiscretePoint(0, 0));
mesh_node->setMesh(mesh.get());
scene->addNode(mesh_node.get());
auto text_node = std::make_unique<TextNode>("Test", DiscretePoint(100, 100));
scene->addNode(text_node.get());
scene->update();
gui_app->run();
};