Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 16044

Vb6 - how start using Directx9?

$
0
0
i'm starting using Directx 9 on VB6.
maybe it's the tlb file... but i don't know.
see the actual code just for Directx9 initialization:
Code:

Option Explicit
Dim pD3D As Direct3D9
Dim pd3dDevice As Direct3DDevice9
Dim d3dpp As D3DPRESENT_PARAMETERS

Private Sub Form_Load()
'Set pd3dDevice = New Direct3DDevice9
'Set pD3D = New Direct3D9
'both previous lines give me an error...

    d3dpp.Windowed = True
    d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD
    d3dpp.BackBufferFormat = D3DFMT_UNKNOWN
    d3dpp.BackBufferCount = 1
    d3dpp.BackBufferHeight = 480
    d3dpp.BackBufferWidth = 640
    d3dpp.hDeviceWindow = Me.hWnd

    'next line is give me an  error on compilation:
    If (pd3dDevice = pD3D.CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_REF, Me.hWnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, d3dpp) = 0) Then MsgBox "error"
End Sub

error message: "compiler Error: Method or data member not found"
when i do 'pD3D.' the 'CreateDevice' is showed on list...
so what i'm doing wrong? it's the library or dll or otherthing?

Viewing all articles
Browse latest Browse all 16044

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>