mirror of https://git.wownero.com/dsc/mxe.git
package ftgl: add test program
This commit is contained in:
parent
dac194fe45
commit
631bb4d1ea
|
@ -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;
|
||||
}
|
||||
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue