SIMPENGINE.H
Upload User: nthssl
Upload Date: 2022-04-05
Package Size: 25357k
Code Size: 1k
Category:

OpenCV

Development Platform:

Visual C++

  1. #ifndef __SIMPENGINE
  2. #define __SIMPENGINE
  3. #define WIN32_LEAN_AND_MEAN
  4. #define WIN32_EXTRA_LEAN
  5. #include <windows.h>
  6. #include <gl/gl.h>
  7. #include <gl/glu.h>
  8. #include "engine.h"
  9. #include "object.h"
  10. #include "camera.h"
  11. #include "terrain.h"
  12. #include "world.h"
  13. class CSimpEngine : public CEngine
  14. {
  15. private:
  16. CCamera *gameCamera;
  17. CWorld *gameWorld;
  18. protected:
  19. CCamera *OnGetCamera() { return gameCamera; }
  20. CWorld *OnGetWorld() { return gameWorld; }
  21. void OnPrepare();
  22. void OnMouseDownL(float x, float y);
  23. void OnMouseMove(int deltaX, int deltaY);
  24. void OnMouseMove(int x, int y, int centerX, int centerY);
  25. void OnKeyDown(int nVirtKey);
  26. public:
  27. CSimpEngine() 
  28. {
  29. gameCamera = new CCamera;
  30. gameWorld = new CWorld;
  31. }
  32. CSimpEngine(const char *szName, bool fscreen, int w, int h, int b) :
  33. CEngine(szName, fscreen, w, h, b) 
  34. {
  35. gameCamera = new CCamera;
  36. gameWorld = new CWorld(gameCamera);
  37. gameCamera->centerX = centerX;
  38. gameCamera->centerY = centerY;
  39. }
  40. ~CSimpEngine() 
  41. {
  42. delete gameWorld;
  43. delete gameCamera;
  44. gameWorld = NULL;
  45. gameCamera = NULL;
  46. }
  47. };
  48. #endif