Lu-Kout's avatar

Apophysis DLL Plugin Sources

67 22 15K (1 Today)
By Lu-Kout   |   
Published:
© 2007 - 2020 Lu-Kout
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). :D 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.
Comments22
anonymous's avatar
Join the community to add your comment. Already a deviant? Log In
patternmaker's avatar
Thank you ever so much!!!
craftychris-thedark's avatar
I have noooooo idea what I just read, but I'm gonna' plug away blindly and see if I can figure it out :D
gossamer-light's avatar
gossamer-light Digital Artist
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?
monochromatic-stains's avatar
how the hell do you make your own variation?

my head = :explosion:
vjasper's avatar
vjasper Digital Artist
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.
Lu-Kout's avatar
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.
LadyLyonnesse's avatar
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!
Lu-Kout's avatar
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 :D).
LadyLyonnesse's avatar
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.
Lu-Kout's avatar
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...) :)
PatriciaRodelaArtist's avatar
PatriciaRodelaArtistHobbyist Digital Artist
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!;)
Lu-Kout's avatar
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.
PatriciaRodelaArtist's avatar
PatriciaRodelaArtistHobbyist Digital Artist
I hope that is soon and we're notified.:clap:
MzKitty45601's avatar
MzKitty45601Hobbyist Digital Artist
I like the image. That's super cool. I'd love to figure this out, but I think it's OVER my head. :D

Welcome to dA. Look forward to seeing some of your work. :)
Lu-Kout's avatar
Thanks! You've created some great fractals too!
MzKitty45601's avatar
MzKitty45601Hobbyist Digital Artist
Thank you very much :hug: I really appreciate hearing that.

You are most welcome :cuddle:
ashmaster100's avatar
hey there mr. winter. um i'm not a hacker but how could i add the new variations to apop??
Lu-Kout's avatar
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! ;)
ashmaster100's avatar
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.
Lu-Kout's avatar
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...
NatalieKelsey's avatar
NatalieKelseyHobbyist General Artist
:dance: I'll be spreading this little joy around. :nod:
anonymous's avatar
Join the community to add your comment. Already a deviant? Log In