BsGLSupport.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. //__________________________ Banshee Project - A modern game development toolkit _________________________________//
  2. //_____________________________________ www.banshee-project.com __________________________________________________//
  3. //________________________ Copyright (c) 2014 Marko Pintera. All rights reserved. ________________________________//
  4. #pragma once
  5. #include "BsGLPrerequisites.h"
  6. #include "BsGLRenderSystem.h"
  7. #include "BsRenderWindow.h"
  8. namespace BansheeEngine
  9. {
  10. /**
  11. * @brief Helper class dealing mostly with platform specific OpenGL functionality,
  12. * initialization, extensions and window creation.
  13. */
  14. class BS_RSGL_EXPORT GLSupport
  15. {
  16. public:
  17. GLSupport() { }
  18. virtual ~GLSupport() { }
  19. /**
  20. * @brief Creates a new render window using the specified descriptor.
  21. *
  22. * @param desc Description of a render window to create.
  23. * @param parentWindow Optional parent window if the window shouldn't be a main window. First
  24. * created window cannot have a parent.
  25. *
  26. * @param Returns newly created window.
  27. */
  28. virtual RenderWindowPtr newWindow(RENDER_WINDOW_DESC& desc, RenderWindowPtr parentWindow) = 0;
  29. /**
  30. * @brief Called when OpenGL is being initialized.
  31. */
  32. virtual void start() = 0;
  33. /**
  34. * @brief Called when OpenGL is being shut down.
  35. */
  36. virtual void stop() = 0;
  37. /**
  38. * @brief Gets OpenGL vendor name.
  39. */
  40. const String& getGLVendor() const
  41. {
  42. return mVendor;
  43. }
  44. /**
  45. * @brief Gets OpenGL version string.
  46. */
  47. const String& getGLVersion() const
  48. {
  49. return mVersion;
  50. }
  51. /**
  52. * @brief Checks is the specified extension available.
  53. */
  54. virtual bool checkExtension(const String& ext) const;
  55. /**
  56. * @brief Gets an address of an OpenGL procedure with the specified name.
  57. */
  58. virtual void* getProcAddress(const String& procname) = 0;
  59. /**
  60. * @brief Initializes OpenGL extensions. Must be called after we have a valid and active
  61. * OpenGL context.
  62. */
  63. virtual void initializeExtensions();
  64. /**
  65. * @brief Gets a structure describing all available video modes.
  66. */
  67. virtual VideoModeInfoPtr getVideoModeInfo() const = 0;
  68. protected:
  69. Set<String> extensionList;
  70. String mVersion;
  71. String mVendor;
  72. };
  73. };