Hardware accelerated bitmap drawing in java

I want to be able to draw sequential bitmaps (such as BufferedImage.TYPE_INT_RGB) video as fast as possible in java. I want to know the best method for doing this. Does anyone have any advice where I should start? From what I read, 2 options: 1) Use the GDI / GDI + routines in the JNI dll working with JAWT (Im on Windows) 2) Use Java3D and apply Textures to the Box face and rotate it to the camera

I am interested in any advice on these topics, as well as any others. I made a decent amount of GDI / GDI + programs in VB when I created an ActiveX control, so using GDI should be painless, but I assume that Java3D will use the GPU more (I could be wrong) and give better performance. What do you think? GDI and JAWT with my previous experience, or start and start a new API with Java3D. Thank you in advance.:)

+1
source share
1 answer

To get liquid animation (if that's what you want to get), you need to use double buffering. To do this, you will need to create a new java.awt.Image (or a subclass like BufferedImage, or if you want OpenGL accelerated processing, VolatileImage) for each frame that you want to display. If you have not already done so, call Image.getGraphics () to get the java.awt.Graphics object (it may also be useful to add your content to the image). In the end, when you finish the hidden image, call Graphics.draw () to replace the current display smoothly.

VolatileImage is OpenGL faster and much faster. When VolatileImage.getGraphics () is called, it actually returns Graphics2D, which is also part of the accelerated graphics pipeline.

It runs on Windows, Linux, and Solaris, but you need to install OpenGL drivers for your graphics card.

Some sitelinks include:

Accelerated Graphics Pipeline:

http://download.oracle.com/javase/1.5.0/docs/guide/2d/new_features.html

http://www.javalobby.org/forums/thread.jspa?threadID=16840&tstart=0

Double buffering:

http://www.java2s.com/Code/Java/2D-Graphics-GUI/Smoothmoveusingdoublebuffer.htm

http://www.heatonresearch.com/articles/23/page2.html

http://www.javacooperation.gmxhome.de/BildschirmflackernEng.html

+4
source

All Articles