Board index » delphi » DIRECT DRAW SURFACE VS. DELPHI FORM

DIRECT DRAW SURFACE VS. DELPHI FORM

In an endless loop of the main program, I want to display one "full"
screen, out of two existing. Commuting from one screen to another, and
vice-versa, is done with F1 key :
-- Screen # 1  is a DirectDraw Surface where direct memory write is
performed after using the Lock instruction, as speed of display is
paramount. Assembler routines are used to clear screen and draw pixels
and lines.
            This part is working fine and, I believe, extremely fast.
-- Screen # 2  is a Delphi Form, in its specific Unit, with a menu,
comboboxes, radiobuttons, etc ... , designed to modify parameters that
will affect display of Screen # 1. When modifications are done, pressing
key F1 goes back to Screen # 1.

My problem is to integrate this Delphi form at execution time. I tried
several solutions, all leading to nothing, or a stall or crash of the
program !
My prefered choice would be to tranfer the Delphi form into a DDSurface
(how ?) and then transfer it to the PrimarySurface with BltFast. Can it
be done ?
Or should I use objects such as :  Application.CreateForm(TMenuForm,
MenuForm)  and ShowWindow, but how to make all these things work
properly !?

By the way, I am a newcomer on Delphi, after years with good old Turbo
Pascal .... that may explain why I'm a little bit lost !
Thanks very much for your help.

 

Re:DIRECT DRAW SURFACE VS. DELPHI FORM


Quote
pilleux wrote:

> In an endless loop of the main program, I want to display one "full"
> screen, out of two existing. Commuting from one screen to another, and
> vice-versa, is done with F1 key :
> -- Screen # 1  is a DirectDraw Surface where direct memory write is
> performed after using the Lock instruction, as speed of display is
> paramount. Assembler routines are used to clear screen and draw pixels
> and lines.
>             This part is working fine and, I believe, extremely fast.
> -- Screen # 2  is a Delphi Form, in its specific Unit, with a menu,
> comboboxes, radiobuttons, etc ... , designed to modify parameters that
> will affect display of Screen # 1. When modifications are done, pressing
> key F1 goes back to Screen # 1.

> My problem is to integrate this Delphi form at execution time. I tried
> several solutions, all leading to nothing, or a stall or crash of the
> program !
> My prefered choice would be to tranfer the Delphi form into a DDSurface
> (how ?) and then transfer it to the PrimarySurface with BltFast. Can it
> be done ?
> Or should I use objects such as :  Application.CreateForm(TMenuForm,
> MenuForm)  and ShowWindow, but how to make all these things work
> properly !?

You haven't specified what you have tried but my guess is that you are
trying to switch to the Delphi Form without making a call to
FlipToGDISurface as the Delphi Form lives in the GDI world while Surfaces
live in the DirectX world.
If you are looking for a DirectX Surface solution have a look at Fx
Visuals( http://www.magnetargames.com/Products.htm ), which are a set of
components that claim to duplicate most GDI controls on a DirectX Surface.

Anyway I hope this helps.

--
Ciao,

Dominique Louis
Delphi Developer and aspiring Delphi Game Developer.
*********************************************************
**  To Do Nothing is to Collaborate with the oppressor **
**  -------------------------------------------------- **
**           I like my reality undiluted!              **
*********************************************************
=========================================================
From . . . . . . . : Dominique Louis
Email. . . . . . . : Domini...@SavageSoftware.com.au
Company. . . . . . : Savage Software Solutions
Web Site . . . . . : http://www.SavageSoftware.com.au
Delphi Games Site. : http://www.SavageSoftware.com.au/delphi
G4D Mirrror Site . : http://www.SavageSoftware.com.au/delphi/g4d
Delphi JEDI Site . : http://www.delphi-jedi.org
=========================================================

Other Threads