' ########################################################################################
' Microsoft Windows
' File: D3D10Misc.inc
' Contents: D3D10 Device Creation APIs
' Copyright (c) 2011 Jos? Roca
' Portions Copyright (c) Microsoft Corporation.
' All Rights Reserved.
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
' MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
' ########################################################################################
#IF NOT %DEF(PBX_d3d10misc_PBI)
#DEFINE PBX_d3d10misc_PBI
%EQUATE `D3D10MISC_INC = 1
#INCLUDE ONCE "Legacy/Graphics/D3D10.inc"
#INCLUDE ONCE "Legacy/Graphics/DXGI.inc"
'///////////////////////////////////////////////////////////////////////////
'// ID3D10Blob:
'// ------------
'// The buffer object is used by D3D10 to return arbitrary size data.
'//
'// GetBufferPointer -
'// Returns a pointer to the beginning of the buffer.
'//
'// GetBufferSize -
'// Returns the size of the buffer, in bytes.
'///////////////////////////////////////////////////////////////////////////
$IID_ID3D10Blob = GUID$("{8BA5FB08-5195-40E2-AC58-0D989C3A0102}")
INTERFACE ID3D10Blob $IID_ID3D10Blob
 INHERIT IUnknown
 ' =====================================================================================
 METHOD GetBufferPointer ( ' VTable offset = 12
 ) AS DWORD
 ' =====================================================================================
 METHOD GetBufferSize ( ' VTable offset = 16
 ) AS DWORD ' SIZE_T
 ' =====================================================================================
END INTERFACE
'///////////////////////////////////////////////////////////////////////////
'// D3D10_DRIVER_TYPE
'// ----------------
'//
'// This identifier is used to determine the implementation of Direct3D10
'// to be used.
'//
'// Pass one of these values to D3D10CreateDevice
'//
'///////////////////////////////////////////////////////////////////////////
' enum D3D10_DRIVER_TYPE
%EQUATE `D3D10_DRIVER_TYPE_HARDWARE = 0
%EQUATE `D3D10_DRIVER_TYPE_REFERENCE = 1
%EQUATE `D3D10_DRIVER_TYPE_NULL = 2
%EQUATE `D3D10_DRIVER_TYPE_SOFTWARE = 3
%EQUATE `D3D10_DRIVER_TYPE_WARP = 5
$GUID_DeviceType = GUID$("{D722FB4D-7A68-437A-B20C-5804EE2494A6}")
'///////////////////////////////////////////////////////////////////////////
'// D3D10CreateDevice
'// ------------------
'//
'// pAdapter
'// If NULL, D3D10CreateDevice will choose the primary adapter and
'// create a new instance from a temporarily created IDXGIFactory.
'// If non-NULL, D3D10CreateDevice will register the appropriate
'// device, if necessary (via IDXGIAdapter::RegisterDrver), before
'// creating the device.
'// DriverType
'// Specifies the driver type to be created: hardware, reference or
'// null.
'// Software
'// HMODULE of a DLL implementing a software rasterizer. Must be NULL for
'// non-Software driver types.
'// Flags
'// Any of those documented for D3D10CreateDevice.
'// SDKVersion
'// SDK version. Use the D3D10_SDK_VERSION macro.
'// ppDevice
'// Pointer to returned interface.
'//
'// Return Values
'// Any of those documented for
'// CreateDXGIFactory
'// IDXGIFactory::EnumAdapters
'// IDXGIAdapter::RegisterDriver
'// D3D10CreateDevice
'//
'///////////////////////////////////////////////////////////////////////////
DECLARE FUNCTION D3D10CreateDevice LIB "d3d10.dll" ALIAS "D3D10CreateDevice" ( BYVAL pAdapter AS IDXGIAdapter , BYVAL DriverType AS QUAD , BYVAL Software AS QUAD , BYVAL Flags AS QUAD , BYVAL SDKVersion AS QUAD , BYREF ppDevice AS ID3D10Device ) AS LONG
'///////////////////////////////////////////////////////////////////////////
'// D3D10CreateDeviceAndSwapChain
'// ------------------------------
'//
'// ppAdapter
'// If NULL, D3D10CreateDevice will choose the primary adapter and
'// create a new instance from a temporarily created IDXGIFactory.
'// If non-NULL, D3D10CreateDevice will register the appropriate
'// device, if necessary (via IDXGIAdapter::RegisterDrver), before
'// creating the device.
'// DriverType
'// Specifies the driver type to be created: hardware, reference or
'// null.
'// Software
'// HMODULE of a DLL implementing a software rasterizer. Must be NULL for
'// non-Software driver types.
'// Flags
'// Any of those documented for D3D10CreateDevice.
'// SDKVersion
'// SDK version. Use the D3D10_SDK_VERSION macro.
'// pSwapChainDesc
'// Swap chain description, may be NULL.
'// ppSwapChain
'// Pointer to returned interface. May be NULL.
'// ppDevice
'// Pointer to returned interface.
'//
'// Return Values
'// Any of those documented for
'// CreateDXGIFactory
'// IDXGIFactory::EnumAdapters
'// IDXGIAdapter::RegisterDriver
'// D3D10CreateDevice
'// IDXGIFactory::CreateSwapChain
'//
'///////////////////////////////////////////////////////////////////////////
DECLARE FUNCTION D3D10CreateDeviceAndSwapChain LIB "d3d10.dll" ALIAS "D3D10CreateDeviceAndSwapChain" ( BYVAL pAdapter AS IDXGIAdapter , BYVAL DriverType AS QUAD , BYVAL Software AS QUAD , BYVAL Flags AS QUAD , BYVAL SDKVersion AS QUAD , BYREF pSwapChainDesc AS DXGI_SWAP_CHAIN_DESC , BYREF ppSwapChain AS IDXGISwapChain , BYREF ppDevice AS ID3D10Device ) AS LONG
'///////////////////////////////////////////////////////////////////////////
'// D3D10CreateBlob:
'// -----------------
'// Creates a Buffer of n Bytes
'//////////////////////////////////////////////////////////////////////////
DECLARE FUNCTION D3D10CreateBlob LIB "d3d10.dll" ALIAS "D3D10CreateBlob" ( BYVAL NumBytes AS QUAD , BYREF ppBuffer AS ID3D10Blob ) AS LONG
#ENDIF
