How to embed Zgameeditor files into another application

Use of external libraries (DLLs) from ZGE.

Moderator: Moderators

Post Reply
rweb
Posts: 3
Joined: Wed Aug 13, 2014 3:26 am

How to embed Zgameeditor files into another application

Post by rweb » Wed Aug 13, 2014 3:38 am

Note sure if this is the right thread, or if I should have asked in the Visualizer thread.
Basically I want to do something much like the Visualizer in that I want to play Zgameeditor files in another video art application.
I want to create content with Zgameeditor and play it back through a mixer.

Can anyone recommend a starting point?

PS: I am working with a C++ SDK

User avatar
VilleK
Site Admin
Posts: 1947
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK » Wed Aug 13, 2014 8:29 am

Hi,

For content that you only want playback without any code interface, you can build as screensaver and run the file with another window as parent. This is how the About-box in ZGameEditor works.

Code: Select all

  Prog := ExtractFilePath(Application.ExeName) + 'about.bin';
  ProgParam := '-p ' + IntToStr(SplashPanel.Handle);
  //Must use winexec or createproces because shellexecute cannot start
  //programs that doesn't end with '.exe'.
  //Process is closed automatically when its parent window is destroyed.
  WinExec(PAnsiChar(AnsiString(Prog + ' ' + ProgParam)), SW_SHOWNORMAL);
If you want more control and send data etc (like the visualizer) you need to write a wrapper DLL in Delphi first if you want to use it from C++. If you program in Delphi you can link the ZGameEditor source code directly (this is what the Visualizer does because it is written in Delphi). I can't share the visualizer source unfortunately because it is a commercial product owned by Image-Line.

rweb
Posts: 3
Joined: Wed Aug 13, 2014 3:26 am

Post by rweb » Wed Aug 13, 2014 9:06 pm

hmm... I have never even looked at Delphi.
Passing values in would be best.. however, the one thing I must have is access to the texture before it is drawn to screen.

So rather than drawing to screen the Zgameeditor file would do its usual work, render the content frame, then pass the texture out. The environment I am working with will deal with taking the texture.. processing additional transformations and drawing to screen.

Is it possible to redirect the pipeline in this manner?

User avatar
VilleK
Site Admin
Posts: 1947
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK » Sat Aug 16, 2014 7:22 am

I could possibly help you write a Delphi wrapper DLL because that could be useful for others too. Can you please tell us a bit more about your application and what you are trying to achieve?

rweb
Posts: 3
Joined: Wed Aug 13, 2014 3:26 am

Post by rweb » Sat Aug 16, 2014 6:15 pm

I sent you a PM.

Cheers

Post Reply