Skip to main content
gamedev.net
🔒 Locked 🎮 Unity

[java] JavaOpenGL(JOGL) Problem

Started by ivve4 0 replies 850+ views
Original Post
ivve4
ivve4
Hello everyone! I have a problem. I am making a game in Java using JOGL. I have made a FrameMaster class that includes static funktion for making a basic JFrame: public class FrameMaster { private static JFrame theFrame=null; private static GLCanvas canvas; public static void CreateBasicFrame(GLEventListener e,float w,float h) { theFrame=new JFrame("JavaProject"); theFrame.setSize((int)w,(int)h); theFrame.setBackground(new Color(1,0,1)); theFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); theFrame.setTitle("THIS PROGRAM WILL SOON CRASH!"); //It CRASHES HERE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! canvas=new GLCanvas(); if(e!=null) canvas.addGLEventListener(e); if(canvas!=null) theFrame.add(canvas); Animator anim=new Animator(canvas); anim.start(); theFrame.setVisible(true); } It works fine on my computer, but when I move it fails when i move it to another maschine! After 2 hours testing I have detected where the program crashes. it does not give any error, it just ignores all the code that comes after canvas=new GLCanvas(); I have tried to write like: canvas=new GLCanvas(new GLCapabilities()); But it does not help? What am I doing wrong?
Glass_Knife
Glass_Knife
Welcome to Java. I deal with crap like this everyday.

1. Please put your source code in tags so it shows up in another window, like this: (Look at the FAQ for directions)

public class Cool {  public static void main( String[] args ) {  }}


2. Are you catching exceptions? I have had OpenGL code crash right to the desktop without throwing anything, but there has always been an error log on the desktop, or in the folder where the program was launched.

I will guess that the other computer does not have the correct libraries, but I am not sure. Please see if you can catch an Exception or find the error log and post that. It would help...

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.