so one other thing i came across i that when you create an offscreen drawing pane that is larger than the sketch, it seems to be impossible to draw anything that is larger than the actual sketch.
just run this in processing:
import codeanticode.glgraphics.*;
import processing.opengl.*;
you'll see that only a quarter of the ellipse in the graphicsGL object is visible, even though the background of all the 400x400 pixels is red.
i can't really figure out whats going on and why this is happening.... :(
anyways... i really enjoy using your library, thanks so much!
hansi.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
hey!
so one other thing i came across i that when you create an offscreen drawing pane that is larger than the sketch, it seems to be impossible to draw anything that is larger than the actual sketch.
just run this in processing:
import codeanticode.glgraphics.*;
import processing.opengl.*;
GLGraphicsOffScreen graphicsGL;
void setup(){
size( 200, 200, GLConstants.GLGRAPHICS );
graphicsGL = new GLGraphicsOffScreen( 400, 400, this );
graphicsGL.beginDraw();
graphicsGL.background( 255, 0, 0 );
graphicsGL.fill( 255 );
graphicsGL.ellipse( 200, 200, 200, 200 );
graphicsGL.endDraw();
}
int pos = -200;
void draw(){
background( 0 );
pos ++;
if( pos > 200 ) pos = -200;
image( graphicsGL.getTexture(), pos, 0 );
}
you'll see that only a quarter of the ellipse in the graphicsGL object is visible, even though the background of all the 400x400 pixels is red.
i can't really figure out whats going on and why this is happening.... :(
anyways... i really enjoy using your library, thanks so much!
hansi.
ok, i found a way to work around this:
import codeanticode.glgraphics.*;
import processing.opengl.*;
import javax.media.opengl.GL;
GLGraphicsOffScreen graphicsGL;
void setup(){
size( 200, 200, GLConstants.GLGRAPHICS );
graphicsGL = new GLGraphicsOffScreen( 400, 400, this );
graphicsGL.beginDraw();
((GL)graphicsGL.gl).glViewport( 0, 0, graphicsGL.width, graphicsGL.height ); // adapt the viewport
graphicsGL.scale( width/(float)graphicsGL.width, height/(float)graphicsGL.height ); // scale accordingly
graphicsGL.background( 255, 0, 0 );
graphicsGL.fill( 255 );
graphicsGL.ellipse( 200, 200, 200, 200 );
graphicsGL.endDraw();
((GL)graphicsGL.gl).glViewport( 0, 0, width, height ); // reset the viewport for the sketch
}
int pos = -200;
void draw(){
background( 0 );
pos ++;
if( pos > 200 ) pos = -200;
image( graphicsGL.getTexture(), pos, 0 );
}