Testing if machine can use transaccel flag

Is there a convenient way to test if a machine can use translucent acceleration through enabling the “transaccel” flag?

If I’m not wrong, setting the flag on a non-DirectX compatible video card on a PC results in thrown exceptions. And I’m not sure what would happen on a non-PC platform, though I suspect probably nothing.

Since system properties must be set before any AWT operations, benchmarking the application with translucent graphics won’t be viable.

Thanks in advance for any input.

I think you might be wrong here, I would expect it not to do anything. However, its only got to be DirectDraw compatible and I’m not sure where you’d find a card that isn’t. But then, I spose I don’t have that many cards :wink:

Whys that then? Couldn’t you quite happily not set them, profile, then set them and profile?

Kev

Specifically, it’s got to be Direct3D compatible since accelerated alpha composition uses that pipeline.

Well, I’ve tried running my app on a friend’s P3 800mhz laptop (using the on-board video, which I’m pretty sure doesn’t have 3D acceleration), and it crashes with a native error whenever it tries to draw a translucent image with the transaccel flag on.

I think you might have misunderstood what I’m trying to accomplish with my app.

What I want to have is a game that upon executing:

  1. Tests if the machine supports translucent image hardware acceleration

  2. Turns on translucent alpha compositing effects if the machine supports it

  3. Turns off translucent alpha compositing effects if the machine doesn’t support it

Ah ha, I thought by profiling you meant performance profiling :wink:

As to your friends laptop, I’ve run games with transaccel turned on, on lots of different laptops/desktops without any 3D on the card and they all work without errors. I’d be more suspecting of the graphics drivers in use on the laptop or a Java2D bug.

Kev

You can achieve the latter by launching each test in a new JVM.

[quote]You can achieve the latter by launching each test in a new JVM.
[/quote]
And how do I start a new JVM from within another JVM?

Seems like a lot of hassle for something that could be done with: GraphicsDevice.getAccelerationCapability() :-/

Thanks for the answers btw.

Yes, crashes like that are most likely to be caused by the drivers bugs (at least, starting from 1.4.2_03+).

What was the video board on the system where the crash occures? Ati has some buggy drivers, especially in earlier versions. Be sure to update to the latest driver.

If you want to check if the accelerated compositing loops are used, run your app with tracing turned on:
java -Dsun.java2d.trace=count -Dsun.java2d.translaccel=true YourApp
then quit the app and see if there are any D3DBlitLoops mentioned in the output.