}
//GLGraphics renderer = (GLGraphics)g;
PGraphics renderer = (PGraphics)g;
//if(useGLGRAPHICS)
//renderer.beginGL();
//if not in focus don't worry about running the draw loop
if(!focused && !GLOBAL.skchAutomatic.hasChairToProcess() && !firstLoop && !startingApp){
frameRate(1);
// return;
}else{
frameRate(120);
}
if(SETTINGS.autoReset && millis() - lastMouseMove > (SETTINGS.autoResetSeconds*1000)){
GLOBAL.uiTools.reset(null);
lastMouseMove = millis();
}
if(mouseX != pmouseX || mouseY != pmouseY)
lastMouseMove = millis();
GLOBAL.gui.update();
//SKetchGlobals
if ((GLOBAL.rotateModelsX != 0 || GLOBAL.rotateModelsY != 0))
GLOBAL.SketchGlobals.renderVolume = true;
else
GLOBAL.SketchGlobals.renderVolume = false;
GLOBAL.SketchGlobals.physicsEngineScale = GLOBAL.jBullet.scale;
GLOBAL.SketchGlobals.mousePressed = mousePressed;
if(width != GLOBAL.windowWidth || height != GLOBAL.windowHeight)
resize();
//renderer.noSmooth();
//make sure we always have a chair to edit
if (GLOBAL.sketchChairs.getCurChair() == null) {
SketchChair curChair = new SketchChair();
GLOBAL.sketchChairs.add(curChair);
}
//tittle images
if (GLOBAL.tittleImg != null || GLOBAL.myMovie != null) {
background(250, 250, 250);
renderer.imageMode(CENTER);
if (GLOBAL.myMovie != null) {
renderer.pushMatrix();
renderer.scale(1.6f);
// image(GLOBAL.myMovie,width/3.2f,height/3.2f);
renderer.popMatrix();
renderer.image(GLOBAL.clickToStart, width / 2, height - 25);
} else {
renderer.image(GLOBAL.tittleImg, width / 2, height / 2);
}
renderer.imageMode(CORNER);
renderer.image(UITools.SELECT_TOOL_CURSOR, mouseX - 10, mouseY - 8);
//mouse clicked
//if(mousePressed && !this.mouseDown && millis() > 1000){
if (pmouseX != mouseX && millis() - GLOBAL.inativeCounter > 3000) {
GLOBAL.tittleImageNum++;
if (GLOBAL.myMovie != null) {
//if(functions.fileExists("./introVideos/" + GLOBAL.tittleImageNum + ".mov"))
// GLOBAL.myMovie = new FasterMovie(this,"./introVideos/"+GLOBAL.tittleImageNum+".mov");
//else
// GLOBAL.myMovie = null;
} else {
if (functions.fileExists("./tittleImage/"
+ GLOBAL.tittleImageNum + ".jpg"))
GLOBAL.tittleImg = loadImage("./tittleImage/"
+ GLOBAL.tittleImageNum + ".jpg");
else
GLOBAL.tittleImg = null;
}
//reset the timeout counter
GLOBAL.inativeCounter = millis();
}
if (mousePressed)
this.mouseDown = true;
else
this.mouseDown = false;
return;
}
if (mouseY != pmouseY || mouseX != pmouseX)
GLOBAL.inativeCounter = millis();
//if (millis() - GLOBAL.inativeCounter > GLOBAL.timeoutCounter) {
/*
setup();
GLOBAL.tittleImageNum = 0;
GLOBAL.inativeCounter = millis();
GLOBAL.myMovie = new FasterMovie(this,"./introVideos/"+GLOBAL.tittleImageNum+".mov");
GLOBAL.myMovie.loop();
//GLOBAL.tittleImg = loadImage("./tittleImage/" + GLOBAL.tittleImageNum + ".jpg");
*/
//}
GLOBAL.windowWidth = width;
GLOBAL.windowHeight = height;
if (!GLOBAL.performanceMode) {
}
UI.toggleButtons();
float cameraY = (float) (height/2.0);
float fov = (width) * PI/2;
float cameraZ = 0;
float aspect = (width)/(height);
if (mousePressed) {
aspect = (float) (aspect / 2.0);
}
//LOGGER.info(width + "width");
//renderer.ortho();
/*
if(useGLGRAPHICS){
ortho(-(int)(width / 2), (int)(width / 2), -(int)(height / 2), (int)(height / 2),
-1000, 1000);
//renderer.translate((width /2), (height / 2));
//renderer.ortho();
}else{
renderer.ortho(-(int)(width / 2), (int)(width / 2), -(int)(height / 2), (int)(height / 2),
-1000, 10000);
}
*/
renderer.ortho(-(int)(width / 2), (int)(width / 2), -(int)(height / 2), (int)(height / 2),
-10000, 10000);
//renderer.hint(PApplet.DISABLE_STROKE_PERSPECTIVE);
//frustum();
//camera();
//perspective();
//GLOBAL.uiTools.pickBuffer.background(255);
renderer.noFill();
renderer.strokeWeight(2);
//GLOBAL.uiTools.update();
UI.updateMouse(mouseX, mouseY, pmouseX, pmouseY, mousePressed,
mouseButton);