git.ucc.asn.au
/
ipdf
/
code.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of git.ucc.asn.au:ipdf/code
[ipdf/code.git]
/
src
/
screen.h
diff --git
a/src/screen.h
b/src/screen.h
index
e641826
..
66590e7
100644
(file)
--- a/
src/screen.h
+++ b/
src/screen.h
@@
-5,6
+5,8
@@
#include <functional>
#include <functional>
+#include "stb_truetype.h"
+
namespace IPDF
{
/*
namespace IPDF
{
/*
@@
-20,6
+22,9
@@
namespace IPDF
// Returns 'false' if the program should quit.
bool PumpEvents();
// Returns 'false' if the program should quit.
bool PumpEvents();
+ // Clears the screen to a given colour.
+ void Clear(float r=1.0, float g=1.0, float b=1.0, float a=1.0);
+
// Finishes rendering a frame, and presents it on the screen.
void Present();
// Finishes rendering a frame, and presents it on the screen.
void Present();
@@
-27,6
+32,12
@@
namespace IPDF
int ViewportWidth() const { return m_viewport_width; }
int ViewportHeight() const { return m_viewport_height; }
int ViewportWidth() const { return m_viewport_width; }
int ViewportHeight() const { return m_viewport_height; }
+ // Debug Font handling
+ void DebugFontInit(const char *font_name, float font_size = 12);
+ void DebugFontClear();
+ void DebugFontPrint(const char *str);
+ void DebugFontPrintF(const char *fmt, ...);
+
// Handle mouse input.
typedef std::function<void(int x, int y, int button, int wheel)> MouseHandler;
void SetMouseHandler(MouseHandler handler)
// Handle mouse input.
typedef std::function<void(int x, int y, int button, int wheel)> MouseHandler;
void SetMouseHandler(MouseHandler handler)
@@
-57,6
+68,11
@@
namespace IPDF
int m_viewport_height;
SDL_Window *m_window;
SDL_GLContext m_gl_context;
int m_viewport_height;
SDL_Window *m_window;
SDL_GLContext m_gl_context;
+ stbtt_bakedchar m_debug_font_rects[96];
+ unsigned int m_debug_font_atlas;
+ float m_debug_font_x;
+ float m_debug_font_y;
+ float m_debug_font_size;
};
}
};
}
UCC
git Repository :: git.ucc.asn.au