• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

Jittery moving Image in Simulated Full Screen and windowed mode  RSS feed

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So, was testing different screen sizes for my game. The best screen size that I tested was the exclusive full screen mode in java API. But, I want to implement a SFS(Simulated Full Screen) and windowed mode in my game in case the client doesn't support exclusive full screen mode. The problem is, when I use a windowed or SFS my images get jittery when moving on the screen. In windowed and SFS I cap my game fps(Frame Per Second) to 60, In exclusive full screen mode I just run the update and draw methods without capping the fps because from what I've observed, it looks like java automatically caps my game fps to 60. When my game is running in exclusive full screen mode the images move smoothly as silk. However, In other screen mode, the images jitter when moving.

Question #1: How do I make my game run smooth in windowed and SFS mode? I tried various attempts like putting the main thread in edt(Event Dispatch Thread) and the problem still persist.

Question #2: Why my fps is capped at 60 fps when using exclusive full screen mode? I assume that's because my monitor rate is 60hertz or my graphics card display mode sets to 60hertz(1360 by 768,True Color (32 bit), 60 hertz). I tried to change the graphics card display mode to 1024 by 768 True Color (32 bit), 75 hertz and the fps is still capped to 60.

Question #3: when I run my game to other machine like a machine that's faster than mine e.g. a monitor with refresh rate of 144hz and a graphics card with display mode higher than my graphics card, does java still cap my game fps to 60 in that machine?

I hope someone could help me on this.

Here's the reference I used in Exclusive Full Screen Mode: https://docs.oracle.com/javase/tutorial/extra/fullscreen/index.html

Here is my test code

 
Elya Matsunomi
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

putting the main thread in edt(Event Dispatch Thread)




This is a typo, it should be: putting the while loop in the main thread in edt.

 
Hug your destiny! And hug this tiny ad:
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!