Last change
on this file since 1043 was
1043,
checked in by sam, 12 years ago
|
test: start writing tutorials and other shit.
|
-
Property svn:keywords set to
Id
|
File size:
1.3 KB
|
Line | |
---|
1 | // |
---|
2 | // Lol Engine - Xolotl algorithm test |
---|
3 | // |
---|
4 | // Copyright: (c) 2011 Soren Renner |
---|
5 | // (c) 2011 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 | |
---|
20 | using namespace std; |
---|
21 | using namespace lol; |
---|
22 | |
---|
23 | #if USE_SDL && defined __APPLE__ |
---|
24 | # include <SDL_main.h> |
---|
25 | #endif |
---|
26 | |
---|
27 | #if defined _WIN32 |
---|
28 | # undef main /* FIXME: still needed? */ |
---|
29 | #endif |
---|
30 | |
---|
31 | #include "xolotl.h" |
---|
32 | |
---|
33 | class Xolotl : public WorldEntity |
---|
34 | { |
---|
35 | public: |
---|
36 | Xolotl() |
---|
37 | { |
---|
38 | for(int i = 0; i < 2000; i++) { |
---|
39 | float x = (i - 1000.0) / 100.0; |
---|
40 | graph[i].x = x; |
---|
41 | graph[i].y = sin(x * 10.0) / (1.0 + x * x); |
---|
42 | } |
---|
43 | } |
---|
44 | |
---|
45 | virtual ~Xolotl() |
---|
46 | { |
---|
47 | |
---|
48 | } |
---|
49 | |
---|
50 | virtual char const *GetName() { return "Xolotl"; } |
---|
51 | |
---|
52 | virtual void TickGame(float deltams) |
---|
53 | { |
---|
54 | |
---|
55 | } |
---|
56 | |
---|
57 | virtual void TickDraw(float deltams) |
---|
58 | { |
---|
59 | |
---|
60 | } |
---|
61 | |
---|
62 | private: |
---|
63 | vec2 graph[2000]; |
---|
64 | }; |
---|
65 | |
---|
66 | int main() |
---|
67 | { |
---|
68 | Application app("Xolotl", ivec2(640, 480), 60.0f); |
---|
69 | |
---|
70 | /* Register some debug stuff */ |
---|
71 | new DebugFps(5, 5); |
---|
72 | |
---|
73 | Cell<3> c; |
---|
74 | app.Run(); |
---|
75 | |
---|
76 | return EXIT_SUCCESS; |
---|
77 | } |
---|
78 | |
---|
Note: See
TracBrowser
for help on using the repository browser.