|
BigScreens / FreezingHack
If you are using openGL and/or running a lot of stuff in your app, your app could be freezing! Here is a solution that worked for Young and Rui. This changes MPE from syncing every single frame to syncing every "N" number of frames (in the code below, 15). Visually this works pretty well and you may consider using it. . . . The only person I noticed today who might need it is Hye Ki, but Jeremy if you go the openGL route, you may want to try this as well. 1) In setup(), add a "frameRate(15)" or maybe 30 2) Add a global variable: "count = 0" int count = 0; 3) Change frameEvent() to:
public void frameEvent(Client c){
//redraw();
count = 0;
loop();
}
4) Change the end of draw() to:
count++;
if (count == 15) {
noLoop();
client.done();
// do any broadcasting here
// client.broadcast(). . . . etc. . .
}
This would sync every 15 frames. You could also use a smaller number, but I don't recommend going much beyond 15. . . . Also, if you are using messaging, you will have a lag since you will only be broadcasting every N frames. |