您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. #if defined HAVE_CONFIG_H
  12. # include "config.h"
  13. #endif
  14. #include "core.h"
  15. #include "lolgl.h"
  16. #include "loldebug.h"
  17. using namespace lol;
  18. #if USE_SDL && defined __APPLE__
  19. # include <SDL_main.h>
  20. #endif
  21. #if defined _WIN32
  22. # undef main /* FIXME: still needed? */
  23. #endif
  24. #include "xolotl.h"
  25. class Xolotl : public WorldEntity
  26. {
  27. public:
  28. Xolotl()
  29. {
  30. for(int i = 0; i < 2000; i++) {
  31. float x = (i - 1000.0) / 100.0;
  32. graph[i].x = x;
  33. graph[i].y = lol::sin(x * 10.0) / (1.0 + x * x);
  34. }
  35. }
  36. virtual ~Xolotl()
  37. {
  38. }
  39. virtual char const *GetName() { return "Xolotl"; }
  40. virtual void TickGame(float seconds)
  41. {
  42. }
  43. virtual void TickDraw(float seconds)
  44. {
  45. }
  46. private:
  47. vec2 graph[2000];
  48. };
  49. int main(int argc, char **argv)
  50. {
  51. Application app("Xolotl", ivec2(640, 480), 60.0f);
  52. /* Register some debug stuff */
  53. new DebugFps(5, 5);
  54. Cell<3> c;
  55. app.Run();
  56. return EXIT_SUCCESS;
  57. }