HOME | DD

Lu-Kout — Apophysis DLL Plugin Sources

Published: 2007-06-16 03:15:16 +0000 UTC; Views: 16279; Favourites: 68; Downloads: 2515
Redirect to original
Description Here's some source code examples for anyone who wants to develop their own variations for Apophysis without having to integrate them into the Apophysis program itself. (The preview image here was made using one I created for my wife a while back).

[EDIT 14 July 2007: Fixed memory manager problem in Delphi DLL sources (it was defaulting to single-threaded support only). The update addresses the issues with invalid pointers many people were having when using certain plugin DLLs compiled using Delphi.

Version 0.4 of the Delphi sources also enables the ResetVariation double-click functionality (with versions of Apophysis built using the updated varGenericPlugin.pas file v0.4). I'll update the C/C++ sources to enable this functionality in those DLLs as well. The updates allow the new plugins/Apo program to continue working with earlier Apo and DLL versions.

Discard plugins created from Delphi source code earlier than v0.4, as they will cause problems even if not enabled in the editor.

An example of these plugins (a Mandelbrot variation) can be found at [link] . The example source code there also has the fix for the DLL memory manager issue.]

The plugin handler itself is now part of the official Apo 2.06 releases. To use plugins with earlier versions of Apo, you'll need to add one Delphi source file to the Apo sources and rebuild the program. Thereafter, you can build and use variations written in C, C++, or Delphi (or conceivably VB, or any other language capable of building DLLs) without having to touch the Apo source code again. All you have to do is drop the DLL into the Plugins folder under the Apophysis working directory; Apophysis will load the plugin at startup.

Example source code is provided for easily creating variations in Delphi, C, and C++. Click 'Download' to obtain a zip file containing the necessary files. You'll need to direct your C/C++ compiler to use the __cdecl calling convention when creating your DLL (I think that may be the default when using the Win32 DLL Wizard in MSVC++ 6, which is what I used to test them out).

