CmApplication.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #pragma once
  2. #include "CmPrerequisites.h"
  3. #include "CmHighLevelGpuProgram.h"
  4. namespace CamelotEngine
  5. {
  6. class RenderWindow;
  7. class Viewport;
  8. class Camera;
  9. class HighLevelGpuProgramManager;
  10. }
  11. namespace CamelotEngine
  12. {
  13. class CM_EXPORT Application
  14. {
  15. public:
  16. Application();
  17. void startUp(const String& renderSystemDll, const String& rendererDll);
  18. void runMainLoop();
  19. void shutDown();
  20. UINT64 getAppWindowId();
  21. RenderWindowPtr getPrimaryRenderWindow() const { return mPrimaryRenderWindow; }
  22. // TODO: This is just for debug purposes. Normally I'd want to have one render context per scene view, not one global one
  23. DeferredRenderContextPtr getPrimaryRenderContext() const { return mPrimaryRenderContext; }
  24. /**
  25. * @brief Loads a plugin.
  26. *
  27. * @param pluginName Name of the plugin to load, without extension.
  28. */
  29. void loadPlugin(const String& pluginName);
  30. private:
  31. RenderWindowPtr mPrimaryRenderWindow;
  32. DeferredRenderContextPtr mPrimaryRenderContext;
  33. /**
  34. * @brief Callback called from the render thread in order to initialize resources.
  35. */
  36. void updateResourcesCallback();
  37. /**
  38. * @brief Runs the OS specific message pump.
  39. */
  40. void updateMessagePump();
  41. };
  42. CM_EXPORT Application& gApplication();
  43. }