Sign in to follow this  

Jogl in different class

Recommended Posts

I have my main class

public class mymain {
function main(){
//here i create a new of my window class
WindowClass hold = new WindowClass();

//drawing code here doesnt work at all

and I have my WindowClass

class WindowClass {
public GL gl;
//this works just fine
//sets up a frame canvas and gl context
gl = the gl i just setup

//if i put my drawing code here it works just fine

Now my problem is I try to draw a rectangle or do anything via it does nothing at all but if I use the exact same code inside my window class it works 100%. Is there somthing I am missing with opengl or do I have to make them friend (not sure what that means exactly) im just throwing stuff out there cause im not getting an error or anything it just seems like it ignores my drawing code.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this