• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

A problem about full-screen exclusive mode

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi everyone.
One of my friends is working on a program to test a LCD screen capability. In that program, some test screen patterns (like some BMPs) are drawn on the screen and switch between these patterns with frequency of 120Hz or 240Hz, depending on the frame rate of the video card. My friend did it with DirectX. He said that the pattern must be write into VGA memory directly in order to catch the speed of the frame rate of the video card. However, DirectX is not a cross-platform library. I am now trying to complete this in Java. Can Java complete this task?
 
Sheriff
Posts: 22798
131
Eclipse IDE Spring Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Technically it should be possible using GraphicsDevice.setFullScreenWindow, a javax.swing.Timer and either custom painting or a window-filling JLabel with the image. For 120Hz (120/s) the timer's delay should be 1000/120 which is about 8, and 1000/240 which is about 4. These might be too small to be accurately handled though.
 
Greenhorn
Posts: 21
Eclipse IDE Opera Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here's some code from a game that I'm currently writing, you might find it helpful. It uses a two buffer strategy and blits between them to avoid tearing. It also uses active rendering instead of waiting for repaint events which should help you control the frame rate. It keeps track of the frame rate, so that should help you make sure it's fast enough; just set the RenderThread.sleep() to 8 or 4 like rob said.

 
Marshal
Posts: 79698
381
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And welcome to the Ranch
 
Slideshow boring ... losing consciousness ... just gonna take a quick nap on this tiny ad ...
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic