source: trunk/test/xolotl/xolotl.cpp @ 1526

Last change on this file since 1526 was 1513, checked in by sam, 9 years ago

core: replace usage of sin() or std::sin() with lol::sin() where appropriate.

  • Property svn:keywords set to Id
File size: 1.4 KB
Line 
1//
2// Lol Engine - Xolotl algorithm test
3//
4// Copyright: (c) 2011 Soren Renner
5//            (c) 2011-2012 Sam Hocevar <sam@hocevar.net>
6//   This program is free software; you can redistribute it and/or
7//   modify it under the terms of the Do What The Fuck You Want To
8//   Public License, Version 2, as published by Sam Hocevar. See
9//   http://sam.zoy.org/projects/COPYING.WTFPL for more details.
10//
11
12#if defined HAVE_CONFIG_H
13#   include "config.h"
14#endif
15
16#include "core.h"
17#include "lolgl.h"
18#include "loldebug.h"
19
20using namespace lol;
21
22#if USE_SDL && defined __APPLE__
23#   include <SDL_main.h>
24#endif
25
26#if defined _WIN32
27#   undef main /* FIXME: still needed? */
28#endif
29
30#include "xolotl.h"
31
32class Xolotl : public WorldEntity
33{
34public:
35    Xolotl()
36    {
37        for(int i = 0; i < 2000; i++) {
38          float x = (i - 1000.0) / 100.0;
39          graph[i].x = x;
40          graph[i].y = lol::sin(x * 10.0) / (1.0 + x * x);
41        }
42    }
43
44    virtual ~Xolotl()
45    {
46
47    }
48
49    virtual char const *GetName() { return "Xolotl"; }
50
51    virtual void TickGame(float seconds)
52    {
53
54    }
55
56    virtual void TickDraw(float seconds)
57    {
58
59    }
60
61private:
62    vec2 graph[2000];
63};
64
65int main(int argc, char **argv)
66{
67    Application app("Xolotl", ivec2(640, 480), 60.0f);
68
69    /* Register some debug stuff */
70    new DebugFps(5, 5);
71
72    Cell<3> c;
73    app.Run();
74
75    return EXIT_SUCCESS;
76}
77
Note: See TracBrowser for help on using the repository browser.