NativeWindowHeadless.cpp 942 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // Copyright (C) 2009-2023, 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]] const NativeWindowInitInfo& inf)
  31. {
  32. // Nothing
  33. return Error::kNone;
  34. }
  35. void NativeWindow::setWindowTitle([[maybe_unused]] CString title)
  36. {
  37. // Nothing
  38. }
  39. } // end namespace anki