load the font
This commit is contained in:
parent
d9a3a6cb5a
commit
23ae0898e6
@ -5,6 +5,7 @@
|
||||
#include <iostream>
|
||||
#include "TextShader.h"
|
||||
#include "RectShader.h"
|
||||
#include "Font.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
@ -12,6 +13,7 @@ std::shared_ptr<TextShader> text_shader;
|
||||
std::shared_ptr<RectShader> rect_shader;
|
||||
std::shared_ptr<glcxx::Array> rect_array;
|
||||
std::shared_ptr<glcxx::Buffer> rect_buffer;
|
||||
Font font;
|
||||
|
||||
#define WIDTH 800
|
||||
#define HEIGHT 800
|
||||
@ -124,6 +126,12 @@ int main(int argc, char *argv[])
|
||||
return 2;
|
||||
}
|
||||
|
||||
if (!font.load(argv[1], HEIGHT / 10))
|
||||
{
|
||||
fprintf(stderr, "Error loading font from %s\n", argv[1]);
|
||||
return 2;
|
||||
}
|
||||
|
||||
UpdateEvent.type = SDL_USEREVENT;
|
||||
UpdateEvent.user.code = 0;
|
||||
SDL_AddTimer(25, UpdateCallback, NULL);
|
||||
|
Loading…
x
Reference in New Issue
Block a user