From 631bb4d1ea2e708ff8692116b1736102126320fd Mon Sep 17 00:00:00 2001 From: Tony Theodore Date: Tue, 18 Dec 2012 00:34:53 +1100 Subject: package ftgl: add test program --- src/ftgl-test.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ src/ftgl.mk | 8 +++++++- 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 src/ftgl-test.c 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 + +#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 -- cgit v0.12