home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / include / ddkernel.h < prev    next >
C/C++ Source or Header  |  1998-04-25  |  8KB  |  295 lines

  1. /*==========================================================================;
  2.  *
  3.  *  Copyright (C) 1997 Microsoft Corporation.  All Rights Reserved.
  4.  *
  5.  *  File:    ddkernel.h
  6.  *  Content:    APIs for accessing kernel mode support.
  7.  *
  8.  ***************************************************************************/
  9.  
  10. #ifndef __DDKM_INCLUDED__
  11. #define __DDKM_INCLUDED__
  12. #if defined( _WIN32 )  && !defined( _NO_COM )
  13. #define COM_NO_WINDOWS_H
  14. #include <objbase.h>
  15. #else
  16. #define IUnknown        void
  17. #undef  CO_E_NOTINITIALIZED
  18. #define CO_E_NOTINITIALIZED 0x800401F0L
  19. #endif
  20.  
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif
  24.  
  25. /*
  26.  * GUIDS used by to get kernel interfaces
  27.  */
  28. #if defined( _WIN32 ) && !defined( _NO_COM )
  29. DEFINE_GUID( IID_IDirectDrawKernel,             0x8D56C120,0x6A08,0x11D0,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8 );
  30. DEFINE_GUID( IID_IDirectDrawSurfaceKernel,      0x60755DA0,0x6A40,0x11D0,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8 );
  31.  
  32. #endif
  33.  
  34. /*============================================================================
  35.  *
  36.  * DirectDraw Structures
  37.  *
  38.  * Various structures used to invoke the kernel API functions.
  39.  *
  40.  *==========================================================================*/
  41.  
  42. typedef struct IDirectDrawKernel        FAR *LPDIRECTDRAWKERNEL;
  43. typedef struct IDirectDrawSurfaceKernel        FAR *LPDIRECTDRAWSURFACEKERNEL;
  44. typedef struct _DDKERNELCAPS            FAR *LPDDKERNELCAPS;
  45.  
  46.  
  47. /*
  48.  * INTERACES FOLLOW:
  49.  *    IDirectDrawKernel
  50.  *    IVideoPort
  51.  */
  52.  
  53. /*
  54.  * IDirectDrawKernel
  55.  */
  56. #if defined( _WIN32 ) && !defined( _NO_COM )
  57. #undef INTERFACE
  58. #define INTERFACE IDirectDrawKernel
  59. DECLARE_INTERFACE_( IDirectDrawKernel, IUnknown )
  60. {
  61.     /*** IUnknown methods ***/
  62.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
  63.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  64.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  65.     /*** IDirectDraw methods ***/
  66.     STDMETHOD(GetCaps)(THIS_ LPDDKERNELCAPS) PURE;
  67.     STDMETHOD(GetKernelHandle)(THIS_ LPDWORD) PURE;
  68.     STDMETHOD(ReleaseKernelHandle)(THIS) PURE;
  69. };
  70.  
  71. #if !defined(__cplusplus) || defined(CINTERFACE)
  72. #define IDirectDrawKernel_GetCaps(p, a)             (p)->lpVtbl->GetCaps(p, a)
  73. #define IDirectDrawKernel_GetKernelHandle(p, a)     (p)->lpVtbl->GetKernelHandle(p, a)
  74. #define IDirectDrawKernel_ReleaseKernelHandle(p)    (p)->lpVtbl->ReleaseKernelHandle(p)
  75. #endif
  76.  
  77. #endif
  78.  
  79. /*
  80.  * IDirectDrawSurfaceKernel
  81.  */
  82. #if defined( _WIN32 ) && !defined( _NO_COM )
  83. #undef INTERFACE
  84. #define INTERFACE IDirectDrawSurfaceKernel
  85. DECLARE_INTERFACE_( IDirectDrawSurfaceKernel, IUnknown )
  86. {
  87.     /*** IUnknown methods ***/
  88.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
  89.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  90.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  91.     /*** IDirectDraw methods ***/
  92.     STDMETHOD(GetKernelHandle)(THIS_ LPDWORD) PURE;
  93.     STDMETHOD(ReleaseKernelHandle)(THIS) PURE;
  94. };
  95.  
  96. #if !defined(__cplusplus) || defined(CINTERFACE)
  97. #define IDirectDrawSurfaceKernel_GetKernelHandle(p, a)     (p)->lpVtbl->GetKernelHandle(p, a)
  98. #define IDirectDrawSurfaceKernel_ReleaseKernelHandle(p)    (p)->lpVtbl->ReleaseKernelHandle(p)
  99. #endif
  100.  
  101. #endif
  102.  
  103.  
  104. /*
  105.  * DDKERNELCAPS
  106.  */
  107. typedef struct _DDKERNELCAPS
  108. {
  109.     DWORD dwSize;            // size of the DDKERNELCAPS structure
  110.     DWORD dwCaps;            // indicates which fields contain data
  111.     DWORD dwIRQCaps;            // max width of the video port field
  112. } DDKERNELCAPS, FAR *LPDDKERNELCAPS;
  113.  
  114.  
  115.  
  116. /****************************************************************************
  117.  *
  118.  * DDKERNELCAPS CAPS
  119.  *
  120.  ****************************************************************************/
  121.  
  122. /*
  123.  * Indicates that the device supports field skipping.
  124.  */
  125. #define DDKERNELCAPS_SKIPFIELDS            0x00000001l
  126.  
  127. /*
  128.  * Indicates that the device can support software autoflipping.
  129.  */
  130. #define DDKERNELCAPS_AUTOFLIP            0x00000002l
  131.  
  132. /*
  133.  * Indicates that the device can switch between bob and weave.
  134.  */
  135. #define DDKERNELCAPS_SETSTATE            0x00000004l
  136.  
  137. /*
  138.  * Indicates that a client can gain direct access to the frame buffer.
  139.  */
  140. #define DDKERNELCAPS_LOCK            0x00000008l
  141.  
  142. /*
  143.  * Indicates that a client can manually flip the video port.
  144.  */
  145. #define DDKERNELCAPS_FLIPVIDEOPORT        0x00000010l
  146.  
  147. /*
  148.  * Indicates that a client can manually flip the overlay.
  149.  */
  150. #define DDKERNELCAPS_FLIPOVERLAY        0x00000020l
  151.  
  152. /*
  153.  * Indicates that the device supports a fast, asynchronous transfer
  154.  * mechanism to system memory.
  155.  */
  156. #define DDKERNELCAPS_TRANSFER_SYSMEM        0x00000040l
  157.  
  158. /*
  159.  * Indicates that the device supports a fast, asynchronous transfer
  160.  * mechanism via AGP.
  161.  */
  162. #define DDKERNELCAPS_TRANSFER_AGP        0x00000080l
  163.  
  164. /*
  165.  * Indicates that the device can report the polarity (even/odd) of
  166.  * the curent video field.
  167.  */
  168. #define DDKERNELCAPS_FIELDPOLARITY        0x00000100l
  169.  
  170. /****************************************************************************
  171.  *
  172.  * DDKERNELCAPS IRQ CAPS
  173.  *
  174.  ****************************************************************************/
  175.  
  176. /*
  177.  * The device can generate display VSYNC IRQs
  178.  */
  179. #define DDIRQ_DISPLAY_VSYNC            0x00000001l
  180.  
  181. /*
  182.  * Reserved
  183.  */
  184. #define DDIRQ_RESERVED1                0x00000002l
  185.  
  186. /*
  187.  * The device can generate video ports VSYNC IRQs using video port 0
  188.  */
  189. #define DDIRQ_VPORT0_VSYNC            0x00000004l
  190.  
  191. /*
  192.  * The device can generate video ports line IRQs using video port 0
  193.  */
  194. #define DDIRQ_VPORT0_LINE            0x00000008l
  195.  
  196. /*
  197.  * The device can generate video ports VSYNC IRQs using video port 1
  198.  */
  199. #define DDIRQ_VPORT1_VSYNC            0x00000010l
  200.  
  201. /*
  202.  * The device can generate video ports line IRQs using video port 1
  203.  */
  204. #define DDIRQ_VPORT1_LINE            0x00000020l
  205.  
  206. /*
  207.  * The device can generate video ports VSYNC IRQs using video port 2
  208.  */
  209. #define DDIRQ_VPORT2_VSYNC            0x00000040l
  210.  
  211. /*
  212.  * The device can generate video ports line IRQs using video port 2
  213.  */
  214. #define DDIRQ_VPORT2_LINE            0x00000080l
  215.  
  216. /*
  217.  * The device can generate video ports VSYNC IRQs using video port 3
  218.  */
  219. #define DDIRQ_VPORT3_VSYNC            0x00000100l
  220.  
  221. /*
  222.  * The device can generate video ports line IRQs using video port 3
  223.  */
  224. #define DDIRQ_VPORT3_LINE            0x00000200l
  225.  
  226. /*
  227.  * The device can generate video ports VSYNC IRQs using video port 4
  228.  */
  229. #define DDIRQ_VPORT4_VSYNC            0x00000400l
  230.  
  231. /*
  232.  * The device can generate video ports line IRQs using video port 4
  233.  */
  234. #define DDIRQ_VPORT4_LINE            0x00000800l
  235.  
  236. /*
  237.  * The device can generate video ports VSYNC IRQs using video port 5
  238.  */
  239. #define DDIRQ_VPORT5_VSYNC            0x00001000l
  240.  
  241. /*
  242.  * The device can generate video ports line IRQs using video port 5
  243.  */
  244. #define DDIRQ_VPORT5_LINE            0x00002000l
  245.  
  246. /*
  247.  * The device can generate video ports VSYNC IRQs using video port 6
  248.  */
  249. #define DDIRQ_VPORT6_VSYNC            0x00004000l
  250.  
  251. /*
  252.  * The device can generate video ports line IRQs using video port 6
  253.  */
  254. #define DDIRQ_VPORT6_LINE            0x00008000l
  255.  
  256. /*
  257.  * The device can generate video ports VSYNC IRQs using video port 7
  258.  */
  259. #define DDIRQ_VPORT7_VSYNC            0x00010000l
  260.  
  261. /*
  262.  * The device can generate video ports line IRQs using video port 7
  263.  */
  264. #define DDIRQ_VPORT7_LINE            0x00020000l
  265.  
  266. /*
  267.  * The device can generate video ports VSYNC IRQs using video port 8
  268.  */
  269. #define DDIRQ_VPORT8_VSYNC            0x00040000l
  270.  
  271. /*
  272.  * The device can generate video ports line IRQs using video port 8
  273.  */
  274. #define DDIRQ_VPORT8_LINE            0x00080000l
  275.  
  276. /*
  277.  * The device can generate video ports VSYNC IRQs using video port 9
  278.  */
  279. #define DDIRQ_VPORT9_VSYNC            0x00010000l
  280.  
  281. /*
  282.  * The device can generate video ports line IRQs using video port 9
  283.  */
  284. #define DDIRQ_VPORT9_LINE            0x00020000l
  285.  
  286.  
  287.  
  288. #ifdef __cplusplus
  289. };
  290. #endif
  291.  
  292. #endif
  293.  
  294.  
  295.