如何处理不同计算机之间的Java 2D性能变化? [英] How to approach Java 2D performance variations between different computers?

查看:134
本文介绍了如何处理不同计算机之间的Java 2D性能变化?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经设计一个纸牌游戏中的Java在Windows上。它运行得很好我的笔记本电脑和其他几个人,但是在很多其他系统(甚至一些较新的Mac和Windows)的动画是慢得令人难以置信。

I've been designing a card game in Java on Windows. It runs really well on my laptop and a few others, but on a lot of other systems (even a few newer ones both Mac and Windows) the animation is incredibly slow.

我发现<一href="http://developer.apple.com/library/mac/#documentation/Java/Conceptual/Java14Development/04-JavaUIToolkits/JavaUIToolkits.html"相对=nofollow>用户界面工具包的Java 的是最好的资源,到目前为止,但一直没能做出显著的改善。我使用AWT / Swing的库。

I've found User Interface Toolkits for Java to be the best resource so far, but haven't been able to make a significant improvement. I'm using the AWT/Swing libraries.

问:
看着我的游戏,(小于的1.5Mb),怎么可能会在某些计算机(类似规格的)性能似乎是显著小于它是什么,我的笔记本电脑?整个应用程序是事件驱动的,我所做的大部分我想可以做给实施优化。

Question:
Looking at my game, (<1.5Mb), how could it be that on some computers (of similar spec) the performance seems to be significantly less that what it is on my laptop? The entire app is event-driven and I've done most of the optimization that I reckon could be done given the implementation.

我有一种感觉是内存相关。我创建了(兼容),然后我的所有图像保存到一个数组的开始,然后引用过来的。

I have a feeling it is memory-related. I create (compatible) and then store all my images into an array at the start, and then reference them there.

注:我决定做这个游戏,这样我可以学习和练习一些新的想法,所以我不只是想分享 - 我真的很感兴趣,找出哪些是怎么回事

推荐答案

在并非所有操作系统中,Java 2D渲染管线支持硬件加速的GPU。这取决于你使用的Java实现。

On not all operating systems, the Java 2D rendering pipeline supports hardware acceleration by the GPU. It depends on the Java implementation that you're using.

一对Oracle的Java SE 7实现的新功能(这是走出来的月底)是这样的:的 XRENDER管道的Java 2D 这意味着将有更好的表演2D图形在Linux上。

One of the new features for Oracle's Java SE 7 implementation (which is coming out at the end of the month) is this: XRender pipeline for Java 2D which means that it will have much better performing 2D graphics on Linux.

对于Windows,在Java SE 6 Update 10的有一些改进,使Java 2D表现的更好利用Direct3D硬件加速功能(的来源)。

For Windows, in Java SE 6 update 10 there were some improvements to make Java 2D perform better by using Direct3D hardware acceleration (source).

这篇关于如何处理不同计算机之间的Java 2D性能变化?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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