On the off-chance that someone has used directx 11...
# kotlin-native
j
On the off-chance that someone has used directx 11 with kotlin native and mingw for windows, can anyone spot any specific reason to why the following code would not run, given that the ID3D11Device is setup correctly:
Copy code
pacman -S mingw-w64-x86_64-headers-git

directx.def
=======================
package = directx
headers = windows.h windowsx.h stdint.h d3dcommon.h d3d11.h winuser.h dxgi.h
headerFilter = windows.h windowsx.h stdint.h d3dcommon.h d3d11.h winuser.h dxgi.h
libraryPaths = C:/msys64/mingw64/x86_64-w64-mingw32/lib C:/msys64/mingw64/lib
linkerOpts =  -LC:/msys64/mingw64/lib -LC:/msys64/mingw64/x86_64-w64-mingw32/lib -ldxguid -ld3d11 -ldxgi -lstdc++ -DUNICODE
compilerOpts = -LC:/msys64/mingw64/lib -LC:/msys64/mingw64/x86_64-w64-mingw32/lib -ldxguid -ld3d11 -ldxgi -lstdc++ -DUNICODE
---

Problematic code:
        val dxgiDevice: IDXGIDevice = alloc()
        println("Device instance: ${D3DDevice.ptr}")
        val vtable = D3DDevice.lpVtbl?.pointed
        println("Trying to make use of virtual table... P: $vtable")
        hr = vtable?.QueryInterface?.invoke(D3DDevice.ptr, IID_IDXGIDevice.ptr, dxgiDevice.ptr.pointed.reinterpret()) ?: 0
        println("3")
        if(FAILED(hr)){
            MessageBoxA(null ,"D3DDevice->QueryInterface failed", null, 0)
        }else{
            println("D3DDevice->QueryInterface success!")
        }
We never reach println("3"), and I'm not getting any exception reasons or missing imports