2
0

SExposedVideoData.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. // Copyright (C) 2002-2012 Nikolaus Gebhardt
  2. // This file is part of the "Irrlicht Engine".
  3. // For conditions of distribution and use, see copyright notice in irrlicht.h
  4. #pragma once
  5. namespace irr
  6. {
  7. namespace video
  8. {
  9. //! structure for holding data describing a driver and operating system specific data.
  10. /** This data can be retrieved by IVideoDriver::getExposedVideoData(). Use this with caution.
  11. This only should be used to make it possible to extend the engine easily without
  12. modification of its source. Note that this structure does not contain any valid data, if
  13. you are using the software or the null device.
  14. */
  15. struct SExposedVideoData
  16. {
  17. SExposedVideoData()
  18. {
  19. OpenGLWin32.HDc = 0;
  20. OpenGLWin32.HRc = 0;
  21. OpenGLWin32.HWnd = 0;
  22. }
  23. explicit SExposedVideoData(void *Window)
  24. {
  25. OpenGLWin32.HDc = 0;
  26. OpenGLWin32.HRc = 0;
  27. OpenGLWin32.HWnd = Window;
  28. }
  29. struct SOpenGLWin32
  30. {
  31. //! Private GDI Device Context.
  32. /** Get if for example with: HDC h = reinterpret_cast<HDC>(exposedData.OpenGLWin32.HDc) */
  33. void *HDc;
  34. //! Permanent Rendering Context.
  35. /** Get if for example with: HGLRC h = reinterpret_cast<HGLRC>(exposedData.OpenGLWin32.HRc) */
  36. void *HRc;
  37. //! Window handle.
  38. /** Get with for example with: HWND h = reinterpret_cast<HWND>(exposedData.OpenGLWin32.HWnd) */
  39. void *HWnd;
  40. };
  41. struct SOpenGLLinux
  42. {
  43. // XWindow handles
  44. void *X11Display;
  45. void *X11Context;
  46. unsigned long X11Window;
  47. unsigned long GLXWindow;
  48. };
  49. struct SOpenGLOSX
  50. {
  51. //! The NSOpenGLContext object.
  52. void *Context;
  53. //! The NSWindow object.
  54. void *Window;
  55. };
  56. struct SOGLESAndroid
  57. {
  58. //! The ANativeWindow object.
  59. void *Window;
  60. };
  61. union
  62. {
  63. SOpenGLWin32 OpenGLWin32;
  64. SOpenGLLinux OpenGLLinux;
  65. SOpenGLOSX OpenGLOSX;
  66. SOGLESAndroid OGLESAndroid;
  67. };
  68. };
  69. } // end namespace video
  70. } // end namespace irr