如何在Java中编程全屏模式? [英] How to program a full-screen mode in Java?

查看:157
本文介绍了如何在Java中编程全屏模式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望我的应用程序拥有全屏模式。什么是最简单的方法呢,我是否需要一个第三方库或者JDK中已经提供了这个功能? 解决方案 div>

试试全屏独占模式API 一>。它是在1.4版本的JDK中引入的。其中一些功能包括:



  • 全屏独占模式 - 可让您以暂停窗口系统,以便可以直接在屏幕上进行绘图。

  • 显示模式 - 由显示器的大小(宽度和高度,像素),位深度(每像素的位数)和刷新率(监视器自身更新的频率)。

  • 被动与主动渲染 - 绘画而在主事件循环中使用paint方法是被动的,而在你自己的线程中渲染是激活的。

  • 双缓冲和翻页 - 平滑绘图意味着更好感知性能和更好的用户体验。
  • BufferStrategy和BufferCapabilities - 允许您绘制曲面和组件的类,而无需知道所用缓冲区的数量或用于显示它们的技术,a nd帮助您确定图形设备的功能。

有几种全屏独占模式链接教程中的示例。


I'd like my application to have a full-screen mode. What is the easiest way to do this, do I need a third party library for this or is there something in the JDK that already offers this?

解决方案

Try the Full-Screen Exclusive Mode API. It was introduced in the JDK in release 1.4. Some of the features include:

  • Full-Screen Exclusive Mode - allows you to suspend the windowing system so that drawing can be done directly to the screen.
  • Display Mode - composed of the size (width and height of the monitor, in pixels), bit depth (number of bits per pixel), and refresh rate (how frequently the monitor updates itself).
  • Passive vs. Active Rendering - painting while on the main event loop using the paint method is passive, whereas rendering in your own thread is active.
  • Double Buffering and Page Flipping - Smoother drawing means better perceived performance and a much better user experience.
  • BufferStrategy and BufferCapabilities - classes that allow you to draw to surfaces and components without having to know the number of buffers used or the technique used to display them, and help you determine the capabilities of your graphics device.

There are several full-screen exclusive mode examples in the linked tutorial.

这篇关于如何在Java中编程全屏模式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