Xith features you use

I sometimes feel like everyone just uses the graphic rendering and leave out the other features. But with a bit of tweaking they may become handling (ex : Sound).
Collision detection and Swing GUI seems deprecated to me. What do you think ?

Never tried xith’s collision detection…, and paltry because I never heard anything good about it except the Maze demo…

What about GUI… didn’t got any good opinion about it either… Especially if you have windowed application and resizing rendering window - GUI geting really messy both with the look & functionality…

But, actually! I have experimentaly found the solution which completely covers Xith GUI work, and you still have your controls kind of in the rendering window…

If you do the following:

  1. Put JLayeredPane on the frame.
  2. add xith_JPanel (your canvas) to JLayeredPane on the default_layer.
  3. add AWT Panel (not swing!!)!!! to the JLayeredPane and set the layer to palette_layer.
    … and now add all your Swing components to AWT Panel, and everything will be perfectly visible and working on top of you xith_JPanel!!

And, if this approach is working (and it is working!!) - I don’t see the sense in xith Swing GUI, especially when it is not good anyhow…

Bohdan.

but as it seems not on mac…
http://www.java-gaming.org/forums/index.php?topic=12872.0

Alright… I see…

Well, there is still diference in my and kc5uyn’s implementations… He renders onto JLayeredPane, and GUI is just added like JLayeredPane.add(Component). I do a bit different way and specifiing layers too (if i do not specify layers it doesn’t work for me!). I don’t know, maybe there is no difference really, but just wonder if kc5uyn can try exactly my way?

Kc5uyn, can you please try it to confirm?

Can you throw up an example in code of what you do? I’m not sure what you mean when you say add to default_layer and palette_layer.

Thanks.

Do you mean like this?:


JFrame mainFrame = new JFrame();
mainFrame.setVisible(true);
mainFrame.setSize(1000,500);
mainFrame.getContentPane().setLayout(new BorderLayout());

JLayeredPane layered = new JLayeredPane();
layered.setVisible(true);
mainFrame.getContentPane().add(layered);

Panel panel = new Panel();
panel.setLayout(new BorderLayout());
Button button = new Button("click me");
panel.add(button);
panel.setVisible(true);
panel.setSize(100,100);
panel.setLocation(600,100);
layered.add(panel, JLayeredPane.PALETTE_LAYER);
mainFrame.validate();

RenderPeer rp = new RenderPeerImpl();
CanvasPeer cp = rp.makeCanvas(layered,640,480,32,false);
Canvas3D canvas = new Canvas3D();
canvas.set3DPeer(cp);
view.addCanvas3D(canvas);


Again yes on PC. No go on Mac :frowning:

Yes… almost like you did, only don’t use layered pane to render onto, put JPanel into LayeredPane on def_layer and render onto it…


        JPanel xith_Pnl  = new JPanel();
        Panel  awt_Pnl   = new Panel();
        
        xith_Pnl.<set location and size>;
        awt_Pnl.<set location and size>;
        
        myJFrame.getLayeredPane().add(xith_Pnl);
        myJFrame.getLayeredPane().add(awt_Pnl);
        
        myJFrame.getLayeredPane().setLayer( xith_Pnl, JLayeredPane.DEFAULT_LAYER);  
        myJFrame.getLayeredPane().setLayer( awt_Pnl, JLayeredPane.PALETTE_LAYER);

        .......
        CanvasPeer cp = rp.makeCanvas(xith_Pnl, 640,480,32,false);
        .......

Just a thought… if it still doesn’t work…

The problem could be actually that you using Sun’s Java on PC… and Apple’s Java on Mac… Might be not exactly tha same java :wink:

Intersting. The lines


mainFrame.getLayeredPane().setLayer(xith_panel,  JLayeredPane.DEFAULT_LAYER);
mainFrame.getLayeredPane().setLayer(awt_panel,  JLayeredPane.PALETTE_LAYER);

were illegal on the mac. Had to change them to the intValue().

Still didn’t work though.

On the Apple’s Java vs Sun’s - yeah I thought of that as well. Maybe I’ll dig into their api stuff more or e-mail them.

Graphic rendering ----Yes!
Sound system----------Yes
Collision detection-----Yes (not using a current xith release)
Swing GUI----------------Yes extensive genrral purpose UI set for my game

There are also other subsystems - stripifier, etc.

Yuri

Interesting. I didn’t know that. Could you name other subsystems and explain their use please ?
It’s important for me to know all of Xith functionalities (especially those which are not used and poorly documented), because I intend to write some doc for Xith (presentation of the actual form of Xith, …)

Hi,

[quote]Could you name other subsystems and explain their use please ?
[/quote]
Ufff… A LOT…

OK, [not clainimg to be full list, jush what I have from the head]
Support for VBO - static geometry caching and caching type autodetection
NV Stripifier and Indexer - Automatic generation of indexed geometry, triangle strip geometry and run-time optimization for specific GPUs
Frustum culling - for outdoor rendering
Automatic and manual calculation of shape bounds - automatic and manual bounds calculation modes for dynamic geometry
Transparent and Opaque rendering passes - for better transparency rendering
Intelligent state sorting - by shape attributes, by bounding sphere, no sorting, etc.
Stencil buffer support
Vertex and Fragment shaders support
Swing UI - should be triple-checked
Partial texture updates - animated textures support
Disabling swap buffers - for application-defined multipass rendering
Rendering to individual color buffers - for example, for Red-Green StereoGlyph stereo rendering
Disabling clear buffers - speed ups for scenes that cover complete screen or have background that covers all the window
3D Texture support
Morphing
Canvas IDs and re-using canvas between two different scenes - enforced texture, shader and VBO offload from graphic card
… and some others…

Xith3D is really a big system. The only problem is a lack of demo applications and code examples…

Yuri

Wow, ok, thanks, probably I’ll testcase & javadoc them, but I can’t promise anything.