CWT - An AWT/Swing Architecture for Cross-Platform Java Game Development

博士 === 國立交通大學 === 資訊科學與工程研究所 === 97 === In recent years, the performance of Java platforms has been greatly improved, which makes Java satisfy the requirements for developing games. However, after practicing in real game development, we observe that a phenomenon of performance inconsistency exists i...

Full description

Bibliographic Details
Main Authors: Wang, Yi-Hsien, 汪益賢
Other Authors: Wu, I-Chen
Format: Others
Language:en_US
Published: 2009
Online Access:http://ndltd.ncl.edu.tw/handle/51499901965107413592
Description
Summary:博士 === 國立交通大學 === 資訊科學與工程研究所 === 97 === In recent years, the performance of Java platforms has been greatly improved, which makes Java satisfy the requirements for developing games. However, after practicing in real game development, we observe that a phenomenon of performance inconsistency exists in the graphics of Java AWT/Swing with different combinations of JREs, graphics APIs, system properties, and operating systems (OSs), including Windows XP, Windows Vista, Fedora and Mac OS X. This phenomenon makes it hard to predict the rendering performance of Java games and weakens the merits of the Write-Once-Run-Anywhere feature of Java. In order to solve the above problems, we propose a portable AWT/Swing architecture, called CYC Window Toolkit (CWT), for developing cross-platform Java games with high and consistent rendering performance. CWT has the following features. First, the CWT architecture supports multiple graphics libraries such as AWT, DirectX and OpenGL, multiple virtual machines such as Java VM and .NET CLR, and multiple OSs. Next, CWT supports AWT/Swing 1.1 compatible widgets, so it can be easily applied to existing Java games. For programmers who want to fine tune their games, CWT supports one-to-one mapping APIs to directly manipulate DirectX and OpenGL objects and other game-related properties. In addition, CWT supports interoperability with 3D applications, which is an important feature for 3D game design. We implemented three versions of CWT – AWT, DirectX, and OpenGL, to take advantage of graphics hardware acceleration on all supported OSs. The implementations of CWT are available on our website (http://java.csie.nctu.edu.tw/cwt/) [15]. Two testing programs, including micro-benchmark and macro-benchmark, are also designed to evaluate the rendering performance of the original Java AWT/Swing and CWT. The benchmarking results show that CWT achieves more consistent and higher rendering performance than Java AWT/Swing does in commonly used JRES, including MSVM and JREs 1.4 to 1.6, on the four OSs. Moreover, CWT needs fewer efforts to test the combinations of graphics APIs and system properties, which greatly improves programmers’ productivity. Based on the benchmarking results and our experience, we propose three approaches to make Java be a better platform for developing cross-platform games in the future. First, since the video hardware evolves quickly, Java should open direct access to the internal DirectX and OpenGL objects for game programmers who need to access up-to-date hardware features or change the rendering behaviors. Second, Java should decouple the rendering pipelines of Java AWT/Swing from the JREs for faster upgrading and supporting old JREs. Third, Java should reuse existing DirectX and OpenGL bindings for lower developing cost, better maintainability, easier interoperability among Java AWT/Swing, Java 3D, and JOGL applications.