Java3D in fullscreen mode?

Hi!

I’ve a problem with Java3D. When I want to start it in the fullscreen mode I get an exception:

An unexpected exception has been detected in native code outside the VM. 
Unexpected Signal : EXCEPTION_ACCESS_VIOLATION occurred at PC=0x10003690 
Function=[Unknown.] 
Library=(N/A) 

NOTE: We are unable to locate the function name symbol for the error 
      just occurred. Please refer to release documentation for possible 
      reason and solutions. 


Current Java thread: 
   at javax.media.j3d.Canvas3D.createContext(Native Method) 
   at javax.media.j3d.Renderer.doWork(Renderer.java:680) 
   - locked <031DB3C8> (a java.lang.Object) 
   at javax.media.j3d.J3dThread.run(J3dThread.java:250) 

Dynamic libraries: 
0x6D240000 - 0x6D245000    D:\J2SDK1.4.1_02\JRE\BIN\JAWT.DLL 

Local Time = Mon Apr 14 16:18:46 2003 
Elapsed Time = 6 
# 
# The exception above was detected in native code outside the VM 
# 
# Java VM: Java HotSpot(TM) Client VM (1.4.1_02-b06 mixed mode) 
#

But in the window-mode it works.

Here’s the code:

import java.awt.*; 
import java.awt.event.*; 

import com.sun.j3d.utils.universe.SimpleUniverse; 
import com.sun.j3d.utils.geometry.ColorCube; 
import javax.media.j3d.*; 

public class Full3D extends Frame { 
    
   Canvas3D canvas3D; 
   GraphicsConfiguration config; 
   GraphicsDevice device; 
    
   public Full3D() { 
      config = getGraphicsConfiguration(); 
      device = config.getDevice(); 
      canvas3D = new Canvas3D(config); 
      setUndecorated(true); 
      add(canvas3D); 
      setSize(320, 240); 
      addKeyListener(new KeyAdapter() { 
         public void keyPressed(KeyEvent e) { 
            System.exit(0); 
         } 
      }); 
      DisplayMode mode = new DisplayMode(320, 240, 16, 0); 
      try { 
         device.setFullScreenWindow(this); 
         device.setDisplayMode(mode); 
      } 
      catch(Exception e) { 
         e.printStackTrace(); 
         System.exit(1); 
      } 
      setVisible(true); 
      SimpleUniverse universe = new SimpleUniverse(canvas3D); 
      BranchGroup scene = new BranchGroup(); 
      ColorCube cube = new ColorCube(0.4); 
      Transform3D transform = new Transform3D(); 
      transform.rotX(4); 
      TransformGroup group = new TransformGroup(transform); 
      group.addChild(cube); 
      scene.addChild(group); 
      universe.getViewingPlatform().setNominalViewingTransform(); 
      universe.addBranchGraph(scene); 
   } 
    
   public static void main(String[] a) { 
      new Full3D(); 
   } 
}

Please help me and excuse me for my bad english.

Wiesi

It worked fine here (openGL java3d implementation).

I just had this “warning message”:


************************************************************************
*** ERROR: GraphicsConfiguration not created with GraphicsConfigTemplate3D
*** This will cause an IllegalArgumentException in a subsequent release
************************************************************************

What OS are you running on?

I know under linux using Sun’s JVM - Full Screen mode isn’t supported.

[quote]What OS are you running on?

I know under linux using Sun’s JVM - Full Screen mode isn’t supported.
[/quote]
I’m running it on Win98 and I use the DirectX-Java3D-implementation.

Wiesi

It looks like you need the J3D team assistance.

You better post this bug on the official Java3D mailing list:

How to Subscribe
http://java.sun.com/products/java-media/3D/forDevelopers/interest_group.html
View the E-Mail Archive
http://archives.java.sun.com/archives/java3d-interest.html

For directX, you need the

-Dsun.java2d.noddraw=true

commandline option. It’s documented somewhere.

Is it possible to find what version/3d interface of Java3D we are working with from inside a program?

In fact, it would have to be an installer wouldn’t it, capable of writing bat files to enable it to start under the right api options?

You can check to see if the Full Screen exclusive mode is supported by doing this


GraphicsDevice gDevice = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
   if(gDevice.isFullScreenSupported()){
         System.out.println("Full Screen Supported");
   }

[quote]For directX, you need the

-Dsun.java2d.noddraw=true

commandline option. It’s documented somewhere.
[/quote]
And how do I use this option?
Du sprichst Deutsch, oder?

Wiesi


