Author Topic: JBuilder - Need Help with jPCT!!!  (Read 10345 times)

Albareth

  • Guest
JBuilder - Need Help with jPCT!!!
« on: December 30, 2003, 08:51:12 pm »
Ok, I've compiled my project with no troubles, and I try to run it.  However, the main runtime window for the engine is not coming up.  I get the console data, but not the graphics...  Please Help!!!

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
JBuilder - Need Help with jPCT!!!
« Reply #1 on: December 31, 2003, 01:09:48 pm »
Maybe your application (i assume that it is an application, not an applet!?) exits with an exception before the frame opens?
Personally, i use JBuilder to edit and compile my stuff, but i always use the console and some batch-files to start the compiled app. Can't really tell you why i'm doing it this way...maybe i'm just used to it.

BTW: What happened to the problem with the textures?

Albareth

  • Guest
JBuilder - Need Help with jPCT!!!
« Reply #2 on: December 31, 2003, 02:05:12 pm »
Well, my application runs/compiles in JBuilder (i.e. I get a console), but I don't get the graphical window...  And when I try to run it outside of JBuilder I get a Main Class Not Found error...

Also, the Texture bug was just a problem with the code that you used in TerrainGL...  Java didn't like that method, so I switched it to the Bounce method...  Now it's taking my texture with a width of 1024 and saying that it is an improper size, then it shrinks it down to 256...

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
JBuilder - Need Help with jPCT!!!
« Reply #3 on: December 31, 2003, 02:21:28 pm »
Quote from: "Albareth"
Well, my application runs/compiles in JBuilder (i.e. I get a console), but I don't get the graphical window...  And when I try to run it outside of JBuilder I get a Main Class Not Found error...

Also, the Texture bug was just a problem with the code that you used in TerrainGL...  Java didn't like that method, so I switched it to the Bounce method...  Now it's taking my texture with a width of 1024 and saying that it is an improper size, then it shrinks it down to 256...
What's the console's output (if any...).
About the texture: 1024 is a proper size and shouldn't be rescaled. What may happen anyway is, that the height is not a power of 2, which causes a rescale of the height to 256. Which size is the texture in?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
JBuilder - Need Help with jPCT!!!
« Reply #4 on: December 31, 2003, 02:48:39 pm »
BTW: If the way TerrainGL loads its textures doesn't work for you but the way Bounce does it works, you are writing an Applet, don't you? Bounce is applet only. That would explain why you don't get a graphical output when using JBuilder/Netbeans. An Applet can't run as standalone but needs an "applet-container" like the Appletviewer (comes with the JDK) or a browser to run. Maybe using one of these options will solve your problem!?

Albareth

  • Guest
JBuilder - Need Help with jPCT!!!
« Reply #5 on: December 31, 2003, 03:20:36 pm »
Well, the console's output is:
Exception in thread "main" java.lang.NoClassDefFoundError: game

and no, I'm not writing an applet...  It's just the method of loading textures that I borrowed from Bounce...

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
JBuilder - Need Help with jPCT!!!
« Reply #6 on: December 31, 2003, 04:18:41 pm »
Quote from: "Albareth"
Well, the console's output is:
Exception in thread "main" java.lang.NoClassDefFoundError: game

and no, I'm not writing an applet...  It's just the method of loading textures that I borrowed from Bounce...

Have you configured the class to start in the Project Properties (in the Run-Tab)?

I still don't get how you can use Bounce's texture loading method...Bounce does
Code: [Select]
zoom=new Texture(this.getDocumentBase(), "bouncedata/zoom.gif");
That can't work in an Application unless your application extends Applet for whatever reason. Anyway, if this works and your previous approach wasn't, something with the path to your files had been wrong before.

Albareth

  • Guest
JBuilder - Need Help with jPCT!!!
« Reply #7 on: December 31, 2003, 05:07:45 pm »
Code: [Select]
Texture tex = new Texture("d:/13th/SESD/com/resources/dreadhull.jpg");
    texMan.addTexture("DreadHull", tex);
is the code that I use to load the texture into the texture manager...
and that error that I got in the console was from the MS-DOS Prompt...  my code works in JBuilder, and the program runs...[/code]

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
JBuilder - Need Help with jPCT!!!
« Reply #8 on: December 31, 2003, 07:47:48 pm »
Quote from: "Albareth"
Code: [Select]
Texture tex = new Texture("d:/13th/SESD/com/resources/dreadhull.jpg");
    texMan.addTexture("DreadHull", tex);
is the code that I use to load the texture into the texture manager...
and that error that I got in the console was from the MS-DOS Prompt...  my code works in JBuilder, and the program runs...
I guess we were talking about different things then. The code is of course fine the way it is. Have you tried something like
Code: [Select]
java -cp %CLASSPATH%;. game in the console (or whatever your main-class is called)?
You mean that the code runs in JBuilder and you just don't get the frame displayed?

