mirror of
https://github.com/scp-fs2open/fs2open.github.com.git
synced 2026-11-10 04:31:34 -10:00
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.
33 lines
727 B
C++
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;
|
|
}
|
|
}
|
|
} |