Cleaning for opengl rendering prep.

This commit is contained in:
James Grogan 2022-11-14 11:19:51 +00:00
parent 402f381d10
commit 7c6a92f4ec
58 changed files with 570 additions and 533 deletions

View file

@ -1,43 +1,53 @@
#include "DrawingContext.h"
#include "INativeDrawingContext.h"
#include "AbstractGeometricItem.h"
#include "AbstractPainter.h"
#include "OpenGlPainter.h"
#include "RasterPainter.h"
#include "DrawingSurface.h"
#include "Scene.h"
#include "Grid.h"
#include "MeshBuilder.h"
#include "TriMesh.h"
std::unique_ptr<DrawingContext> DrawingContext::Create()
DrawingContext::DrawingContext(DrawingSurface* surface, DrawingMode requestedDrawingMode)
: mSurface(surface),
mDrawingMode(requestedDrawingMode),
mScene(std::make_unique<Scene>())
{
return std::make_unique<DrawingContext>();
if (mDrawingMode == DrawingMode::GRAPH)
{
mPainter = std::make_unique<OpenGlPainter>();
}
else
{
mPainter = std::make_unique<RasterPainter>();
}
}
void DrawingContext::setNativeContext(std::unique_ptr<INativeDrawingContext> context)
std::unique_ptr<DrawingContext> DrawingContext::Create(DrawingSurface* surface, DrawingMode requestedDrawingMode)
{
mNativeDrawingContext = std::move(context);
}
INativeDrawingContext* DrawingContext::getNativeContext()
{
return mNativeDrawingContext.get();
}
void DrawingContext::addDrawable(AbstractGeometricItemPtr item)
{
mItems.push_back(std::move(item));
}
unsigned DrawingContext::getNumItems() const
{
return mItems.size();
}
AbstractGeometricItem* DrawingContext::getDrawable(unsigned idx) const
{
return mItems[idx].get();
return std::make_unique<DrawingContext>(surface, requestedDrawingMode);
}
void DrawingContext::updateMesh()
{
}
Scene* DrawingContext::getScene() const
{
return mScene.get();
}
DrawingSurface* DrawingContext::getSurface() const
{
return mSurface;
}
void DrawingContext::paint()
{
}