Direct 3D

Advanced game related topics
Codemonger
Enthusiast
Enthusiast
Posts: 384
Joined: Sat May 24, 2003 8:02 pm
Location: Canada
Contact:

Direct 3D

Post 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 ...
<br>"I deliver Justice, not Mercy"

    - Codemonger, 2004 A.D.
Thorsten
User
User
Posts: 28
Joined: Sun Apr 27, 2003 2:55 pm
Location: Germany
Contact:

Post by Thorsten »

Codemonger
Enthusiast
Enthusiast
Posts: 384
Joined: Sat May 24, 2003 8:02 pm
Location: Canada
Contact:

Post 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
<br>"I deliver Justice, not Mercy"

    - Codemonger, 2004 A.D.
Codemonger
Enthusiast
Enthusiast
Posts: 384
Joined: Sat May 24, 2003 8:02 pm
Location: Canada
Contact:

Post 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)
<br>"I deliver Justice, not Mercy"

    - Codemonger, 2004 A.D.
Codemonger
Enthusiast
Enthusiast
Posts: 384
Joined: Sat May 24, 2003 8:02 pm
Location: Canada
Contact:

Post 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 ..
<br>"I deliver Justice, not Mercy"

    - Codemonger, 2004 A.D.
Fred
Administrator
Administrator
Posts: 16621
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post 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.
Codemonger
Enthusiast
Enthusiast
Posts: 384
Joined: Sat May 24, 2003 8:02 pm
Location: Canada
Contact:

Post 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.
<br>"I deliver Justice, not Mercy"

    - Codemonger, 2004 A.D.
Fred
Administrator
Administrator
Posts: 16621
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

I got the traumatic answer, and he's ok, I will put a link tonight. Better do this hardwork once :).
traumatic
PureBasic Expert
PureBasic Expert
Posts: 1661
Joined: Sun Apr 27, 2003 4:41 pm
Location: Germany
Contact:

Post by traumatic »

Fred wrote:I got the traumatic answer[...]
"traumatic answer"... lol :D
I hope reading the header isn't too traumatic...
Good programmers don't comment their code. It was hard to write, should be hard to read.
benny
Enthusiast
Enthusiast
Posts: 465
Joined: Fri Apr 25, 2003 7:44 pm
Location: end of www
Contact:

Post by benny »

Ehm ... is the code already available ??? :roll:
Would be cool.

Regards, benny!
benny
Enthusiast
Enthusiast
Posts: 465
Joined: Fri Apr 25, 2003 7:44 pm
Location: end of www
Contact:

Post by benny »

Any news concerning the source ???
:?: :?: :?:
traumatic
PureBasic Expert
PureBasic Expert
Posts: 1661
Joined: Sun Apr 27, 2003 4:41 pm
Location: Germany
Contact:

Post 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
Good programmers don't comment their code. It was hard to write, should be hard to read.
benny
Enthusiast
Enthusiast
Posts: 465
Joined: Fri Apr 25, 2003 7:44 pm
Location: end of www
Contact:

Post by benny »

Excellent,
thx a lot ! :D
Post Reply