me.cpp 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. //
  4. //
  5. //////////////////////////////////////////////////////////////////////////////
  6. #include "pch.h"
  7. //////////////////////////////////////////////////////////////////////////////
  8. //
  9. // The main entry point
  10. //
  11. //////////////////////////////////////////////////////////////////////////////
  12. #include "main.h"
  13. //////////////////////////////////////////////////////////////////////////////
  14. //
  15. //
  16. //
  17. //////////////////////////////////////////////////////////////////////////////
  18. class MEWindow :
  19. public EngineWindow
  20. {
  21. public:
  22. //////////////////////////////////////////////////////////////////////////////
  23. //
  24. //
  25. //
  26. //////////////////////////////////////////////////////////////////////////////
  27. MEWindow(EngineApp* papp, const ZString& strCommandLine) :
  28. EngineWindow(
  29. papp,
  30. strCommandLine,
  31. "ME - The MDL Editor",
  32. false,
  33. WinRect(10, 10, 256, 256)
  34. )
  35. {
  36. SetImage(CreateColorImage(new ColorValue(Color::Black())));
  37. SetCursorImage(CreateCursor(GetEngine()));
  38. }
  39. void EvaluateFrame(Time ttime)
  40. {
  41. ::Sleep(1);
  42. }
  43. };
  44. //////////////////////////////////////////////////////////////////////////////
  45. //
  46. // ME Application
  47. //
  48. //////////////////////////////////////////////////////////////////////////////
  49. class ME : public EngineApp {
  50. protected:
  51. TRef<MEWindow> m_pwindow;
  52. public:
  53. HRESULT Initialize(const ZString& strCommandLine)
  54. {
  55. EngineApp::Initialize(strCommandLine);
  56. m_pwindow = new MEWindow(this, strCommandLine);
  57. return S_OK;
  58. }
  59. void Terminate()
  60. {
  61. m_pwindow = NULL;
  62. EngineApp::Terminate();
  63. }
  64. } g_app;