projects
/
winnie
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added memory allocator
[winnie]
/
src
/
text.cc
diff --git
a/src/text.cc
b/src/text.cc
index
4068663
..
c58924f
100644
(file)
--- a/
src/text.cc
+++ b/
src/text.cc
@@
-2,6
+2,7
@@
#include <freetype/freetype.h>
#include "gfx.h"
#include <freetype/freetype.h>
#include "gfx.h"
+#include "shalloc.h"
#include "text.h"
#define DPI 72
#include "text.h"
#define DPI 72
@@
-21,7
+22,7
@@
static Text *text;
bool init_text()
{
bool init_text()
{
- if(!(text = (Text*)malloc(sizeof *text))) {
+ if(!(text = (Text*)sh_malloc(sizeof *text))) {
return false;
}
return false;
}
@@
-45,6
+46,11
@@
bool init_text()
return true;
}
return true;
}
+void destroy_text()
+{
+ sh_free(text);
+}
+
void draw_text(const char *txt, Pixmap *pixmap)
{
if(!pixmap) {
void draw_text(const char *txt, Pixmap *pixmap)
{
if(!pixmap) {