Documentation

The Java™ Tutorials
Hide TOC
Full-Screen Exclusive Mode API全屏独占模式API
Trail: Bonus

Lesson: Full-Screen Exclusive Mode API课程:全屏独占模式API

by Michael Martak

Do you want to use high-performance graphics in the Java development environment? 您想在Java开发环境中使用高性能图形吗?Have you always wanted to program a game, but your images wouldn't move fast enough? 你是否一直想编写一个游戏,但你的图像移动速度不够快?Has your slide show program not worked properly because you had no control over the user's display resolution? 您的幻灯片放映程序是否因为无法控制用户的显示分辨率而无法正常工作?If you've been asking any of these questions, then the full-screen exclusive mode API, introduced in release 1.4, may be what you're looking for.如果您一直在问这些问题,那么在1.4版中引入的全屏独占模式API可能就是您想要的。

Full-Screen Exclusive Mode全屏独占模式
Full-screen exclusive mode is a powerful new feature that enables you to suspend the windowing system so that drawing can be done directly to the screen.全屏独占模式是一项功能强大的新功能,使您能够暂停窗口系统,以便可以直接在屏幕上绘图。
Display Mode显示模式
This section describes how to choose and set the display mode. 本节介绍如何选择和设置显示模式。It also discusses why you'd want to set the display mode in the first place.它还讨论了为什么要首先设置显示模式。
Passive vs. Active Rendering被动渲染与主动渲染
This section discusses the merits of passive and active rendering. 本节讨论被动渲染和主动渲染的优点。For example, painting while on the main event loop using the paint method is passive, whereas rendering in your own thread is active. 例如,在主事件循环上使用paint方法进行绘制是被动的,而在自己的线程中进行渲染是主动的。Active rendering tips are also listed.还列出了活动渲染提示。
Double Buffering and Page Flipping双缓冲和翻页
This section explains double buffering and introduces page-flipping, a double buffering technique available in full-screen exclusive mode.本节介绍双缓冲并介绍翻页,这是一种在全屏独占模式下可用的双缓冲技术。
BufferStrategy and BufferCapabilities
This section covers java.awt.image.BufferStrategy, a class that allows you to draw to surfaces and components without having to know the number of buffers used or the technique used to display them. 本节介绍java.awt.image.BufferStrategy,该类允许您绘制曲面和组件,而无需知道所使用的缓冲区数量或用于显示它们的技术。This section also reviews java.awt.BufferCapabilities, a class that can help you determine the capabilities of your graphics device.本节还将回顾java.awt.BufferCapabilities,该类可以帮助您确定图形设备的功能。
Examples例子
This page lists several full-screen exclusive mode examples.本页列出了几个全屏独占模式示例。

Previous page: Previous Lesson
Next page: Full-Screen Exclusive Mode