Thanks to `DragonWinter for posting earlier (Delphi-only) versions of the Apo Plugin handler/DLL source code for me at [link]

Note that I'm not responsible for whatever Apo or your computer does (or doesn't do) when you use this code...

Image and code © 2007 Jed Kelsey. Code may be modified and distributed in accordance with Apophysis source code guidelines.
Related content
Comments: 22

patternmaker [2011-07-16 12:36:20 +0000 UTC]

Thank you ever so much!!!

👍: 0 ⏩: 0

craftychris-thedark [2008-08-09 01:18:04 +0000 UTC]

I have noooooo idea what I just read, but I'm gonna' plug away blindly and see if I can figure it out

👍: 0 ⏩: 0

gossamer-light [2007-11-15 17:03:17 +0000 UTC]

Ok so, I get my apoplugin.h file, and I make my myvariation.c file... and then? I have Dev-C++ but there is no convert/build/export to dll feature, only a very sparce templete and little instruction on what to do with the .h and .c files (well, actually, no instructions anywhere, even the tuts online only go so far as telling you how to get the template to open but not how to use it).

So, what do you do next then?

👍: 0 ⏩: 0

monochromatic-stains [2007-07-18 06:34:43 +0000 UTC]

how the hell do you make your own variation?

my head =

👍: 0 ⏩: 0

vjasper [2007-06-30 04:08:28 +0000 UTC]

I just want to say thank you.... I've been waiting for something exactly like this for so long... it is absolutely magnificent, thank you so much.

👍: 0 ⏩: 1

Lu-Kout In reply to vjasper [2007-07-09 01:48:51 +0000 UTC]

Great! Apo 2.06 supports the plugin interface, so you should be able to create some fun new variations for it (and/or use plugins others have created).

Note that there will probably be a few updates to the Apo plugin interface in the near future; this was a first cut at a potential approach, and the Apo developers were nice enough to try it out. (Thanks, guys!) Check out the Apo source code for the "official" varGenericPlugin.pas code that went into the Apophysis 2.06 release.

👍: 0 ⏩: 0

LadyLyonnesse [2007-06-30 01:59:48 +0000 UTC]

I'm not too sure if I can manage this....I'm technologically retarded! But the idea of plug-ins sounds wonderful More new toys to play with!

👍: 0 ⏩: 1

Lu-Kout In reply to LadyLyonnesse [2007-07-09 01:34:43 +0000 UTC]

Thanks! There are still a few kinks to work out with the plugin interface, but it should be mostly transparent to the Apophysis user -- just drop a plugin DLL into a folder called Plugins (you may have to create the folder) just under the Apo installation directory (where the Apophysis206.exe file is). You'll need Apo 2.06 or later (which shouldn't be an issue, since 2.05 and earlier have expired already ).

👍: 0 ⏩: 1

LadyLyonnesse In reply to Lu-Kout [2007-07-09 11:49:25 +0000 UTC]

Do you mean in the Program Files>Apophysis 2.0 folder? This is where all my different Apo versions are stashed...including the expired ones! I would have to create a new folder called Plugins?
Sheesh, I'm lost with all the technicalities.

👍: 0 ⏩: 1

Lu-Kout In reply to LadyLyonnesse [2007-07-12 04:20:49 +0000 UTC]

Yes -- if the Apophysis206.exe file is in Program Files > Apophysis 2.0, then you'll need to create the Plugins folder there (Program Files > Apophysis 2.0 > Plugins) and drop the plugin dll into the new folder. Good luck! (Note: if I get any time, I'll probably be putting up a new version of the plugin soon...)

👍: 0 ⏩: 0

PatriciaRodelaArtist [2007-06-25 11:51:53 +0000 UTC]

This is great!!! Because I'm so new at this I may not be able to make one of your great DLL Plugins', but that won't stop me from admiring them!

👍: 0 ⏩: 1

Lu-Kout In reply to PatriciaRodelaArtist [2007-06-26 02:38:13 +0000 UTC]

No worries -- once Apo officially supports plugins, you'll be able to use any of them by just dropping them into your Plugins folder (no need to build them yourself). They'll show up in the list of variations, just like the variations that come with Apophysis.

👍: 0 ⏩: 1

PatriciaRodelaArtist In reply to Lu-Kout [2007-06-26 03:49:51 +0000 UTC]

I hope that is soon and we're notified.

👍: 0 ⏩: 0

MzKitty45601 [2007-06-20 19:51:39 +0000 UTC]

I like the image. That's super cool. I'd love to figure this out, but I think it's OVER my head.

Welcome to dA. Look forward to seeing some of your work.

👍: 0 ⏩: 1

Lu-Kout In reply to MzKitty45601 [2007-06-26 02:39:07 +0000 UTC]

Thanks! You've created some great fractals too!

👍: 0 ⏩: 1

MzKitty45601 In reply to Lu-Kout [2007-06-26 02:44:49 +0000 UTC]

Thank you very much I really appreciate hearing that.

You are most welcome

👍: 0 ⏩: 0

ashmaster100 [2007-06-18 16:47:27 +0000 UTC]

hey there mr. winter. um i'm not a hacker but how could i add the new variations to apop??

👍: 0 ⏩: 1

Lu-Kout In reply to ashmaster100 [2007-06-19 03:16:32 +0000 UTC]

Basically, you'd need to add the plugin manager code to the Apophysis project and rebuild Apo (or get someone with a Delphi compiler to build it for you). You only need to do this once.

From then on, you can create your own plugin DLLs easily using the provided framework -- in Delphi, C, or C++ for now -- and simply drop the resulting DLL into the Apophysis working directory. Apo will load and use the new variation(s) on startup.

Hopefully one of the upcoming Apo releases will include a plugin manager so people can build new variations in C or C++ etc. without needing to mess with the Apophysis Delphi source code at all!

👍: 0 ⏩: 1

ashmaster100 In reply to Lu-Kout [2007-06-19 16:00:37 +0000 UTC]

where cani find this plugin manager code? can i get it off you, or could you build it for me?. i would really like to learn all of this stuff.

👍: 0 ⏩: 1

Lu-Kout In reply to ashmaster100 [2007-06-24 22:27:16 +0000 UTC]

The plugin manager code (varGenericPlugin.pas) is contained in this download . A slightly updated version is being tested in Apo, so hopefully it (or something similar) will be part of the next official release of Apophysis...

👍: 0 ⏩: 1

ashmaster100 In reply to Lu-Kout [2007-06-27 16:14:49 +0000 UTC]

o right thanx

👍: 0 ⏩: 0

NatalieKelsey [2007-06-16 03:42:02 +0000 UTC]

I'll be spreading this little joy around.

👍: 0 ⏩: 0