Results 1 to 2 of 2

Thread: while loop is causing to many problems

  1. #1

    Thread Starter
    PowerPoster Halsafar's Avatar
    Join Date
    Jun 2004
    Location
    Saskatoon, SK
    Posts
    2,339

    while loop is causing to many problems

    Okay I got this applicatoin using Java2D up with fullscreen.
    It all works well, responds fine -- alt+f4 works, alt+tab works, KeyListener works fine reads Escape to quit as well.

    Now if I add a while loop (ie. the GameLoop), I get some nasty problems
    - alt+f4 fails till I alt+tab off the app
    - all key input the keylistener would pick up is not dealt with until I alt+tab out


    I am asking this here because I believe this may be the nature of Java, it is very thread heavy as far as I read. So maybe I have to split the FRAME creation and the GameLoop into seperate threads or something...

    I cannot believe how long I've been stumped on this, trying to get a bloody gameLoop running and still being able to alt+f4 or press Escape to close the app....
    "From what was there, and was meant to be, but not of that was faded away." - - Steve Damm

    "The polar opposite of nothingness is existance. When existance calls apon nothingness it shall return to nothingness." - - Steve Damm

    "When you do things right, people won't be sure if you did anything at all." - - God from Futurama

  2. #2
    New Member
    Join Date
    Oct 2002
    Location
    Saudi Arabia
    Posts
    8

    Re: while loop is causing to many problems

    - Use a second thread
    - Did you consider using a game engine?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width