Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (538)
Games in Android Showcase (132)
games submitted by our members
Games in WIP (601)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  An unexpected exception has been detected in nativ  (Read 1150 times)
0 Members and 1 Guest are viewing this topic.
Offline sss

Senior Newbie




Java games rock!


« Posted 2003-09-18 15:49:56 »

The following pretty simple program blows up with an exception in the VM.  All the code does is draw a cube and if you click in the window it opens another window with another cube.

Any idea how to get around this problem?

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

import net.java.games.jogl.*;
import net.java.games.jogl.util.GLUT;

public class Cube {
     public static void main(String[] args) {
           Cube c = new Cube(0, 0);
     }
     
     public Cube(int x, int y) {      
           Frame frame = new Frame("Cube Demo");      
           GLCanvas canvas = GLDrawableFactory.getFactory().createGLCanvas(new GLCapabilities());
           canvas.addGLEventListener(new CubeRenderer());
           frame.add(canvas);
           frame.setSize(300, 300);
           frame.setLocation(new Point(x,y));

           frame.addWindowListener(new WindowAdapter() {
                 public void windowClosing(WindowEvent e) {
                   System.exit(0);
                 }
             });
           frame.show();
     }
     
static class CubeRenderer implements GLEventListener, MouseListener{
     int x=0, y=0;
     public void init(GLDrawable drawable) {
       GL gl = drawable.getGL();
       gl.glClearColor(0,0,0,0);
       
       drawable.addMouseListener(this);
     }
     
     public void reshape(GLDrawable drawable, int x, int y, int width, int height) {
           GLU glu = drawable.getGLU();
           GL gl = drawable.getGL();
           gl.glViewport(x, y, width, height);
           gl.glMatrixMode(GL.GL_PROJECTION);
           gl.glLoadIdentity();
           
           if(width>height)
                 gl.glOrtho(-(double)width/height, (double)width/height, -1, 1, -1, 1);
           else
                 gl.glOrtho(-1, 1, -(double)height/width, (double)height/width, -1, 1);

           gl.glMatrixMode(GL.GL_MODELVIEW);
     }

     public void display(GLDrawable drawable) {      
           GL gl = drawable.getGL();
           GLUT glut = new GLUT();
           gl.glClear(GL.GL_COLOR_BUFFER_BIT);
           gl.glColor3d(1, .25, .75);

           gl.glPushMatrix();
                 glut.glutSolidCube(gl, 1);
           gl.glPopMatrix();
     }
     
     public void displayChanged(GLDrawable drawable, boolean modeChanged, boolean deviceChanged) {}
     
     public void mouseEntered(MouseEvent e) {}
     public void mouseExited(MouseEvent e) {}
     public void mousePressed(MouseEvent e) { }  
     public void mouseReleased(MouseEvent e) {}
     public void mouseClicked(MouseEvent e) {new Cube(x+=100, y+=100);}
 }
}


An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x69350594
Function=DrvSetContext+0xF0874
Library=C:\WINDOWS\System32\atioglxx.dll

Current Java thread:
     at net.java.games.jogl.impl.windows.WGL.wglCreateContext(Native Method)
     at net.java.games.jogl.impl.windows.WindowsGLContext.choosePixelFormatAndCreateContext(WindowsGLContext.java:296)
     at net.java.games.jogl.impl.windows.WindowsOnscreenGLContext.create(WindowsOnscreenGLContext.java:204)
     at net.java.games.jogl.impl.windows.WindowsGLContext.makeCurrent(WindowsGLContext.java:117)
     - locked <0x10058138> (a net.java.games.jogl.impl.windows.WindowsOnscreenGLContext)
     at net.java.games.jogl.impl.windows.WindowsOnscreenGLContext.makeCurrent(WindowsOnscreenGLContext.java:110)
     - locked <0x10058138> (a net.java.games.jogl.impl.windows.WindowsOnscreenGLContext)
     at net.java.games.jogl.impl.GLContext.invokeGL(GLContext.java:162)
     - locked <0x10058138> (a net.java.games.jogl.impl.windows.WindowsOnscreenGLContext)
     at net.java.games.jogl.GLCanvas.reshape(GLCanvas.java:105)
     at java.awt.Component.setBounds(Unknown Source)
     at java.awt.BorderLayout.layoutContainer(Unknown Source)
     - locked <0x1050de98> (a java.awt.Component$AWTTreeLock)
     at java.awt.Container.layout(Unknown Source)
     at java.awt.Container.doLayout(Unknown Source)
     at java.awt.Container.validateTree(Unknown Source)
     at java.awt.Container.validate(Unknown Source)
     - locked <0x1050de98> (a java.awt.Component$AWTTreeLock)
     at java.awt.Window.show(Unknown Source)
     at JOGLstructuredArguments.Cube.<init>(Cube.java:28)
     at JOGLstructuredArguments.Cube$CubeRenderer.mouseClicked(Cube.java:73)
     at java.awt.Component.processMouseEvent(Unknown Source)
     at java.awt.Component.processEvent(Unknown Source)
     at java.awt.Component.dispatchEventImpl(Unknown Source)
     at java.awt.Component.dispatchEvent(Unknown Source)
     at java.awt.EventQueue.dispatchEvent(Unknown Source)
     at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
     at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
     at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
     at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
     at java.awt.EventDispatchThread.run(Unknown Source)

Dynamic libraries:
0x00400000 - 0x00407000       C:\Program Files\Java\j2re1.4.2\bin\javaw.exe
0x77F50000 - 0x77FF7000       C:\WINDOWS\System32\ntdll.dll
0x77E60000 - 0x77F46000       C:\WINDOWS\system32\kernel32.dll
0x77DD0000 - 0x77E5D000       C:\WINDOWS\system32\ADVAPI32.dll
0x78000000 - 0x78086000       C:\WINDOWS\system32\RPCRT4.dll
0x77D40000 - 0x77DC6000       C:\WINDOWS\system32\USER32.dll
0x77C70000 - 0x77CB0000       C:\WINDOWS\system32\GDI32.dll
0x77C10000 - 0x77C63000       C:\WINDOWS\system32\MSVCRT.dll
0x629C0000 - 0x629C8000       C:\WINDOWS\System32\LPK.DLL
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

rwatson462 (29 views)
2014-12-15 09:26:44

Mr.CodeIt (20 views)
2014-12-14 19:50:38

BurntPizza (40 views)
2014-12-09 22:41:13

BurntPizza (76 views)
2014-12-08 04:46:31

JscottyBieshaar (37 views)
2014-12-05 12:39:02

SHC (50 views)
2014-12-03 16:27:13

CopyableCougar4 (47 views)
2014-11-29 21:32:03

toopeicgaming1999 (114 views)
2014-11-26 15:22:04

toopeicgaming1999 (102 views)
2014-11-26 15:20:36

toopeicgaming1999 (30 views)
2014-11-26 15:20:08
Resources for WIP games
by kpars
2014-12-18 10:26:14

Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!