the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at main 49 lines 1.8 kB view raw
1#pragma once 2using namespace std; 3class XUI_FontData; 4class XUI_Font; 5 6// Define this to use this class as the XUI font renderer 7#define OVERRIDE_XUI_FONT_RENDERER 8 9//#define USE_SCALING_FONT 10 11class XUI_FontRenderer : public IXuiFontRenderer 12{ 13protected: 14 enum eFontData 15 { 16 eFontData_MIN = 0, 17 eFontData_Mojangles_7 = 0, 18 eFontData_Mojangles_11, 19 eFontData_MAX 20 }; 21 22 // The font data is the image and size/coords data 23 XUI_FontData *m_loadedFontData[eFontData_MAX]; 24 25 // The XUI_Font is a temporary instance that is around as long as XUI needs it, but does the actual rendering 26 // These can be chained 27 unordered_map<float, XUI_Font *> m_loadedFonts[eFontData_MAX]; 28 29public: 30 XUI_FontRenderer(); 31 32 // 4J - IXuiFontRenderer interface 33 virtual HRESULT STDMETHODCALLTYPE Init( float fDpi ); 34 virtual VOID STDMETHODCALLTYPE Term(); 35 virtual HRESULT STDMETHODCALLTYPE GetCaps( DWORD * pdwCaps ); 36 virtual HRESULT STDMETHODCALLTYPE CreateFont( const TypefaceDescriptor * pTypefaceDescriptor, 37 float fPointSize, DWORD dwStyle, DWORD dwReserved, HFONTOBJ * phFont ); 38 virtual VOID STDMETHODCALLTYPE ReleaseFont( HFONTOBJ hFont ); 39 virtual HRESULT STDMETHODCALLTYPE GetFontMetrics( HFONTOBJ hFont, XUIFontMetrics *pFontMetrics ); 40 virtual HRESULT STDMETHODCALLTYPE GetCharMetrics( HFONTOBJ hFont, WCHAR wch, 41 XUICharMetrics *pCharMetrics ); 42 virtual HRESULT STDMETHODCALLTYPE DrawCharToTexture( HFONTOBJ hFont, WCHAR wch, HXUIDC hDC, 43 IXuiTexture * pTexture, UINT x, UINT y, UINT width, UINT height, 44 UINT insetX, UINT insetY ); 45 virtual HRESULT STDMETHODCALLTYPE DrawCharsToDevice( HFONTOBJ hFont, CharData * pCharData, 46 DWORD dwCount, RECT *pClipRect, HXUIDC hDC, 47 D3DXMATRIX * pWorldViewProj ); 48 49};