Another FengGui + JME2.0 Topic

Hello forum,



Has anyone has issues integrating the latest version of FengGui and JME 2.0? We currently changed from JME to JME 2.0 and upgraded our FengGui jar to the latest one and we ran into a big problem



Our MenuBar, created using FengGui, no longer shows textures. We now the menu bar is there because we can see some black and white boxes, but we don’t see the name of the Menus we want. This happens with every single FengGui widget we have in our system… MenuBar, menu, windows, scrollbars, textareas, checkboxes… The interesting thing is that we can click on the widgets and buttons, but they still don’t show up…



Here’s a picture of how it looks…



There’s supposed to be a Menu Bar, the drop down menu where the mouse is and a Window widget with a button, text area and check boxes



Has anyone faced a similar issue to this?

what ‘version’ of fengGUI are you using?



I have a self compiled ‘older’ version and it still seems fine…

fengGUI.jar

I have an older version as well. This one to be more specific http://icogsci1.ucsd.edu/~jrmartin/pictures/fenggui-lwjgl2.0-1.0.jar.



However, I just replaced that version I had with the one you were so kind to post and I still had no luck.  :?

I still get the same exact results. This problem is way too confusing.

I would suggest breaking the problem down to the most basic implementation; basically create a jME type test for your GUI (simple game with one simple fengGUI widget)…



Also, how are you rendering it? through a passes or a node?

I try running a basic example and it does work. I'm using it trough a Node.



I've been reading the forum and it seems to point out that I have to start feng gui from an OpenGL thread or something like that. I guess I have to start looking into that now unless it can be something else.


        GameTaskQueueManager.getManager().update( new Callable<Object>() {

            public Object call() throws Exception {

                // Insert openGL stuff here

                return null;
            }
        } );

Are you rendering fenggui in a separate renderpass?



Maybe this can help a bit, but its based on jme1:

http://www.jmonkeyengine.com/wiki/doku.php?id=fenggui_jme_appl_using_standardgame

Think there is an issue with the LWJGL library that jme2 and fengui uses - use the one with jme2 and you shouldnt have issues

Take a look at this: http://code.google.com/p/radakan/source/browse/trunk/JMEContext/src/com/gibbon/jme/pass/FengGuiPass.java

It integrates FengGUI seamlessly with jME2. Note that it uses JMEContext system so you may have to port it to the jME native pass system. Also it uses several other classes in the package and only works with the LWJGL renderer.

Thank you all for the help given to me. Unfortunately, we weren't able to fix this bug. We already had some issues with FengGUI, but nothing we couldn't fix like this. We are migrating to use SwingGUI and now my task is to convert this BaseSimpleGame into a Canvas. Seems like it's going to be a fun ride…  :smiley:

lol, you will learn when to spot the non-openGL thread operation exceptions pretty quickly :stuck_out_tongue:



But it does work, and the performance hit is actually not that bad (there is a hit though)…

hehe too bad I couldn't spot them.



Anyway, Canvas is up and running with some problems.



FengGui was great whenever I was able to get it running properly. However fixing some things that I needed for the project took a while.



Oh well, to move on to new territories.

If it's not too late for you, this is what I had to do to solve the rendering problem…


// In the render method

   // Set a default TextureState, this is needed to not let FengGUI inherit
   // wrong Texture coordinates and stuff.
   Texture defTex = TextureState.getDefaultTexture().createSimpleClone();
   defTex.setScale(new Vector3f(1, 1, 1));

   TextureState defaultTextureState = DisplaySystem.getDisplaySystem().getRenderer().createTextureState();
   defaultTextureState.setTexture(defTex);
   defaultTextureState.apply();

   // render the GUI
   fengGUIDisplay.display();

man, if thats it I'm gonna feel really bad; I assumed that was something he had anyways…

ummm I'm curious now to see if that was it. I'll try it out on my spare time once we finish the SwingGui + Jme integration. Thanks for the code.