SExposedVideoData.h 2.3 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. #ifndef S_EXPOSED_VIDEO_DATA_H_INCLUDED
  5. #define S_EXPOSED_VIDEO_DATA_H_INCLUDED
  6. // forward declarations for internal pointers
  7. struct IDirect3D9;
  8. struct IDirect3DDevice9;
  9. struct IDirect3D8;
  10. struct IDirect3DDevice8;
  11. namespace irr
  12. {
  13. namespace video
  14. {
  15. //! structure for holding data describing a driver and operating system specific data.
  16. /** This data can be retrieved by IVideoDriver::getExposedVideoData(). Use this with caution.
  17. This only should be used to make it possible to extend the engine easily without
  18. modification of its source. Note that this structure does not contain any valid data, if
  19. you are using the software or the null device.
  20. */
  21. struct SExposedVideoData
  22. {
  23. SExposedVideoData() {OpenGLWin32.HDc=0; OpenGLWin32.HRc=0; OpenGLWin32.HWnd=0;}
  24. explicit SExposedVideoData(void* Window) {OpenGLWin32.HDc=0; OpenGLWin32.HRc=0; OpenGLWin32.HWnd=Window;}
  25. struct SD3D9
  26. {
  27. //! Pointer to the IDirect3D9 interface
  28. IDirect3D9* D3D9;
  29. //! Pointer to the IDirect3DDevice9 interface
  30. IDirect3DDevice9* D3DDev9;
  31. //! Window handle.
  32. /** Get with for example HWND h = reinterpret_cast<HWND>(exposedData.D3D9.HWnd) */
  33. void* HWnd;
  34. };
  35. struct SOpenGLWin32
  36. {
  37. //! Private GDI Device Context.
  38. /** Get if for example with: HDC h = reinterpret_cast<HDC>(exposedData.OpenGLWin32.HDc) */
  39. void* HDc;
  40. //! Permanent Rendering Context.
  41. /** Get if for example with: HGLRC h = reinterpret_cast<HGLRC>(exposedData.OpenGLWin32.HRc) */
  42. void* HRc;
  43. //! Window handle.
  44. /** Get with for example with: HWND h = reinterpret_cast<HWND>(exposedData.OpenGLWin32.HWnd) */
  45. void* HWnd;
  46. };
  47. struct SOpenGLLinux
  48. {
  49. // XWindow handles
  50. void* X11Display;
  51. void* X11Context;
  52. unsigned long X11Window;
  53. unsigned long GLXWindow;
  54. };
  55. struct SOpenGLOSX
  56. {
  57. //! The NSOpenGLContext object.
  58. void* Context;
  59. //! The NSWindow object.
  60. void* Window;
  61. };
  62. union
  63. {
  64. SD3D9 D3D9;
  65. SOpenGLWin32 OpenGLWin32;
  66. SOpenGLLinux OpenGLLinux;
  67. SOpenGLOSX OpenGLOSX;
  68. };
  69. };
  70. } // end namespace video
  71. } // end namespace irr
  72. #endif