Java 2D Drawing Optimal Performance

前端 未结 9 1920
我寻月下人不归
我寻月下人不归 2020-12-04 09:46

I\'m in the process of writing a Java 2D game. I\'m using the built-in Java 2D drawing libraries, drawing on a Graphics2D I acquire from a BufferStrategy from a Canvas in a

9条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-04 10:45

    I've been watching this question, hoping someone would offer you a better answer than mine.

    In the meantime, I found the following Sun white paper which was written after a beta release of jdk 1.4. There are some interesting recommendations here on fine-tuning, including the runtime flags (at the bottom of the article):

    "Runtime Flag For Solaris and Linux

    Starting with the Beta 3 release of the SDK, version 1.4, Java 2D stores images in pixmaps by default when DGA is not available, whether you are working in a local or remote display environment. You can override this behavior with the pmoffscreen flag:

    -Dsun.java2d.pmoffscreen=true/false

    If you set this flag to true, offscreen pixmap support is enabled even if DGA is available. If you set this flag to false, offscreen pixmap support is disabled. Disabling offscreen pixmap support can solve some rendering problems. "

提交回复
热议问题