summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTony Theodore <tonyt@logyst.com>2012-12-17 13:34:53 (GMT)
committerTony Theodore <tonyt@logyst.com>2012-12-17 13:34:53 (GMT)
commit631bb4d1ea2e708ff8692116b1736102126320fd (patch)
tree496b61f967128bdd1817220a59c2915b4a8624a3
parentdac194fe45a18703b22ff1429c03703c7602e96e (diff)
downloadmxe-631bb4d1ea2e708ff8692116b1736102126320fd.zip
mxe-631bb4d1ea2e708ff8692116b1736102126320fd.tar.gz
mxe-631bb4d1ea2e708ff8692116b1736102126320fd.tar.bz2
package ftgl: add test program
-rw-r--r--src/ftgl-test.c44
-rw-r--r--src/ftgl.mk8
2 files changed, 51 insertions, 1 deletions
diff --git a/src/ftgl-test.c b/src/ftgl-test.c
new file mode 100644
index 0000000..eda4db8
--- /dev/null
+++ b/src/ftgl-test.c
@@ -0,0 +1,44 @@
+/*
+ * This file is part of MXE.
+ * See index.html for further information.
+ *
+ * This is a modified version of:
+ * test/CTest.c
+ */
+
+
+#include <FTGL/ftgl.h>
+
+#define ALLOC(ctor, var, arg) \
+ var = ctor(arg); \
+ if(var == NULL) \
+ return 2
+
+int main(int argc, char *argv[])
+{
+ FTGLfont *f[6];
+ (void)argc;
+ int i;
+
+ ALLOC(ftglCreateBitmapFont, f[0], argv[1]);
+ ALLOC(ftglCreateExtrudeFont, f[1], argv[1]);
+ ALLOC(ftglCreateOutlineFont, f[2], argv[1]);
+ ALLOC(ftglCreatePixmapFont, f[3], argv[1]);
+ ALLOC(ftglCreatePolygonFont, f[4], argv[1]);
+ ALLOC(ftglCreateTextureFont, f[5], argv[1]);
+
+ for(i = 0; i < 6; i++)
+ ftglRenderFont(f[i], "Hello world", FTGL_RENDER_ALL);
+
+ for(i = 0; i < 6; i++)
+ ftglSetFontFaceSize(f[i], 37, 72);
+
+ for(i = 0; i < 6; i++)
+ ftglRenderFont(f[i], "Hello world", FTGL_RENDER_ALL);
+
+ for(i = 0; i < 6; i++)
+ ftglDestroyFont(f[i]);
+
+ return 0;
+}
+
diff --git a/src/ftgl.mk b/src/ftgl.mk
index 07efcab..3854659 100644
--- a/src/ftgl.mk
+++ b/src/ftgl.mk
@@ -7,7 +7,7 @@ $(PKG)_CHECKSUM := 8508f26c84001d7bc949246affa03744fa1fd22e
$(PKG)_SUBDIR := $(PKG)-$($(PKG)_VERSION)
$(PKG)_FILE := $(PKG)-$(subst ~,-,$($(PKG)_VERSION)).tar.bz2
$(PKG)_URL := http://$(SOURCEFORGE_MIRROR)/project/$(PKG)/FTGL Source/$($(PKG)_VERSION)/$($(PKG)_FILE)
-$(PKG)_DEPS := gcc freetype
+$(PKG)_DEPS := gcc freeglut freetype
define $(PKG)_UPDATE
$(WGET) -q -O- 'http://sourceforge.net/projects/ftgl/files/FTGL Source/' | \
@@ -29,4 +29,10 @@ define $(PKG)_BUILD
--with-ft-prefix='$(PREFIX)/$(TARGET)'
$(MAKE) -C '$(1)/src' -j '$(JOBS)' bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS=
$(MAKE) -C '$(1)/src' -j 1 install bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS=
+
+ '$(TARGET)-gcc' \
+ -W -Wall -Werror -ansi \
+ '$(2).c' -o '$(PREFIX)/$(TARGET)/bin/test-$(PKG).exe' \
+ -lftgl -lm -lstdc++ \
+ `'$(TARGET)-pkg-config' freetype2 gl glu --cflags --libs --static`
endef