Sprites and so on rendered on a existing dx window?

Just starting out? Need help? Post your questions and find answers here.
knut1
New User
New User
Posts: 8
Joined: Fri Apr 03, 2009 7:22 pm

Sprites and so on rendered on a existing dx window?

Post by knut1 »

I have installed the subsystem for dx9 and have one important question.
Before i have to say i´m new on purebasic, but use some other languages.

My question.
Is it possible and how, to render all the dx9 sprites, all that , on an existing dx9 window?

FastImage could do that(is codet with purebasic).
There is a comman like Init() and the parameter is Getdevice([returns LPDIRECT3DDEVICE9 from the used 3d engine]

what can i do to do that too.

only one i have---- the command Getdevice() with the return "LPDIRECT3DDEVICE9"


and at last, hello @ all here...
Ollivier
Enthusiast
Enthusiast
Posts: 281
Joined: Mon Jul 23, 2007 8:30 pm
Location: FR

Post by Ollivier »

Knut1 wrote:on an existing dx9 window?
Welcome!

What do you want exactly? Do you want to merge draws created with PB in an other application?

Or do you want a short code to test sprites in PB?

Ollivier
knut1
New User
New User
Posts: 8
Joined: Fri Apr 03, 2009 7:22 pm

Post by knut1 »

i try to create a litte sprite engine myelf.for an existing 3d engine(dx9)

okay short....... i have to parameters of the engine for using with it.
One command return the window handle(hwnd) and one returns "LPDIRECT3DDEVICE9".

GetRenderWindow() - returns the hwnd
GetDevice() - returns "LPDIRECT3DDEVICE9" -thats what i have to use, but don´t know how....

how can i use that?
the way with handle(hwnd is not the best for me i heared)

have test this code but it was flickering.....
chanced the output to my window(hwnd) of course, and it draws in the borders of the window.not good.

Code: Select all

Structure DrawingInfoStruct
  Type.l
  Window.l
  DC.l
  ReleaseProcedure.l
  PixelBuffer.l
  Pitch.l
  Width.l
  Height.l
  Depth.l
EndStructure

Global DS.DrawingInfoStruct

Procedure ReleaseOutput()
  ReleaseDC_(DS\Window,DS\DC)
EndProcedure

Procedure hWndOutput(hWnd) ; returns the outputID for the declared window handle
  DS\Type=2
  DS\Window=hWnd
  DS\DC=GetWindowDC_(hWnd)
  DS\ReleaseProcedure=@ReleaseOutput()
  ProcedureReturn DS
EndProcedure

flags=#PB_Window_SystemMenu|#PB_Window_MinimizeGadget|#PB_Window_ScreenCentered

Knobhd.l=GetRenderWindow()

Repeat



StartDrawing(hWndOutput(Knobhd))
For r=40 To 1 Step -10
Circle(50,50,r,RGB(R*5,R*4,0))
Next
StopDrawing()
EndIf

Until Event=#PB_Event_CloseWindow
Ollivier
Enthusiast
Enthusiast
Posts: 281
Joined: Mon Jul 23, 2007 8:30 pm
Location: FR

Post by Ollivier »

Excuse me but I give up.

Now, I can't give the handle of the windowed screen of the own native 3D engine to an other application so I can't get such an external handle.

hope anybody could be help you.

Ollivier
knut1
New User
New User
Posts: 8
Joined: Fri Apr 03, 2009 7:22 pm

Post by knut1 »

it runs, but it was flickering.....
the code above is from a german coder from a dx9 subsystem....

did you know FastImage? a library for blitzbasic and xors3d.
was written in purebasic...

With InitFastImage(GetDevice()) wie know it returns the pointer "LPDIRECT3DDEVICE9".

it works and it give a way, but i not know the right one.
Ollivier
Enthusiast
Enthusiast
Posts: 281
Joined: Mon Jul 23, 2007 8:30 pm
Location: FR

Post by Ollivier »

And Ogre? Is it not more simple to use it?
knut1
New User
New User
Posts: 8
Joined: Fri Apr 03, 2009 7:22 pm

Post by knut1 »

no
i use xors3d. www.xors3d.com
it exists fastimage but have not the functionality what i want.

i only wish give the output of initsprite(and perhaps startdraw) to the dx9 window
Ollivier
Enthusiast
Enthusiast
Posts: 281
Joined: Mon Jul 23, 2007 8:30 pm
Location: FR

Post by Ollivier »

I am sorry. I can't help you.
knut1
New User
New User
Posts: 8
Joined: Fri Apr 03, 2009 7:22 pm

Post by knut1 »

no problem perhaps anybody can help me.

anyway there are a way to draw in the dx window.......
anybody help.....
Post Reply