Skip to main content

Hardware Acceleration Questions

1 reply [Last post]
Anonymous

Here's hoping someone has some clue...

I am using Beta 2 of Tiger and have some questions about Hardware Acceleration...

1). At JavaOne I was told that BufferedImage was Hardware Accelerated. Is this true for all instances of BufferedImage (even those created by ImageIO)? If so, how come I am not getting a true value (ever) when I do a image.getCapabilities(g.getDeviceConfiguration()).isAccelerated()? Is there something I need to do to get this image to be accelerated?

2). Is it not possible to create a page flipping BufferStrategy for a non-fullscreen window?

Glen

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
campbell
Offline
Joined: 2003-06-24

Hi Glen,

> 1). At JavaOne I was told that BufferedImage was
> Hardware Accelerated. Is this true for all instances
> of BufferedImage (even those created by ImageIO)? If
> so, how come I am not getting a true value (ever)
> when I do a
> image.getCapabilities(g.getDeviceConfiguration()).isAc
> celerated()? Is there something I need to do to get
> this image to be accelerated?
>

Yes, all BufferedImages are now considered "managed" (including those created using IIO), which means that they have the potential to be accelerated in hardware. For more information about managed images, see Chet's related blog entries:
http://weblogs.java.net/pub/wlg/385

An image won't be accelerated in hardware (typically) until after it has been rendered to an accelerated surface more than once. For example, after you do something like:
BufferedImage bi = new BufferedImage(...);
g.drawImage(bi...);
g.drawImage(bi...);
where g is assumed to be the Graphics from a Swing component, bi.isAccelerated() should return true. If that's not the case, there may be something else in your configuration that is preventing the image from being accelerated (lack of VRAM, for example).

> 2). Is it not possible to create a page flipping
> BufferStrategy for a non-fullscreen window?
>

On Windows, page flipping is not available for a non-fullscreen window. (I believe this actually a limitation of DirectX; the OpenGL-based pipeline in 5.0 will give you page flipping in a window...)

Chris