Need help with B3Ds Internal Works...

Blitz3D Forums/Blitz3D Programming/Need help with B3Ds Internal Works...

Guy Fawkes(Posted 2009) [#1]
Hi all! :)

I need some information regarding the internal workings of Blitz3D. You see, I'm creating a user library for Blitz3D that is intended to replace a large feature set of Blitz3D. I need to basically have full control over the main Blitz3D window's HWND, OR I need to replace the Blitz3D window with my own window, without B3D being able to tell the difference.

The main concern for this is getting input (ex: KeyHit, WaitKey, etc) to be able to work on my window. Currently, they don't work.

In addition, I need to know what the Blitz3D's main window procedure ("Blitz Runtime Class" class) does. Or, if its possible, to handle direct input and direct sound (assuming those are the technologies used) directly, but still retaining the original command set.

Thanks all! :)

~SI~


Warner(Posted 2009) [#2]
The HWND of the window can be found with this:
Print SystemProperty$("apphwnd")

To be able to replace the window of blitz3d, you could best use Blitz3DSDK, since it was intended for that purpose. A Blitz3D window is a common Windows window, with a DirectX7 device on it.

For the keyboard input, I don't know, but perhaps a quick fix could be using api_keybd_event to simulate keypresses. Also, you could look into events, so your blitz3d program could emit events and send them to another window.

There used to be a hack around that prevented Blitz3D from creating a window, but last time I tried, it didn't work anymore. (v1.98) It should however work with a previous version of b3d.

If you write a .dll with another language, you can send the Direct3D device to the DLL with this value:
SystemProperty$("Direct3DDevice7")

In your .dll, you can declare this variable as a IDirect3DDevice7, and you can access it directly. Assuming the other language has DX7 libraries installed.

These were all things that I didn't really got into, so I can't really help further, but hopefully they provide some handles to work with.


Guy Fawkes(Posted 2009) [#3]
Thanks, Warner! :)


_PJ_(Posted 2009) [#4]
There's some quite comprehensive api dlls that refer a lot to HWND's and windows.. not something I have spent too much time with either, but here's a start:

http://www.blitzbasic.com/codearcs/codearcs.php?code=1179