mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-12-16 04:50:32 +00:00
Add FreeType, progress to title screen
This commit is contained in:
44
GpD3D/GpFontHandler_FreeType2.h
Normal file
44
GpD3D/GpFontHandler_FreeType2.h
Normal file
@@ -0,0 +1,44 @@
|
||||
#pragma once
|
||||
|
||||
#include "HostFontHandler.h"
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_SYSTEM_H
|
||||
#include FT_FREETYPE_H
|
||||
|
||||
namespace PortabilityLayer
|
||||
{
|
||||
class IOStream;
|
||||
class HostFont;
|
||||
}
|
||||
|
||||
class GpFontHandler_FreeType2 final : public PortabilityLayer::HostFontHandler
|
||||
{
|
||||
public:
|
||||
PortabilityLayer::HostFont *LoadFont(PortabilityLayer::IOStream *stream) override;
|
||||
void Shutdown() override;
|
||||
|
||||
static GpFontHandler_FreeType2 *Create();
|
||||
|
||||
private:
|
||||
GpFontHandler_FreeType2();
|
||||
~GpFontHandler_FreeType2();
|
||||
|
||||
static void *FTAllocThunk(FT_Memory memory, long size);
|
||||
static void FTFreeThunk(FT_Memory memory, void* block);
|
||||
static void *FTReallocThunk(FT_Memory memory, long curSize, long newSize, void *block);
|
||||
|
||||
static unsigned long FTStreamIo(FT_Stream stream, unsigned long offset, unsigned char* buffer, unsigned long count);
|
||||
static void FTStreamClose(FT_Stream stream);
|
||||
|
||||
void *FTAlloc(long size);
|
||||
void FTFree(void* block);
|
||||
void *FTRealloc(long curSize, long newSize, void *block);
|
||||
|
||||
bool Init();
|
||||
|
||||
FT_MemoryRec_ m_mem;
|
||||
FT_Library m_library;
|
||||
unsigned int m_currentSize;
|
||||
bool m_ftIsInitialized;
|
||||
};
|
||||
Reference in New Issue
Block a user