java -Dsun.java2d.noddraw=true yourapp

Ja sicher :slight_smile:

Hi

I get the same exeption:

An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : EXCEPTION_ACCESS_VIOLATION occurred at PC=0x199E2F08
Function=[Unknown.]
Library=(N/A)

NOTE: We are unable to locate the function name symbol for the error
just occurred. Please refer to release documentation for possible
reason and solutions.

Current Java thread:
at javax.media.j3d.NativeConfigTemplate3D.choosePixelFormat(Native Method)
at javax.media.j3d.NativeConfigTemplate3D.getBestConfiguration(NativeConfigTemplate3D.java:79)
at javax.media.j3d.Renderer.doWork(Renderer.java:410)
at javax.media.j3d.J3dThread.run(J3dThread.java:250)

Dynamic libraries:
0x00400000 - 0x00406000 C:\Programme\Java\j2re1.4.1_01\bin\javaw.exe
0x77F80000 - 0x77FFF000 C:\WINNT\System32\ntdll.dll
0x77DA0000 - 0x77DFA000 C:\WINNT\system32\ADVAPI32.dll
0x77E70000 - 0x77F33000 C:\WINNT\system32\KERNEL32.DLL
0x77D30000 - 0x77D9F000 C:\WINNT\system32\RPCRT4.DLL
0x77E00000 - 0x77E65000 C:\WINNT\system32\USER32.dll
0x77F40000 - 0x77F7C000 C:\WINNT\system32\GDI32.DLL
0x78000000 - 0x78046000 C:\WINNT\system32\MSVCRT.dll
0x6D330000 - 0x6D45A000 C:\Programme\Java\j2re1.4.1_01\bin\client\jvm.dll
0x77540000 - 0x77571000 C:\WINNT\System32\WINMM.dll
0x6D1D0000 - 0x6D1D7000 C:\Programme\Java\j2re1.4.1_01\bin\hpi.dll
0x6D300000 - 0x6D30D000 C:\Programme\Java\j2re1.4.1_01\bin\verify.dll
0x6D210000 - 0x6D229000 C:\Programme\Java\j2re1.4.1_01\bin\java.dll
0x6D320000 - 0x6D32D000 C:\Programme\Java\j2re1.4.1_01\bin\zip.dll
0x6D000000 - 0x6D0FB000 C:\Programme\Java\j2re1.4.1_01\bin\awt.dll
0x777F0000 - 0x7780D000 C:\WINNT\System32\WINSPOOL.DRV
0x75DF0000 - 0x75E0A000 C:\WINNT\System32\IMM32.dll
0x77A40000 - 0x77B35000 C:\WINNT\system32\ole32.dll
0x19FE0000 - 0x1A002000 C:\Programme\Java\j2re1.4.1_01\bin\J3D.dll
0x693A0000 - 0x69467000 C:\WINNT\System32\OPENGL32.dll
0x6F9F0000 - 0x6FA10000 C:\WINNT\System32\GLU32.dll
0x72770000 - 0x727B6000 C:\WINNT\System32\DDRAW.dll
0x72810000 - 0x72816000 C:\WINNT\System32\DCIMAN32.dll
0x6D230000 - 0x6D235000 C:\Programme\Java\j2re1.4.1_01\bin\jawt.dll
0x6D180000 - 0x6D1D0000 C:\Programme\Java\j2re1.4.1_01\bin\fontmanager.dll
0x72D00000 - 0x72D73000 C:\WINNT\System32\D3DIM.DLL
0x1A330000 - 0x1A8FE000 C:\WINNT\System32\fgl1ogl.dll
0x77910000 - 0x77932000 C:\WINNT\system32\imagehlp.dll
0x72970000 - 0x7299D000 C:\WINNT\system32\DBGHELP.dll

0x68F30000 - 0x68F3B000 C:\WINNT\System32\PSAPI.DLL

Local Time = Sun Apr 20 17:01:36 2003
Elapsed Time = 16

The exception above was detected in native code outside the VM

Java VM: Java HotSpot™ Client VM (1.4.1_01-b01 mixed mode)

An error report file has been saved as hs_err_pid932.log.

Please refer to the file for further information.

but just if i use GraphicsConfiguration.getBestConfiguration(…);
if I make it like in the code from wiesi I get the well known
warning:


*** ERROR: GraphicsConfiguration not created with GraphicsConfigTemplate3D
*** This will cause an IllegalArgumentException in a subsequent release


PS: ich spreche auch Deutsch :wink:

bienator