0
Follow
0
View

How to use IDirect3D9 functions

dawokou 注册会员
2023-01-25 04:35

Found this blog that helped me get to this answer

#include 
#include 
#include 
#include 
#include 

LPDIRECT3D9       g_pDirect3D = NULL;
LPDIRECT3DDEVICE9 g_pDirect3D_Device = NULL;


int main(void)
{
    UINT x = 0; // Ordinal number that denotes the display adapter. 
    DWORD xWord = 0 ; 
    D3DADAPTER_IDENTIFIER9 pIdentifier ;
    g_pDirect3D = Direct3DCreate9(D3D_SDK_VERSION);

    HRESULT hResult = g_pDirect3D->GetAdapterIdentifier(x, xWord, &pIdentifier);
    
    if (hResult == D3D_OK)
        std::cout << "Successfully created DirectX handle " << std::endl;
    else 
        std::cout << "Failed to create DirectX handle" << std::endl;
    return 0;
}

Direct3DCreate9 creates a handle to call the functions from

About the Author

Question Info

Publish Time
2023-01-25 04:34
Update Time
2023-01-25 04:34