www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: fireside on February 14, 2008, 02:31:28 am

Title: polling problems
Post by: fireside on February 14, 2008, 02:31:28 am
I can't seem to get keyboard polling working in the hello world program.  I copied the poll and keyaffected functions from the fps and have some variables.  I don't get errors on the program, but when I try to run it with the polling I get these errors:

Exception in thread "main" java.lang.NullPointerException
   at HelloWorldAWTGL.poll(HelloWorldAWTGL.java:92)
   at HelloWorldAWTGL.loop(HelloWorldAWTGL.java:56)
   at HelloWorldAWTGL.main(HelloWorldAWTGL.java:24)

OK I think it was null because I didn't include these lines:
       frame.addWindowListener(new WindowEvents());
       keyMapper=new KeyMapper(frame);   

but now I get an error on the WindowEvents() function saying it can't resolve it, so apparently I'm not importing something.
Title: Re: polling problems
Post by: fireside on February 14, 2008, 03:12:27 am
Nevermind, apparently I didn't need to do anything with WindowEvents, I just needed to add the keymapper to the frame, or vice versa, whatever.