[Forum] My topic is not available at page 3 only?!

Ok 3 files only then!
I will do this in the next hours!

@Momoko_Fan said: Note that you won't be able to apply them to the root folder of the 3.0 source tree since the build system and all paths changed, you will need to apply to the files directly.

So you mean I cannot drag n drop the 3 classes in my 3.0 source but I will need to edit them manually in the source I already have, right? And then I should recompile the whole thing, shouldn’t I?

@AXELTOPOLINO said: Ok 3 files only then! I will do this in the next hours!

So you mean I cannot drag n drop the 3 classes in my 3.0 source but I will need to edit them manually in the source I already have, right? And then I should recompile the whole thing, shouldn’t I?


You can just copy the files directly from the source if you like, it will work the same.

I have just copied the files from git like you said, but I get the following error about a wrong buffer size:

SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main] java.lang.IllegalArgumentException: Number of remaining buffer elements is 4, must be at least 1228800. Because at most 1228800 elements can be returned, a buffer with at least 1228800 elements is required, regardless of actual returned element count at org.lwjgl.BufferChecks.throwBufferSizeException(BufferChecks.java:162) at org.lwjgl.BufferChecks.checkBufferSize(BufferChecks.java:189) at org.lwjgl.BufferChecks.checkBuffer(BufferChecks.java:230) at org.lwjgl.opengl.GL11.glReadPixels(GL11.java:2440) at com.jme3.renderer.lwjgl.LwjglRenderer.readFrameBuffer(LwjglRenderer.java:1632) at mygame.jmeFixes.AwtPanel.drawFrameInThread(AwtPanel.java:138) at mygame.jmeFixes.AwtPanel.onFrameEnd(AwtPanel.java:267) at mygame.jmeFixes.AwtPanelsContext.updateInThread(AwtPanelsContext.java:159) at mygame.jmeFixes.AwtPanelsContext.access$100(AwtPanelsContext.java:13) at mygame.jmeFixes.AwtPanelsContext$AwtPanelsListener.update(AwtPanelsContext.java:35) at com.jme3.system.lwjgl.LwjglOffscreenBuffer.runLoop(LwjglOffscreenBuffer.java:125) at com.jme3.system.lwjgl.LwjglOffscreenBuffer.run(LwjglOffscreenBuffer.java:151) at java.lang.Thread.run(Thread.java:722)

I’m trying to understand what’s wrong, but maybe you know it better because you applied these fixes :slight_smile:

That’s odd, never saw that one before. Are you sure you only copied the aforementioned 3 files or did you copy other stuff as well?

@Momoko_Fan said: That's odd, never saw that one before. Are you sure you only copied the aforementioned 3 files or did you copy other stuff as well?
What I did is: 1. Created a package in my project called "JmeFixes" 2. Created 3 new classes called AwtPanel, AwtPanelsContext and AwtMouseInput 3. Copy-pasted the 3 classes from git into these 3 classes 4. Fixed the 3 classes imports (so they call each other) 5. Fixed the imports in my project when I use AwtPanel and AwtPanelsContext

The method called mygame.jmeFixes.AwtPanel.onFrameEnd() seems new, as the JME3.0 AwtPanel doesn’t have it. I thought this was the best way to apply the edits, am I wrong?

Thanks!
Ps. are you sure you haven’t edited any other class? :S

@AXELTOPOLINO said: What I did is: 1. Created a package in my project called "JmeFixes" 2. Created 3 new classes called AwtPanel, AwtPanelsContext and AwtMouseInput 3. Copy-pasted the 3 classes from git into these 3 classes 4. Fixed the 3 classes imports (so they call each other) 5. Fixed the imports in my project when I use AwtPanel and AwtPanelsContext

The method called mygame.jmeFixes.AwtPanel.onFrameEnd() seems new, as the JME3.0 AwtPanel doesn’t have it. I thought this was the best way to apply the edits, am I wrong?

Thanks!
Ps. are you sure you haven’t edited any other class? :S


Don’t think this is the best way of doing it … Here’s how I would do it:

  1. Check out the 3.0 stable branch from GitHub or Google Code
  2. Replace the aforementioned 3 files with updated source
  3. Rebuild the engine with the modifications
  4. Use the JARs in the project
@Momoko_Fan said: Don't think this is the best way of doing it ... Here's how I would do it: 1) Check out the 3.0 stable branch from GitHub or Google Code 2) Replace the aforementioned 3 files with updated source 3) Rebuild the engine with the modifications 4) Use the JARs in the project

Ok, downloading it now. Is compiling it with jar cf jme3-libraries * enough? :slight_smile:

@AXELTOPOLINO said: Ok, downloading it now. Is compiling it with jar cf jme3-libraries * enough? :)
Not sure what you mean. You can build jME3 either using ant or by opening the project in NetBeans and building from there.

