2
0

SExposedVideoData.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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 SOpenGLFB
  57. {
  58. //! The EGLNativeWindowType object.
  59. void *Window;
  60. };
  61. struct SOGLESAndroid
  62. {
  63. //! The ANativeWindow object.
  64. void *Window;
  65. };
  66. union
  67. {
  68. SOpenGLWin32 OpenGLWin32;
  69. SOpenGLLinux OpenGLLinux;
  70. SOpenGLOSX OpenGLOSX;
  71. SOpenGLFB OpenGLFB;
  72. SOGLESAndroid OGLESAndroid;
  73. };
  74. };
  75. } // end namespace video
  76. } // end namespace irr