source: trunk/test/benchsuite.cpp @ 961

Last change on this file since 961 was 961, checked in by sam, 12 years ago

build: fix a shitload of build errors introduced by the Image refactoring
and the OS X port.

  • Property svn:keywords set to Id
File size: 1.7 KB
Line 
1//
2// Lol Engine - Benchmark program
3//
4// Copyright: (c) 2005-2011 Sam Hocevar <sam@hocevar.net>
5//   This program is free software; you can redistribute it and/or
6//   modify it under the terms of the Do What The Fuck You Want To
7//   Public License, Version 2, as published by Sam Hocevar. See
8//   http://sam.zoy.org/projects/COPYING.WTFPL for more details.
9//
10
11#if defined HAVE_CONFIG_H
12#   include "config.h"
13#endif
14
15#include <cstdio>
16
17#if USE_SDL && defined __APPLE__
18#   include <SDL_main.h>
19#endif
20
21#include "core.h"
22
23using namespace std;
24using namespace lol;
25
26void bench_trig(int mode);
27void bench_matrix(int mode);
28void bench_half(int mode);
29
30int main(int argc, char **argv)
31{
32    Log::Info("--------------------------\n");
33    Log::Info(" Trigonometry [-1e5, 1e5]\n");
34    Log::Info("--------------------------\n");
35    bench_trig(1);
36
37    Log::Info("------------------------\n");
38    Log::Info(" Trigonometry [-pi, pi]\n");
39    Log::Info("------------------------\n");
40    bench_trig(2);
41
42    Log::Info("----------------------------\n");
43    Log::Info(" Trigonometry [-1e-2, 1e-2]\n");
44    Log::Info("----------------------------\n");
45    bench_trig(3);
46
47    Log::Info("----------------------------\n");
48    Log::Info(" Float matrices [-2.0, 2.0]\n");
49    Log::Info("----------------------------\n");
50    bench_matrix(1);
51
52    Log::Info("-------------------------------------\n");
53    Log::Info(" Half precision floats (random bits)\n");
54    Log::Info("-------------------------------------\n");
55    bench_half(1);
56
57    Log::Info("-----------------------------------\n");
58    Log::Info(" Half precision floats [-2.0, 2.0]\n");
59    Log::Info("-----------------------------------\n");
60    bench_half(2);
61
62#if defined _WIN32
63    getchar();
64#endif
65
66    return EXIT_SUCCESS;
67}
68
Note: See TracBrowser for help on using the repository browser.