Author Topic: polling problems  (Read 3242 times)

Offline fireside

  • double
  • *****
  • Posts: 607
    • View Profile
polling problems
« 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.
« Last Edit: February 14, 2008, 03:07:16 am by fireside »
click here->Fireside 7 Games<-

Offline fireside

  • double
  • *****
  • Posts: 607
    • View Profile
Re: polling problems
« Reply #1 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.   
click here->Fireside 7 Games<-