NativeWindowHeadless.cpp 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // Copyright (C) 2009-present, Panagiotis Christopoulos Charitos and contributors.
  2. // All rights reserved.
  3. // Code licensed under the BSD License.
  4. // http://www.anki3d.org/LICENSE
  5. #include <AnKi/Window/NativeWindowHeadless.h>
  6. namespace anki {
  7. template<>
  8. template<>
  9. NativeWindow& MakeSingletonPtr<NativeWindow>::allocateSingleton<>()
  10. {
  11. ANKI_ASSERT(m_global == nullptr);
  12. m_global = new NativeWindowHeadless();
  13. #if ANKI_ASSERTIONS_ENABLED
  14. ++g_singletonsAllocated;
  15. #endif
  16. return *m_global;
  17. }
  18. template<>
  19. void MakeSingletonPtr<NativeWindow>::freeSingleton()
  20. {
  21. if(m_global)
  22. {
  23. delete static_cast<NativeWindowHeadless*>(m_global);
  24. m_global = nullptr;
  25. #if ANKI_ASSERTIONS_ENABLED
  26. --g_singletonsAllocated;
  27. #endif
  28. }
  29. }
  30. Error NativeWindow::init([[maybe_unused]] U32 targetFps, [[maybe_unused]] CString title)
  31. {
  32. // Nothing important
  33. m_width = g_cvarWindowWidth;
  34. m_height = g_cvarWindowHeight;
  35. return Error::kNone;
  36. }
  37. void NativeWindow::setWindowTitle([[maybe_unused]] CString title)
  38. {
  39. // Nothing
  40. }
  41. } // end namespace anki