source: trunk/test/benchsuite.cpp @ 1647

Last change on this file since 1647 was 1647, checked in by sam, 7 years ago

build: hide the SDL_main.h inclusion in core.h, and only activate it
on Windows if using Visual Studio; if using MinGW, try to stick to the
original main() entry point.

  • Property svn:keywords set to Id
File size: 1.9 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#include "core.h"
18
19using namespace std;
20using namespace lol;
21
22void bench_real(int mode);
23void bench_trig(int mode);
24void bench_matrix(int mode);
25void bench_half(int mode);
26
27int main(int argc, char **argv)
28{
29    Log::Info("-----------------------\n");
30    Log::Info(" High precision floats\n");
31    Log::Info("-----------------------\n");
32    bench_real(1);
33
34    Log::Info("--------------------------\n");
35    Log::Info(" Trigonometry [-1e5, 1e5]\n");
36    Log::Info("--------------------------\n");
37    bench_trig(1);
38
39    Log::Info("------------------------\n");
40    Log::Info(" Trigonometry [-pi, pi]\n");
41    Log::Info("------------------------\n");
42    bench_trig(2);
43
44    Log::Info("----------------------------\n");
45    Log::Info(" Trigonometry [-1e-2, 1e-2]\n");
46    Log::Info("----------------------------\n");
47    bench_trig(3);
48
49    Log::Info("----------------------------\n");
50    Log::Info(" Float matrices [-2.0, 2.0]\n");
51    Log::Info("----------------------------\n");
52    bench_matrix(1);
53
54    Log::Info("-------------------------------------\n");
55    Log::Info(" Half precision floats (random bits)\n");
56    Log::Info("-------------------------------------\n");
57    bench_half(1);
58
59    Log::Info("-----------------------------------\n");
60    Log::Info(" Half precision floats [-2.0, 2.0]\n");
61    Log::Info("-----------------------------------\n");
62    bench_half(2);
63
64#if defined _WIN32
65    getchar();
66#endif
67
68    return EXIT_SUCCESS;
69}
70
Note: See TracBrowser for help on using the repository browser.