From 8eeeca422f86f40cdc660044dc5f1528ddd2af30 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Mon, 23 May 2011 07:15:09 +0000 Subject: [PATCH] test: add a debug quad test application. --- test/Makefile.am | 7 +++++- test/debug/quad.cpp | 56 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 test/debug/quad.cpp diff --git a/test/Makefile.am b/test/Makefile.am index 5d230494..748087d3 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -5,7 +5,7 @@ if USE_CPPUNIT cppunit_tests = lol-test endif -noinst_PROGRAMS = $(cppunit_tests) +noinst_PROGRAMS = quad $(cppunit_tests) TESTS = $(cppunit_tests) @@ -16,3 +16,8 @@ lol_test_LDADD = $(CPPUNIT_LIBS) lol_test_LDFLAGS = $(top_builddir)/src/liblol.a @LOL_LIBS@ @PIPI_LIBS@ lol_test_DEPENDENCIES = $(top_builddir)/src/liblol.a +quad_SOURCES = debug/quad.cpp +quad_CPPFLAGS = @LOL_CFLAGS@ @PIPI_CFLAGS@ +quad_LDFLAGS = $(top_builddir)/src/liblol.a @LOL_LIBS@ @PIPI_LIBS@ +quad_DEPENDENCIES = $(top_builddir)/src/liblol.a + diff --git a/test/debug/quad.cpp b/test/debug/quad.cpp new file mode 100644 index 00000000..79b917ff --- /dev/null +++ b/test/debug/quad.cpp @@ -0,0 +1,56 @@ +// +// Lol Engine - Debug Quad test program +// +// Copyright: (c) 2005-2011 Sam Hocevar +// This program is free software; you can redistribute it and/or +// modify it under the terms of the Do What The Fuck You Want To +// Public License, Version 2, as published by Sam Hocevar. See +// http://sam.zoy.org/projects/COPYING.WTFPL for more details. +// + +#if defined HAVE_CONFIG_H +# include "config.h" +#endif + +#include "core.h" +#include "lolgl.h" +#include "loldebug.h" + +using namespace std; +using namespace lol; + +#if defined __CELLOS_LV2__ +# include "ps3app.h" +#elif defined HAVE_GLES_2X +# include "eglapp.h" +#else +# include "sdlapp.h" +# include "sdlinput.h" +#endif + +#if defined _WIN32 +# undef main /* FIXME: still needed? */ +#endif + +int main(int argc, char **argv) +{ +#if defined __CELLOS_LV2__ + Ps3App app("Quad", vec2i(640, 480), 60.0f); +#elif defined HAVE_GLES_2X + EglApp app("Quad", vec2i(640, 480), 60.0f); +#else + SdlApp app("Quad", vec2i(640, 480), 60.0f); +#endif + + /* Register an input driver and some debug stuff */ +#if !defined HAVE_GLES_2X + new SdlInput(); +#endif + new DebugFps(20, 20); + new DebugQuad(); + + app.Run(); + + return EXIT_SUCCESS; +} +