Tilengine - The 2D retro graphics engine forum
Tilengine on Java - Printable Version

+- Tilengine - The 2D retro graphics engine forum (http://tilengine.org/forum)
+-- Forum: English forums (http://tilengine.org/forum/forumdisplay.php?fid=3)
+--- Forum: Support (http://tilengine.org/forum/forumdisplay.php?fid=7)
+--- Thread: Tilengine on Java (/showthread.php?tid=952)

Pages: 1 2 3 4 5 6 7 8

RE: Tilengine on Java - System64 - 12-13-2020

Ah yeah then if you want to have to keep both versions of Java, you need to specify the absolute path to the 32-bits compiler or create a new variable environnement

Did you tried with my project?

RE: Tilengine on Java - megamarc - 12-14-2020

How are you doing progress? You can make a "pull request" so I can integrate your updates into main branch

RE: Tilengine on Java - System64 - 12-14-2020

I'll do it when the crash issue is solved.

I still have the crash issue and the program closes with this message : Process finished with exit code -1073740940 (0xC0000374)

Normally, if the program finishes correctly, the compiler should say "Process finished with exit code 0" and that's not the case here.

When you tested in your side, did you tried with my project that contains my update?

RE: Tilengine on Java - megamarc - 12-14-2020

I did the test with my original samples, but with the modifications you made to Tilengine.java and TilengineJNI.c. Here I attach the same sources I used for the binding.

RE: Tilengine on Java - System64 - 12-14-2020

did you linked with the latest version of Tilengine.dll?

I did and the Java compiler said that : 

Execution protection violation
# A fatal error has been detected by the Java Runtime Environment:
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x005f0061, pid=128360, tid=0x0001d44c
# JRE version: Java(TM) SE Runtime Environment (8.0_271-b09) (build 1.8.0_271-b09)
# Java VM: Java HotSpot(TM) Client VM (25.271-b09 mixed mode windows-x86 )
# Problematic frame:
# C  0x005f0061
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
# An error report file with more information is saved as:
# C:\Users\[path to file]\hs_err_pid128360.log
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
Tilengine v2.8.5 32-bit built Dec  6 2020 12:48:12

Process finished with exit code 1

and it outputs a beautiful crashlog

RE: Tilengine on Java - megamarc - 12-14-2020

I use Tilengine v2.8.5 32-bit built Aug 7 2020, the seme binary you can download at itch.io.

Are you running your TestWindow or mine? I can see in the log dump you provided that the problem is caused in the call to SetRasterCallback().
Here I attach my TilengineJNI.dll, it includes your enhancements. Does it crash for you too?

RE: Tilengine on Java - System64 - 12-15-2020

It works! how did you do that? did you do some modifications in the files?

RE: Tilengine on Java - megamarc - 12-15-2020

Basically the files I used are the same ones you pushed to your fork of the binding. Maybe the tricky part here is the building of native TilengineJNI.dll
Now that you have it working again, find when does it break: start by building your own dll and check it with the rest of the project. If doesn't crash, change other components -only one each time- until it crashes. Let's isolate the origin of the crash.

RE: Tilengine on Java - System64 - 12-15-2020

Very very weird

I compiled with gcc, the program doesn't even start and the compiler say : Exception in thread "main" java.lang.UnsatisfiedLinkError: Tilengine.Init(IIIII)I

I compiled with tcc, everything works fine

Do you know why it works with tcc and not for gcc?

RE: Tilengine on Java - megamarc - 12-15-2020

I have the same issue: only dll generated by tcc works, the one with mingw32-gcc doesn't. It must be something about the calling convention (there are different standards). Under Windows I work with Visual Studio or tcc for command line. I only use gcc under Linux.

By the way, the component complaining is not the C compiler, it's the Java Virtual MAchine (JVM) responsible of executing the Java program.