Sign in to follow this  

Jogl in different class

This topic is 2574 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
hold.gl.doglstuff
swapbuffers
}
}


and I have my WindowClass

class WindowClass {
public GL gl;
WindowClass(){
//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 hold.gl 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

This topic is 2574 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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