We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › resize opengl window
Page Index Toggle Pages: 1
resize opengl window? (Read 655 times)
resize opengl window?
Apr 13th, 2010, 3:36pm
 
Hi all:

I'd like to be able to drag the window size of an OPENGL window, and I'm struggling. The following code works perfectly without OGL, but throws back an error:

Code:
'Exception in thread "Animation Thread" javax.media.opengl.GLException: Can not destroy context while it is current' 



Here's the code:
Code:
PVector mouseMove;
int myWidth = 200; int myHeight = 200;

import processing.opengl.*;

void setup()
{
size(myWidth, myHeight,OPENGL);
noStroke();
mouseMove = new PVector(mouseX,mouseY);
}

void draw() {}

void mousePressed() {
mouseMove.x = mouseX; mouseMove.y = mouseY;
}

void mouseDragged() {
mouseMove.x = mouseX-mouseMove.x; mouseMove.y = mouseY-mouseMove.y;
println(mouseMove);
myWidth += mouseMove.x; myHeight += mouseMove.y;
size(myWidth,myHeight,OPENGL);
frame.setSize(myWidth,myHeight);

mouseMove.x = mouseX; mouseMove.y = mouseY;
}


Thanks in advance!!
Re: resize opengl window?
Reply #1 - Apr 14th, 2010, 7:38pm
 
Hi guys, sorry to be a pest, but does anybody have any idea at all about this? Any little hint would be much appreciated. Thanks so much!
Page Index Toggle Pages: 1