How to Get Directx 9 Working in PB?
How to Get Directx 9 Working in PB?
Well im starting with DXPack and it's not working
Im just trying the example, "simple triangle" it staying there is no such function with "Direct3DCreate9_" even though I put the libaries in the correct place (\PureBasic\PureLibraries\Windows\Libraries)
i also comment out "IncludeFile "Data/D3D9Interface.pbi"" becasue the directx9 interfaces is in the res file now if i don't comment that it complains that those interfaces are already there.
Im just trying the example, "simple triangle" it staying there is no such function with "Direct3DCreate9_" even though I put the libaries in the correct place (\PureBasic\PureLibraries\Windows\Libraries)
i also comment out "IncludeFile "Data/D3D9Interface.pbi"" becasue the directx9 interfaces is in the res file now if i don't comment that it complains that those interfaces are already there.
~Dreglor
- Psychophanta
- Always Here

- Posts: 5153
- Joined: Wed Jun 11, 2003 9:33 pm
- Location: Anare
- Contact:
I have had no enough time to test with DXpack, but seems vsync interrupt is supported in DirectX9b, so i have big interest on it:
DdWaitForVerticalBlank:
The DdWaitForVerticalBlank callback function returns the vertical blank status of the device.
DdVideoPortWaitForSync:
The DdVideoPortWaitForSync callback function waits until the next vertical synch occurs.
Managed: Caps.VerticalBlankInterrupt Property;
But no more info I can find on internet.
And the Win DDK function:
DdVideoPortGetLine
The DdVideoPortGetLine callback function returns the current line number of the hardware video port.
Since i have no time, i hope you or other PB users cant try with DXPack and keep me informed.
DdWaitForVerticalBlank:
The DdWaitForVerticalBlank callback function returns the vertical blank status of the device.
DdVideoPortWaitForSync:
The DdVideoPortWaitForSync callback function waits until the next vertical synch occurs.
Managed: Caps.VerticalBlankInterrupt Property;
But no more info I can find on internet.
And the Win DDK function:
DdVideoPortGetLine
The DdVideoPortGetLine callback function returns the current line number of the hardware video port.
Since i have no time, i hope you or other PB users cant try with DXPack and keep me informed.
grr im very new at this.
i ran header converter on all of the headerfiles in the directx9 sdk
i don't need to worrie about interfaces becasuse those are already converted...
but i got a bunch of files with structures and constants in them
but the functions are what im stuck how do i use the libs aren't the functions defined in the header files in the directx9 sdk?
i ran header converter on all of the headerfiles in the directx9 sdk
i don't need to worrie about interfaces becasuse those are already converted...
but i got a bunch of files with structures and constants in them
but the functions are what im stuck how do i use the libs aren't the functions defined in the header files in the directx9 sdk?
~Dreglor
- Psychophanta
- Always Here

- Posts: 5153
- Joined: Wed Jun 11, 2003 9:33 pm
- Location: Anare
- Contact:
Re: How to Get Directx 9 Working in PB?
I had a short look into this: The actual PB-libraries are missing in the pack.Dreglor wrote:Im just trying the example, "simple triangle" it staying there is no such function with "Direct3DCreate9_" even though I put the libaries in the correct place (\PureBasic\PureLibraries\Windows\Libraries)
You should be able to create them using the DLLImporter on the *.pbl-files
located in /DX-Pack/DLLs and Libraries/recreate/.
Alternatively you can also call the function directly from d3d9.dll.
So for example replace this
Code: Select all
*D3D = Direct3DCreate9_(#D3D_SDK_VERSION)
Code: Select all
d3d9dll.l = OpenLibrary(#PB_Any, "d3d9.dll")
If d3d9dll
*F = IsFunction(d3d9dll, "Direct3DCreate9")
If *F
*D3D = CallFunctionFast(*F, #D3D_SDK_VERSION)
EndIf
Else
ProcedureReturn #false
EndIf
Good programmers don't comment their code. It was hard to write, should be hard to read.
The .lib are used at linking stage and could be necessary if you work with the .pbl.
Just use PB's DLL-Importer to generate the corresponding PB-libraries.
BTW: I looked at it again, one lib is called d3dx9d.lib. Note: This is the debug
version, the release-version is static and doesn't need the dll.
So, if you decide to use it, you should replace the lib with the release version
of it as no ordinary user has the d3dx9d.dll. The lib comes with the SDK.
Just use PB's DLL-Importer to generate the corresponding PB-libraries.
BTW: I looked at it again, one lib is called d3dx9d.lib. Note: This is the debug
version, the release-version is static and doesn't need the dll.
So, if you decide to use it, you should replace the lib with the release version
of it as no ordinary user has the d3dx9d.dll. The lib comes with the SDK.
Good programmers don't comment their code. It was hard to write, should be hard to read.
You can install DirectX from the /Redist/ directory, what other dlls do you need?Dreglor wrote:noticed that the directx sdk has no dlls in it
just libs
What's your problem exactly?Dreglor wrote: what im trying to figure out is how to define functions becasue i can't see much in the headers that point to such functions
Remember, DX is COM based. The necessary interfaces have already
been converted and come with every installation of PureBasic.
You already know how to initialize DX (see the DX-pack example).
This is the only 'real' function you have to call.
Good programmers don't comment their code. It was hard to write, should be hard to read.
That's because D3DX is a static library, if you want to use D3DX-functions dynamicallyDreglor wrote:yeah but for some reason the d3d.dll only has one function and the debug has a whole bunch more strange
also the vertex shader example in the dx pack requires the other dll
you have to use the debug version instead (see my other post). Understand D3DX
as an addon to D3D, written to make life easier. This has nothing do to with the core
functionality of D3D.
Good programmers don't comment their code. It was hard to write, should be hard to read.

