The -I parameter should not be used here. It is used to include headers, but the dll is a binary.
Biggest problem is that you're using mingw64, that is used to build 64-bit binaries, but you're linking to 32-bit version of Tilengine.dll. You cannot combine executables of different architecture. You must link against 64-bit version of Tilengine.dll.
I wrote the binding when my main development machine was still 32-bit, I haven't tested it with 64-bit compilers... I'll check
12-08-2020, 09:50 AM (This post was last modified: 12-08-2020, 09:55 AM by System64.)
I want to allow the creation of multiples raster effects, so I have to create an object instance of a Raster Effect class, what I did. But it doesn't work.
But it asks for a Line argument, thing you don't use in your sample.
Also, the compiler says "java.lang.NoSuchMethodError: raster.mode7" that means the method probably doesn't exist. But I created this method.
What can I do to fix that please? Thanks for the answer.
// set the raster callback function name
tln.SetRasterCallback (this, "rasterCallback");
// callback body
void rasterCallback (int line) {
...
}
Before trying to encapsulate in classes and instances, make sure that the samples work, and then try to modify them to check that you understand its mechanism. One change each time. Also keep in mind that only one raster effect callback can be enabled. Ussing classes and instances may (or may not) introduce issues unrelated to the engine itself.
12-08-2020, 06:13 PM (This post was last modified: 12-08-2020, 07:13 PM by System64.)
So I can't have a different raster effect for Layer1, another for Layer2 and another for Layer3?
By the way, is it possible to make methods in the Tilengine class Static?
UPDATE : I checked for raster effets and effectively I can't use multiples Raster Effects at the same time.
But what I can do is creating multiple raster effects methods and selecting the right one when I need a particular one.
Raster effect is a global frame feature, that's why you can't have one for each layer. However, you can modify any layer or sprite parameters inside the same callback. That's what the example shooter.c does. It's a bit complicated, but you can see that the raster callback operates heavily on both background layers to simulate depth and enhance parallaxing: https://github.com/megamarc/Tilengine/bl...ter.c#L208
Are you using Tilengine.h from release 2.8.5? In order to give advice on crashes, you should attach all your development project inside a zip and post it here: dlls, executable, classes, graphic assets... anything needed to run and reproduce the issue. Runtime crashes are often caused by inconsistences on the environment.
I have intention to remove the complex TLN_EnableCRTEffect() function and simplify it on a basic enable/disable on future releases, so don't bother with it either...
I joined a ZIP with all my source files.
My workspace is a bit wonky because I'm testing engine's features. I have no idea if treating layers and raster effects as objects a good idea by the way, but it works.
Also, is it possible to put objects on the tilemap? Is there a function in Tilengine to spawn them where I put them on the tilemap? If not, how can I implement that?