Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Force Sync on Graphics2D?

  1. #1
    Junior Member
    Join Date
    Apr 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Force Sync on Graphics2D?

    I'm sure this has been asked before, but I couldn't find any straightforwards information about the subject.

    I'm currently working on making a 2D game using Java2D and I'm using a simple 60fps main-timer and a paint() method with a custom double buffer, and I noticed that at certain points, especially when the computer is under load they can slow down and/or get out of sync for a short while and the results mess up the game flow.

    Is there any way to prevent this by forcing graphics sync similar to a commercial game where lack of horsepower will simply lower the "fps" instead of slowing down the game?

    I apologize that I couldn't formulate the question better, I'm rather new to making games. (even simple ones)
    Other suggestions on how to prevent this would obviously be very welcome.

    Not sure if this forum is the right one, but it seemed the most suitable.
    Thanks in advance.

    Also posted on: Java-Forums.org
    Last edited by Gerp; April 13th, 2011 at 09:07 PM.


  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,318
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: Force Sync on Graphics2D?

    This thread has been cross posted here:

    http://www.java-forums.org/java-2d/42378-force-graphics-sync.html

    Although cross posting is allowed, for everyone's benefit, please read:

    Java Programming Forums Cross Posting Rules

    The Problems With Cross Posting


  3. #3
    Junior Member
    Join Date
    Apr 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Force Sync on Graphics2D?

    Thanks, I've directed both posts to each other.

Similar Threads

  1. java graphics2d issue
    By nana-j13 in forum What's Wrong With My Code?
    Replies: 2
    Last Post: September 15th, 2010, 03:49 PM
  2. JScrollpane - Force autoscroll to top
    By nasi in forum AWT / Java Swing
    Replies: 8
    Last Post: April 18th, 2010, 07:13 PM
  3. Problem with Brute Force
    By mortis1572 in forum File I/O & Other I/O Streams
    Replies: 0
    Last Post: March 14th, 2010, 09:52 AM
  4. sync two diffrent kind of threads?
    By adamruss in forum Threads
    Replies: 1
    Last Post: January 10th, 2010, 08:59 PM
  5. Replies: 1
    Last Post: November 14th, 2008, 03:00 PM