Disperate

JoeLeovinci
10-06-2001, 04:15 AM
Hi. I'm new about Direct X.
Have download DirectX from microsoft site. Correct installation.
Found this VB code that's correctly compiled but initialisation of D3Ddevices does not work....
I'have a 3dvodoo on W95 system.
HELP ME

Public Function Initialise() As Boolean
On Error GoTo ErrHandler:
Me.Show '//Make sure our window is visible

Dim DispMode As D3DDISPLAYMODE '//Describes our Display Mode
Dim D3DWindow As D3DPRESENT_PARAMETERS '//Describes our Viewport

Set Dx = New DirectX8 '//Create our Master Object
Set D3D = Dx.Direct3DCreate() 'Make our Master Object create the Direct3D Interface

D3D.GetAdapterDisplayMode D3DADAPTER_DEFAULT, DispMode '//Retrieve the current display Mode

D3DWindow.Windowed = 1 '//Tell it we're using Windowed Mode
D3DWindow.SwapEffect = D3DSWAPEFFECT_COPY_VSYNC '//We'll refresh when the monitor does
D3DWindow.BackBufferFormat = DispMode.Format '//We'll use the format we just retrieved...

'//This line will be explained in detail in a minute...
Set D3DDevice = D3D.CreateDevice( _
D3DADAPTER_DEFAULT, _
D3DDEVTYPE_REF, _
frmMain.hWnd, _
D3DCREATE_SOFTWARE_VERTEXPROCESSING, _
D3DWindow)

Initialise = True '//We succeeded
Exit Function
ErrHandler:
'//We failed; for now we wont worry about why.
Initialise = False

End Function

Squirm
10-06-2001, 08:20 AM
What do you mean by 'does not work' ? Explain more please...

JoeLeovinci
10-06-2001, 10:41 AM
I have an automation error. It seems my graphic devices (standard and voodoo 3dfx 2) do not support directX... what can I do?

Thinker
10-06-2001, 10:51 AM
You either need to comment out the error handler or set your IDE to
break on all errors so that you can tell us on which line that the error
happens. Did you set a reference to the DirectX library?

I think therefore I am... sometimes right. images/icons/wink.gif

Squirm
10-07-2001, 11:12 AM
Well, Thinker, with DirectX, when things go wrong they REALLY go wrong. If the app has got as far as taking over the display device, and VB hits an error, you usually end up stuck with a black screen. I can tell this has happened because I can hear the error sound that VB makes, and so I know somethigns up. What I then do is press Crtl+Alt+Del and then select Explorer in the task manager. Windows attempts to close down windows, which brings you out of your blackness. All you need to do then is cancel the shutdown and then you have everything under control again.

As for your problem, I also get a lot of automation errors when working with DirectX 8. Because it is such a weird DX, very different to all the previous ones, I have simply given up on it and am using DX7 until DX9 becomes fully available (its in BETA now).

So, sorry, cant really help there. Automation errors are a pain.

JoeLeovinci
10-07-2001, 11:40 AM
So. To use direct X 7 just make the right reference in Vb project to the Direct7 DLL or have to dowload something other... ?

Squirm
10-07-2001, 11:45 AM
1) Yes, provided your PC has DirectX7 installed, it comes with the required VB stuff

.........(removed unnecessary stuff).........<P ID="edit"><FONT class="small"><EM>Edited by Thinker on 10/07/01 09:10 PM.</EM></FONT></P>

Neil_Knight
10-08-2001, 04:38 AM
What you might find is that your Graphics card doesnot support window mode. I have seen this happen before. If you try changing the settings to fullscreen and see if it works then.

Neil

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum