No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

xolotl.cpp 1.2 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. #include "xolotl.h"
  19. class Xolotl : public WorldEntity
  20. {
  21. public:
  22. Xolotl()
  23. {
  24. for(int i = 0; i < 2000; i++) {
  25. float x = (i - 1000.0) / 100.0;
  26. graph[i].x = x;
  27. graph[i].y = lol::sin(x * 10.0) / (1.0 + x * x);
  28. }
  29. }
  30. virtual ~Xolotl()
  31. {
  32. }
  33. virtual char const *GetName() { return "Xolotl"; }
  34. virtual void TickGame(float seconds)
  35. {
  36. }
  37. virtual void TickDraw(float seconds)
  38. {
  39. }
  40. private:
  41. vec2 graph[2000];
  42. };
  43. int main(int argc, char **argv)
  44. {
  45. Application app("Xolotl", ivec2(640, 480), 60.0f);
  46. /* Register some debug stuff */
  47. new DebugFps(5, 5);
  48. Cell<3> c;
  49. app.Run();
  50. return EXIT_SUCCESS;
  51. }