Hello folks,
I have a problem that i can t fix....
My app run correctly when i launch it with all necessary arguments (i.e. name, name of the server, port of the server, position at the beginning) in the command line.
Here are some screenshots
What appears just after launching the app
a upper view of the same map
The code of my main function in my Test class is the following:
public static void main(String [] args){
Test t =new Test(args);
t.panel3D.start();
}
and an example of command line would be
java -Xmx128m multi.world.Test Bob pamela 9000 520 520
I decided to add a form in a graphic menu (inside a JFrame) to make it easier for a client to enter new values... When I click on a button, the Test class will be launched.
The code is very basic
public void actionPerformed(ActionEvent e){
String [] args = new String [5];
args[0] = loginText.getText(); // JTextField containing the login
args[1] = serverIDText.getText(); // JTextField containing the server name
args[2] = serverPortText.getText(); // // JTextField containing the lserver port
args[3] = ""+520;
args[4] = ""+520;
myMocas.closeMocas(); // i tried to close my frame either with calling dispose() or with using setVisible(false)
Test t = new Test(args);
t.panel3D.start();
}
When I launch my app using this JFrame, there are many problems. Only the panel containing the JPCT view is started (the black one on the left and the white one on the down aren't... The keymapper seems not to be loaded so i have no control on my avatar... And my system is slow down drastically.
I put some "System.out..." in my code to see where the application had problems... But the code seems to be read correctly... the client is correctly connected to the server and my game loop is running.
I checked if the args value that were passed to the Test class were corrects... and they are...
I tried with software or hardware rendering. Here are some config information for the buffer of my jpct Panel
// buffer = new FrameBuffer(width, height, FrameBuffer.SAMPLINGMODE_HARDWARE_ONLY);buffer = new FrameBuffer(width, height, FrameBuffer.SAMPLINGMODE_NORMAL);//buffer.enableGLCanvasRenderer(IRenderer.RENDERER_OPENGL);buffer.enableGLCanvasRenderer(IRenderer.RENDERER_SOFTWARE);buffer.setBoundingBoxMode(FrameBuffer.BOUNDINGBOX_NOT_USED);
buffer.optimizeBufferAccess();I tried 2 different configs by inverting red and green lines. blue lines remained in both configs. I don t know if it can be related to that but in fact, there was no runtime difference.
So I m lost. Is there a problem launching a JPCT app from another JFrame? If so, is there a way to bypass it?
Thanks you,
Manu