Clean up of scene nodes to support 2d and non int positioning.
This commit is contained in:
parent
1eeaebd0a9
commit
672b31b603
45 changed files with 341 additions and 200 deletions
|
@ -8,15 +8,15 @@ set(PLATFORM_UNIT_TEST_FILES
|
|||
)
|
||||
endif()
|
||||
|
||||
set(GRAPHICS_UNIT_TEST_FILES
|
||||
graphics/TestRasterizer.cpp
|
||||
${PLATFORM_UNIT_TEST_FILES}
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
|
||||
if(WIN32)
|
||||
|
||||
list(APPEND PLATFORM_UNIT_TEST_FILES
|
||||
graphics/TestD2DOffScreenRendering.cpp
|
||||
)
|
||||
set(GRAPHICS_UI_TEST_FILES
|
||||
graphics/TestDirectXRendering.cpp
|
||||
graphics/TestD2DRendering.cpp
|
||||
PARENT_SCOPE
|
||||
)
|
||||
endif()
|
||||
|
@ -29,4 +29,10 @@ set(GRAPHICS_UNIT_TEST_DEPENDENCIES
|
|||
set(GRAPHICS_UI_TEST_DEPENDENCIES
|
||||
graphics client
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
set(GRAPHICS_UNIT_TEST_FILES
|
||||
graphics/TestRasterizer.cpp
|
||||
${PLATFORM_UNIT_TEST_FILES}
|
||||
PARENT_SCOPE
|
||||
)
|
39
test/graphics/TestD2dOffScreenRendering.cpp
Normal file
39
test/graphics/TestD2dOffScreenRendering.cpp
Normal file
|
@ -0,0 +1,39 @@
|
|||
#include "TestCase.h"
|
||||
#include "TestCaseRunner.h"
|
||||
|
||||
#include "TestUiApplication.h"
|
||||
|
||||
#include "TestFramework.h"
|
||||
#include "TestUtils.h"
|
||||
|
||||
#include "DrawingSurface.h"
|
||||
#include "DrawingContext.h"
|
||||
#include "AbstractPainter.h"
|
||||
#include "Image.h"
|
||||
#include "PngWriter.h"
|
||||
|
||||
#include "RectangleNode.h"
|
||||
#include "Scene.h"
|
||||
|
||||
TEST_CASE(TestD2dOffScreenRendering, "graphics")
|
||||
{
|
||||
auto surface = std::make_unique<DrawingSurface>();
|
||||
surface->setSize(100, 100);
|
||||
|
||||
auto drawing_context = std::make_unique<DrawingContext>(surface.get());
|
||||
|
||||
auto rect = std::make_unique<RectangleNode>(DiscretePoint(10, 10), 10.0, 20.0);
|
||||
|
||||
auto scene = surface->getScene();
|
||||
|
||||
scene->addNode(rect.get());
|
||||
scene->update();
|
||||
|
||||
drawing_context->paint();
|
||||
|
||||
auto image = surface->getImage();
|
||||
|
||||
PngWriter writer;
|
||||
writer.setPath(TestUtils::getTestOutputDir(__FILE__) / "out.png");
|
||||
//writer.write(image);
|
||||
};
|
22
test/graphics/TestD2dRendering.cpp
Normal file
22
test/graphics/TestD2dRendering.cpp
Normal file
|
@ -0,0 +1,22 @@
|
|||
#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(TestD2dRendering, "graphics")
|
||||
{
|
||||
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue