Page 1 of 1

Direct 3D

Posted: Sat May 31, 2003 4:17 am
by Codemonger
Someone had a example of Direct 3D (directx 8) a while back. I think it displayed 8000 cubes ?? anyway I thought it was amazingly fast rendering it on an old machine, and it would be great to get some example code online ... Just to get a head start on accessing DirectX 8. Purebasic is very fast ...

Posted: Sat May 31, 2003 8:27 am
by Thorsten

Posted: Sat May 31, 2003 3:28 pm
by Codemonger
I was hoping I wouldn't have to rewrite the wheel ... thanks for pointing out the post again. Anyway I'll start rewriting the headers, but whatever I come up with, I'll post the code online in progress, as I'm sure I'm not the only one trying to accomplish the same thing with Directx.

Thanks

Posted: Sun Jun 01, 2003 4:52 am
by Codemonger
Ok ... I just played around with PureBasic & PowerRender Trial ---- a directx 9 SDK -- it uses normal Dll's (as far as I know) ... anyway this is what I came up with so far --- creating a simple fullscreen window --- it does nothing at the moment ... but I'll play around tonight with it.

Anyway this is my first app in purebasic so don't make fun of my code please ...


Code: Select all

OpenLibrary(1, "PowerRender5Trial.dll") 

;**************************** Initialize ************************

CallFunction(1,"PR_Initialize",1500) 
CallFunction(1,"PR_DetectD3D") 
CallFunction(1,"PR_InitializeD3D") 

;***************************************************************

OpenWindow(1,100,150,450,200,#PB_Window_Invisible,"DirectX Test")
CallFunction(1,"PR_SetWindow",WindowID(1),0)
CallFunction(1,"PR_SetMode", 640, 480, 60)

  Repeat
      EventID=WaitWindowEvent()  
  Until EventID=#PB_EventCloseWindow

;************************ ShutDown ***************************

CallFunction(1,"PR_ShutDown")

;****************************************************************

CloseLibrary(1)

Posted: Sun Jun 01, 2003 7:05 am
by Codemonger
Uhmm ... I'm translating a huge amount of structures from Power Render to PureBasic ... anyway I need some help on this one ... it is pointing to a directx 9 structure (LPDIRECT3DINDEXBUFFER9).. I checked it out and the structure starts to get a little complex from here also what do I do with the:

void * next; ??

Code: Select all

typedef struct 
 {
  LPDIRECT3DINDEXBUFFER9  	ib;
  PR_DWORD 			NumVertices;
  PR_DWORD 			NumIndices;
  void *			next;
 } PR_LODVERTEXBUFFER;

if anyone can help thanks ..

Posted: Sun Jun 01, 2003 11:12 am
by Fred
void * can be converted to a .l in PB (or better: *next.l). I don't know if Traumatic want me to publish its D3D7 headers, as he already has doing a great job on it.. I will try to contact him.

Posted: Sun Jun 01, 2003 3:30 pm
by Codemonger
Thanks Fred ... the *next.l is very helpfull. I'm moving along very nice. I understand if Traumatic does not want to publish the headers yet, it's lots of hard work. In the meantime this is a really good way for me to get used of programming in purebasic. I've taken to it already :D

BTW I'm using the power render manual to get all the information on structures,variables,constants and stuff as opposed to using the header files... It makes it much easier, and it's much better organized.

Posted: Mon Jun 02, 2003 9:05 am
by Fred
I got the traumatic answer, and he's ok, I will put a link tonight. Better do this hardwork once :).

Posted: Mon Jun 02, 2003 3:58 pm
by traumatic
Fred wrote:I got the traumatic answer[...]
"traumatic answer"... lol :D
I hope reading the header isn't too traumatic...

Posted: Wed Jun 11, 2003 10:16 am
by benny
Ehm ... is the code already available ??? :roll:
Would be cool.

Regards, benny!

Posted: Tue Jun 24, 2003 5:14 pm
by benny
Any news concerning the source ???
:?: :?: :?:

Posted: Tue Jun 24, 2003 6:09 pm
by traumatic
get the conversion of d3d.h here http://files.connection-refused.org/d3d.h.pb
and d3dcaps.h.pb here: http://files.connection-refused.org/d3dcaps.h.pb

these are for version 7

Posted: Tue Jun 24, 2003 7:37 pm
by benny
Excellent,
thx a lot ! :D