SExposedVideoData.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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 retrived 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. union
  26. {
  27. struct
  28. {
  29. //! Pointer to the IDirect3D9 interface
  30. IDirect3D9* D3D9;
  31. //! Pointer to the IDirect3DDevice9 interface
  32. IDirect3DDevice9* D3DDev9;
  33. //! Window handle.
  34. /** Get with for example HWND h = reinterpret_cast<HWND>(exposedData.D3D9.HWnd) */
  35. void* HWnd;
  36. } D3D9;
  37. struct
  38. {
  39. //! Pointer to the IDirect3D8 interface
  40. IDirect3D8* D3D8;
  41. //! Pointer to the IDirect3DDevice8 interface
  42. IDirect3DDevice8* D3DDev8;
  43. //! Window handle.
  44. /** Get with for example with: HWND h = reinterpret_cast<HWND>(exposedData.D3D8.HWnd) */
  45. void* HWnd;
  46. } D3D8;
  47. struct
  48. {
  49. //! Private GDI Device Context.
  50. /** Get if for example with: HDC h = reinterpret_cast<HDC>(exposedData.OpenGLWin32.HDc) */
  51. void* HDc;
  52. //! Permanent Rendering Context.
  53. /** Get if for example with: HGLRC h = reinterpret_cast<HGLRC>(exposedData.OpenGLWin32.HRc) */
  54. void* HRc;
  55. //! Window handle.
  56. /** Get with for example with: HWND h = reinterpret_cast<HWND>(exposedData.OpenGLWin32.HWnd) */
  57. void* HWnd;
  58. } OpenGLWin32;
  59. struct
  60. {
  61. // XWindow handles
  62. void* X11Display;
  63. void* X11Context;
  64. unsigned long X11Window;
  65. } OpenGLLinux;
  66. };
  67. };
  68. } // end namespace video
  69. } // end namespace irr
  70. #endif