Window.cpp 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /**
  2. * Copyright (c) 2006-2013 LOVE Development Team
  3. *
  4. * This software is provided 'as-is', without any express or implied
  5. * warranty. In no event will the authors be held liable for any damages
  6. * arising from the use of this software.
  7. *
  8. * Permission is granted to anyone to use this software for any purpose,
  9. * including commercial applications, and to alter it and redistribute it
  10. * freely, subject to the following restrictions:
  11. *
  12. * 1. The origin of this software must not be misrepresented; you must not
  13. * claim that you wrote the original software. If you use this software
  14. * in a product, an acknowledgment in the product documentation would be
  15. * appreciated but is not required.
  16. * 2. Altered source versions must be plainly marked as such, and must not be
  17. * misrepresented as being the original software.
  18. * 3. This notice may not be removed or altered from any source distribution.
  19. **/
  20. // LOVE
  21. #include "Window.h"
  22. namespace love
  23. {
  24. namespace window
  25. {
  26. Window *Window::singleton = NULL;
  27. Window::~Window()
  28. {
  29. if (singleton == this)
  30. singleton = NULL;
  31. }
  32. void Window::swapBuffers()
  33. {
  34. }
  35. WindowFlags::WindowFlags()
  36. : fullscreen(false)
  37. , fstype(Window::FULLSCREEN_TYPE_NORMAL)
  38. , vsync(true)
  39. , fsaa(0)
  40. , resizable(false)
  41. , minwidth(1)
  42. , minheight(1)
  43. , borderless(false)
  44. , centered(true)
  45. , display(0)
  46. {
  47. }
  48. bool Window::getConstant(const char *in, Window::FullscreenType &out)
  49. {
  50. return fullscreenTypes.find(in, out);
  51. }
  52. bool Window::getConstant(Window::FullscreenType in, const char *&out)
  53. {
  54. return fullscreenTypes.find(in, out);
  55. }
  56. StringMap<Window::FullscreenType, Window::FULLSCREEN_TYPE_MAX_ENUM>::Entry Window::fullscreenTypeEntries[] =
  57. {
  58. {"normal", Window::FULLSCREEN_TYPE_NORMAL},
  59. {"desktop", Window::FULLSCREEN_TYPE_DESKTOP},
  60. };
  61. StringMap<Window::FullscreenType, Window::FULLSCREEN_TYPE_MAX_ENUM> Window::fullscreenTypes(Window::fullscreenTypeEntries, sizeof(Window::fullscreenTypeEntries));
  62. } // window
  63. } // love