Java:Linux中的图形 [英] Java: Graphics in Linux
问题描述
Cairo 是一个2D图形渲染库,可以在Java中使用,也可以在没有X11的情况下使用。它乍看起来好像应该可以为此场景配置它。您需要将其配置为使用OpenGL渲染,并提供合适的非X11 OpenGL实现(例如,使用'fbdev'设备驱动程序的MesaGL)。
SDLJava 是流行的C SDL游戏开发库的Java端口。这也应该能够做你所要求的,尽管它似乎从2005年以来没有更新过,所以如果你有任何问题,支持可能不会到来。
作为一种替代方案,你总是可以使用一些非常简单的C代码来打开和配置帧缓冲区,然后使用JNI将内存映射的帧缓冲区作为直接模式的ByteBuffer返回,以便直接进行绘制。 / p>
Does X-Windows have to be installed on a Linux-box in order for Java to display fullscreen graphics?
Other answerers appear to assume that "full screen graphics in Java" necessarily means "a working implementation of AWT". This is, of course, not necessarily true, as it is perfectly possible (some would even say desirable) to use Java without AWT.
Cairo is a 2D graphics rendering library that can be used from Java, and can also be used without X11. It looks at first glance as though it should be possible to configure it for this scenario. You'll need to configure it to use OpenGL rendering, and provide a suitable non-X11 OpenGL implementation (e.g. MesaGL with the 'fbdev' device driver).
SDLJava is a Java port of the popular C SDL game development library. This also should be able to do what you ask for, although it doesn't seem to have been updated since 2005 so if you have any problems with it support may not be forthcoming.
As an alternative, you could always use some fairly simple C code to open and configure the framebuffer, and then use JNI to return the memory-mapped framebuffer as a direct-mode ByteBuffer, so you can draw to it directly.
这篇关于Java:Linux中的图形的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!