PolycodePlayer.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /*
  2. * TauTestApp.h
  3. * tauTest
  4. *
  5. * Created by Ivan Safrin on 5/8/08.
  6. * Copyright 2008 __MyCompanyName__. All rights reserved.
  7. *
  8. */
  9. #pragma once
  10. #include <iostream>
  11. #include <fstream>
  12. #include "Polycode.h"
  13. #include "PolycodeLUA.h"
  14. #include "PolyGLSLShaderModule.h"
  15. extern "C" {
  16. #include <stdio.h>
  17. #include "lua.h"
  18. #include "lualib.h"
  19. #include "lauxlib.h"
  20. // #include "lapi.h"
  21. using namespace Polycode;
  22. class PolycodeDebugEvent : public Event {
  23. public:
  24. PolycodeDebugEvent();
  25. ~PolycodeDebugEvent();
  26. int lineNumber;
  27. String errorString;
  28. int xRes;
  29. int yRes;
  30. static const int EVENT_ERROR = 0;
  31. static const int EVENT_PRINT = 1;
  32. static const int EVENT_RESIZE = 2;
  33. static const int EVENT_REMOVE = 3;
  34. };
  35. class PolycodePlayer : public EventDispatcher {
  36. public:
  37. PolycodePlayer(String fileName, bool knownArchive);
  38. virtual ~PolycodePlayer();
  39. void runPlayer();
  40. void loadFile(const char *fileName);
  41. void runFile(String fileName);
  42. int report (lua_State *L, int status);
  43. void handleEvent(Event *event);
  44. bool Update();
  45. virtual void createCore() = 0;
  46. Core *getCore() { return core; }
  47. int xRes;
  48. int yRes;
  49. int aaLevel;
  50. bool fullScreen;
  51. int frameRate;
  52. void *windowData;
  53. bool doneLoading;
  54. Core *core;
  55. protected:
  56. lua_State *L;
  57. bool _knownArchive;
  58. String fileToRun;
  59. };
  60. }