IDirect3DResource9 Interface

 

 

' ****************************************************************************************
' IDirect3DResource9 interface
' $IID_IDirect3DResource9 = GUID$("{05EEC05D-8F7D-4362-B999-D1BAF357C704}")
' ****************************************************************************************

' ****************************************************************************************
' Applications use the methods of the IDirect3DResource9 interface to query and prepare resources.
' Remarks
'    To create a texture resource, you can call one of the following methods.
'        * IDirect3DDevice9::CreateCubeTexture
'        * IDirect3DDevice9::CreateTexture
'        * IDirect3DDevice9::CreateVolumeTexture
'    To create a geometry-oriented resource, you can call one of the following methods.
'        * IDirect3DDevice9::CreateIndexBuffer
'        * IDirect3DDevice9::CreateVertexBuffer
' Interface Information
'    Stock Implementation   d3d9.dll
'    Custom Implementation  No
'    Inherits from  IUnknown
'    Header     d3d9.h
'    Import library     d3d9.lib
'    Minimum operating systems  Windows 98
' ****************************************************************************************

' ****************************************************************************************
'DECLARE_INTERFACE_(IDirect3DResource9, IUnknown)
'{
'    /*** IUnknown methods ***/
'  0.  STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE;
'  1.  STDMETHOD_(ULONG,AddRef)(THIS) PURE;
'  2.  STDMETHOD_(ULONG,Release)(THIS) PURE;

'    /*** IDirect3DResource9 methods ***/
'  3.  STDMETHOD(GetDevice)(THIS_ IDirect3DDevice9** ppDevice) PURE;
'  4.  STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) PURE;
'  5.  STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid,void* pData,DWORD* pSizeOfData) PURE;
'  6.  STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE;
'  7.  STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE;
'  8.  STDMETHOD_(DWORD, GetPriority)(THIS) PURE;
'  9.  STDMETHOD_(void, PreLoad)(THIS) PURE;
' 10.  STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS) PURE;
'};
' ****************************************************************************************

' ****************************************************************************************
' GetDevice method
' Retrieves the device associated with a resource.
' Note  Calling this method will increase the internal reference count on the
' IDirect3DDevice9 interface. Be sure to call IUnknown::Release when you are done using
' this IDirect3DDevice9 interface or you will have a memory leak.
' HRESULT GetDevice(
'   IDirect3DDevice9 ** ppDevice
' );
' ****************************************************************************************
FUNCTION IDirect3DResource9_GetDevice ALIAS "IDirect3DResource9_GetDevice" ( _
    BYVAL pthis AS DWORD PTR, BYREF ppDevice AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[3] USING IDirect3DResource9_GetDevice(pthis, ppDevice) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' SetPrivateData method
' Associates data with the resource that is intended for use by the application, not by
' Microsoft® Direct3D®. Data is passed by value, and multiple sets of data can be
' associated with a single resource.
' HRESULT SetPrivateData(
'   REFGUID refguid,
'   CONST void * pData,
'   DWORD SizeOfData,
'   DWORD Flags
' );
' ****************************************************************************************
FUNCTION IDirect3DResource9_SetPrivateData ALIAS "IDirect3DResource9_SetPrivateData" ( _
    BYVAL pthis AS DWORD PTR, BYREF refguid AS GUID, BYVAL pData AS DWORD, _
    BYVAL SizeOfData AS DWORD, BYVAL Flags AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[4] USING IDirect3DResource9_SetPrivateData(pthis, refguid, pData, SizeOfData, Flags) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' GetPrivateData method
' Copies the private data associated with the resource to a provided buffer.
' HRESULT GetPrivateData(
'   REFGUID refguid,
'   void * pData,
'   DWORD * pSizeOfData
' );
' ****************************************************************************************
FUNCTION IDirect3DResource9_GetPrivateData ALIAS "IDirect3DResource9_GetPrivateData" ( _
    BYVAL pthis AS DWORD PTR, BYREF refguid AS GUID, BYVAL pData AS DWORD, _
    BYREF pSizeOfData AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[5] USING IDirect3DResource9_GetPrivateData(pthis, refguid, pData, pSizeOfData) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' FreePrivateData method
' Frees the specified private data associated with this resource.
' HRESULT FreePrivateData(
'   REFGUID refguid
' );
' ****************************************************************************************
FUNCTION IDirect3DResource9_FreePrivateData ALIAS "IDirect3DResource9_FreePrivateData" ( _
    BYVAL pthis AS DWORD PTR, BYREF refguid AS GUID) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[6] USING IDirect3DResource9_FreePrivateData(pthis, refguid) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' SetPriority method
' Assigns the resource-management priority for this resource.
' DWORD SetPriority(
'   DWORD PriorityNew
' );
' ****************************************************************************************
FUNCTION IDirect3DResource9_SetPriority ALIAS "IDirect3DResource9_SetPriority" ( _
    BYVAL pthis AS DWORD PTR, BYVAL PriorityNew AS DWORD) EXPORT AS DWORD

    LOCAL DWRESULT AS DWORD
    IF pthis = %NULL THEN EXIT FUNCTION
    CALL DWORD @@pthis[7] USING IDirect3DResource9_SetPriority(pthis, PriorityNew) TO DWRESULT
    FUNCTION = DWRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' GetPriority method
' GetPriority method
' DWORD GetPriority();
' ****************************************************************************************
FUNCTION IDirect3DResource9_GetPriority ALIAS "IDirect3DResource9_GetPriority" (BYVAL pthis AS DWORD PTR) EXPORT AS DWORD

    LOCAL DWRESULT AS DWORD
    IF pthis = %NULL THEN EXIT FUNCTION
    CALL DWORD @@pthis[8] USING IDirect3DResource9_GetPriority(pthis) TO DWRESULT
    FUNCTION = DWRESULT

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' PreLoad method
' Preloads a managed resource.
' PreLoad();
' ****************************************************************************************
SUB IDirect3DResource9_PreLoad ALIAS "IDirect3DResource9_PreLoad" (BYVAL pthis AS DWORD PTR) EXPORT

    IF pthis = %NULL THEN EXIT SUB
    CALL DWORD @@pthis[9] USING IDirect3DResource9_PreLoad(pthis)

END SUB
' ****************************************************************************************

' ****************************************************************************************
' GetType method
' Returns the type of the resource.
' D3DRESOURCETYPE GetType();
' ****************************************************************************************
FUNCTION IDirect3DResource9_GetType ALIAS "IDirect3DResource9_GetType" (BYVAL pthis AS DWORD PTR) EXPORT AS DWORD

    LOCAL DWRESULT AS DWORD
    IF pthis = %NULL THEN EXIT FUNCTION
    CALL DWORD @@pthis[10] USING IDirect3DResource9_GetType(pthis) TO DWRESULT
    FUNCTION = DWRESULT

END FUNCTION
' ****************************************************************************************
 

 

Page last updated on Tuesday, 14 March 2006 19:58:20 +0100