Files
fs2open.github.com/code/graphics/paths/PathRenderer.cpp
T
asarium 16be3b7cc5 Add support for TrueType fonts
This allows to use standard TrueType Fonts for text rendering in FSO. It uses the NanoVG library which provides the ability of drawing 2D shapes. This library is used for most 2D operations now and can also be used directly by using the PathRenderer class.
2016-08-02 10:57:28 +02:00

33 lines
727 B
C++

#include "graphics/paths/PathRenderer.h"
#include "graphics/paths/NVGRenderer.h"
#include "graphics/paths/StubRenderer.h"
#include "graphics/2d.h"
namespace graphics
{
namespace paths
{
std::unique_ptr<PathRenderer> PathRenderer::s_instance;
bool PathRenderer::init()
{
if (gr_screen.mode == GR_OPENGL)
{
s_instance = std::unique_ptr<PathRenderer>(new NVGRenderer());
}
else
{
s_instance = std::unique_ptr<PathRenderer>(new StubRenderer());
}
return true;
}
void PathRenderer::shutdown()
{
s_instance = nullptr;
}
}
}