Slick Forums

Discuss the Slick 2D Library
It is currently Thu Jun 20, 2013 7:21 am

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Tue May 15, 2012 10:16 am 
Offline

Joined: Sun May 13, 2012 2:47 pm
Posts: 22
Hey, I am using two monitors for my computer, and when I play my game, as soon as I switch to another window, like Eclipse or FL-studio(Or any other program...) The game starts to lag when it gets unfocused, it looks really weird and awkward. Is there a way to fix it so it keeps going while the game is unfocused?

Thanks

_________________
Realistic graphics is for game designers without creativity.

Let's bring the wonder of technology into and cave and smash it so that we can have smashing cave technology!

The best way to learn about life is through death.


Top
 Profile  
 
PostPosted: Tue May 15, 2012 11:34 am 
Offline

Joined: Mon May 07, 2012 11:36 pm
Posts: 93
In your main class,

Code:
public static void main(String[] argv) {
      try {
         AppGameContainer app = new AppGameContainer(new Game());
         app.setDisplayMode(width, height, fullScreen);
         app.setAlwaysRender(true);
         app.start();
      } catch (SlickException e) {
         e.printStackTrace();
      }
   }


"app.setAlwaysRender(true); "

This allows the program to continue when it doesn't have focus :)


Top
 Profile  
 
PostPosted: Tue May 15, 2012 11:39 am 
Offline

Joined: Sun May 13, 2012 2:47 pm
Posts: 22
Everything that is so simple, may be so hard to achieve.

Thanks a lot! :D

_________________
Realistic graphics is for game designers without creativity.

Let's bring the wonder of technology into and cave and smash it so that we can have smashing cave technology!

The best way to learn about life is through death.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group