Albareth

  • Guest
JBuilder - Need Help with jPCT!!!
« Reply #9 on: January 01, 2004, 04:32:54 am »
I am using the classpath in the console...  and the frame is not getting displayed in JBuilder...  but the code runs.

my output in JBuilder:
D:\JBuilder9\jdk1.4\bin\javaw -classpath "D:\13th\SESD\com\classes;D:\13th\SESD\com\lib\lwjgl\lwjgl.jar;D:\13th\SESD\com\lib\jpct\jpct.jar;D:\JBuilder9\jdk1.4\demo\jfc\Java2D\Java2Demo.jar;D:\JBuilder9\jdk1.4\demo\plugin\jfc\Java2D\Java2Demo.jar;D:\JBuilder9\jdk1.4\jre\lib\charsets.jar;D:\JBuilder9\jdk1.4\jre\lib\ext\dnsns.jar;D:\JBuilder9\jdk1.4\jre\lib\ext\ldapsec.jar;D:\JBuilder9\jdk1.4\jre\lib\ext\localedata.jar;D:\JBuilder9\jdk1.4\jre\lib\ext\sunjce_provider.jar;D:\JBuilder9\jdk1.4\jre\lib\im\indicim.jar;D:\JBuilder9\jdk1.4\jre\lib\jaws.jar;D:\JBuilder9\jdk1.4\jre\lib\jce.jar;D:\JBuilder9\jdk1.4\jre\lib\jsse.jar;D:\JBuilder9\jdk1.4\jre\lib\rt.jar;D:\JBuilder9\jdk1.4\jre\lib\sunrsasign.jar;D:\JBuilder9\jdk1.4\lib\dt.jar;D:\JBuilder9\jdk1.4\lib\htmlconverter.jar;D:\JBuilder9\jdk1.4\lib\tools.jar"  Game
Please enter your Player ID:

1
Please enter your password:

1
Your username is 1 and your password is 1

Java version is: 1.4.1_02

-> support for BufferedImage

-> using BufferedImage

Software renderer (legacy mode) initialized

Loading Texture...d:/13th/SESD/com/resources/dreadhull.jpg

[ Wed Dec 31 21:11:01 EST 2003 ] - WARNING: Unsupported Texture width...resizing to a width of 256 pixels!

Loading Texture...d:/13th/SESD/com/resources/dreadhullspec.jpg

[ Wed Dec 31 21:11:02 EST 2003 ] - WARNING: Unsupported Texture width...resizing to a width of 256 pixels!

Loading Texture...d:/13th/SESD/com/resources/tipmap.jpg

Loading Texture...d:/13th/SESD/com/resources/windowmap.jpg

Loading Texture...d:/13th/SESD/com/resources/windowreflect.jpg

Adding Lightsource: 0

Created 31 triangle-strips for objectID 0 in 15 pass(es)

[/list]

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
JBuilder - Need Help with jPCT!!!
« Reply #10 on: January 01, 2004, 02:23:41 pm »
OK, so obviously SOME code is running, but that doesn't mean that the method that opens the frame will ever be called. Without looking at the code, it's impossible to tell what's wrong here. But it's most likely a problem with your code, not with JBuilder. The fact that it doesn't work in Netbeans seconds this.
Maybe you can post the code if it's not too large!?
About the textures: Please check their width again. jPCT checks for the width in a switch-case statement. Supported widths are 8,16,32,64,128,256,512,1024,2048,4192. Everything else will be scaled down (or up) to 256. The same is true for the height.

Albareth

  • Guest
JBuilder - Need Help with jPCT!!!
« Reply #11 on: January 01, 2004, 04:44:12 pm »
Well, I got the code working...  It was a fault in the initialization of the frame...  And my DreadHull texture has a size of 1024x1024, same with DreadHullSpec...

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
JBuilder - Need Help with jPCT!!!
« Reply #12 on: January 01, 2004, 05:16:44 pm »
Quote from: "Albareth"
Well, I got the code working...  It was a fault in the initialization of the frame...  And my DreadHull texture has a size of 1024x1024, same with DreadHullSpec...
Great that you got it working.. :D
Can you upload the texture somewhere or just send it to me by eMail? I can't think of a single reason for the rescaling other than that the width is NOT 1024, but i would like to see for myself. I can't reproduce this problem and looking at jPCT's texture loading code, i can't find a potential problem in it.

Albareth

  • Guest
JBuilder - Need Help with jPCT!!!
« Reply #13 on: January 01, 2004, 10:39:42 pm »
Well, the texture error is gone.  I guess I must have mistyped typed the texturefile, for the originals (set at 640x480) are in the same directory.  Thanks for the help.