Forget this no-sense question :slight_smile:

@Momoko_Fan said: Not sure what you mean. You can build jME3 either using ant or by opening the project in NetBeans and building from there.

On github, the master branch has got all the engine source directories and the gradle files ready to be used to compile it.
When I switch to the “3.0” branch, I see a completely different directory structure and I cannot find any gradle file. Were you using gradle in the 3.0 release?
Also I see the 3.0 source in “engine/src” and I see some comments about Maven, so my suspect is that you were using Maven, am I wrong?

I’ve just started using Maven, Ant and Gradle so I’m not sure about the building scripts :slight_smile:

About your exception “Number of remaining buffer elements is 4, must be at least 1228800…” I have to deal with similar issue yesterday for jme-jfx. You’re exception isn’t the same (mine was during “org.lwjgl.opengl.GL11.glTexImage2D”, your was at “org.lwjgl.opengl.GL11.glReadPixels”).
Mine (and from other on the web) is caused when you access concurrently to a bytebuffer (eg a texture). at least 2 threads trying to write/read (reading modify position in bytebuffer).

Else to build master, use the gradle script : “./gradlew build”

@david.bernard.31 said: About your exception "Number of remaining buffer elements is 4, must be at least 1228800...." I have to deal with similar issue yesterday for jme-jfx. You're exception isn't the same (mine was during "org.lwjgl.opengl.GL11.glTexImage2D", your was at "org.lwjgl.opengl.GL11.glReadPixels"). Mine (and from other on the web) is caused when you access concurrently to a bytebuffer (eg a texture). at least 2 threads trying to write/read (reading modify position in bytebuffer).

Else to build master, use the gradle script : “./gradlew build”

Hi David,
I don’t think I’m accessing concurrently to a bytebuffer as I was just trying to attach the AWTPanel correctly into my Swing project. I will do another test later to check if it works when I only attach the panel (without any other Swing component).

I think I shouldn’t build master, but the 3.0 branch, as I still need the 3.0 compiled source (to use as library) with inside the 3 fixes of the AWT Panel that pspeed did previously. But I really don’t get why there’s no gradle stuff in the 3.0 branch :slight_smile:

Swing and JME run on differents threads (like javafx). If swing try to read/write when LwjglRenderer.readFrameBuffer then index/position of the bytebuffer are modified concurrently.

@david.bernard.31 said: Swing and JME run on differents threads (like javafx). If swing try to read/write when LwjglRenderer.readFrameBuffer then index/position of the bytebuffer are modified concurrently.
You're right, I didn't explain well what I meant: I don't think any of my components is reading/writing the bytebuffer, so I'm pretty sure that the AWT Panel is causing it (as it's probably reading the bytebuffer). So the source isn't working properly...

By the way have you got any clue about the building thing? :slight_smile:

I never build 3.0. but ‘ant build’ seems to work.

EDIT: I think you can import the project into SDK or netbeans and build it (iirc there doc on the wiki about how to build)

May be a stupid question. Why don’t you try to implement a swing component to display (interact) with jme vs using AWT ?

@david.bernard.31 said: I never build 3.0. but 'ant build' seems to work.

EDIT: I think you can import the project into SDK or netbeans and build it (iirc there doc on the wiki about how to build)

Ok, thanks, going to do it in a min. The thing that stopped me is that there’s stuff about Maven and some about Ant and I thought they were 2 completely separated building tools. My bad, let’s see if it works or if I get the same error :slight_smile:

@david.bernard.31 said: May be a stupid question. Why don't you try to implement a swing component to display (interact) with jme vs using AWT ?

There’s already a thing called “Canvas” in JME which I was using until I discovered that AWT with Swing creates many serious bugs on rendering. No Mac user could use the software for example.

I don’t understand. Canvas, AWTPanel are AWT (heavy) not swing. I’m not aware of a swing (without AWT) display for jme. it’s why I ask. I tjhings it will be quicker to make it, if you know swing than patching jme.

@david.bernard.31 said: I don't understand. Canvas, AWTPanel are AWT (heavy) not swing. I'm not aware of a swing (without AWT) display for jme. it's why I ask. I tjhings it will be quicker to make it, if you know swing than patching jme.

I actually know Swing (at least enough to make normal things) and I was using Canvas. All worked perfectly until Mac users tried the software. So I asked for help about the problem and normen and pspeed suggested to use the AWTPanel instead of the Canvas. In fact, the AWTPanel works properly on Macs too, but it had 2 bugs that Momoko fixed in the master (3.1) branch after I reported them. I need to apply these fixes in the 3.0 code, so this is why I need to build it from the source :slight_smile: