Hi!
I have roughly a six-month experince of programming Java and I’m finalizing my first bigger Java applet - a game using Java2D API. I have recently spent some time testing my applet on different computers. I use AffineTransform-class to scale and rotate images. I’m also filling Shapes with Texture paints, taking advantage of double buffering and animating with graphics2d. While testing I noticed my applet doesn’t work well on older computers. Then I got interested in possibilities of making my game run faster.
I’m aware that it’s possible to accelerate Java2D applications and applets with OpenGL. I suppose that enabling OpenGL in my applet
would make it run a lot faster.
I tried to enable OpenGL-rendering by putting the following line into init method:
System.setProperty("sun.java2d.opengl", "True");
And I’m getting
java.security.AccessControlException: access denied (java.util.PropertyPermission sun.java2d.opengl write)
The result is same whether I’m running applet in AppletViewer or in a browser. Is this just a security issue or does it require more advanced knowledge of graphics to enable OpenGL rendering in Java applets using Java2D? If it’s a security issue I’m also eager to hear solutions to that of a problem.
Any responses will be warmly welcomed…