This is something that does not affect every system,... I have several systems that work just fine, but I would like to provide a fix for those that are having the problem.
- The main problem system is using an nvidia Quadro FX 4600 video card, so it's not a cheap integrated card.
- I've tried disabling Aero (running vista x64 here)
- drivers have all been updated
- tried disabling smoothing
I really need to run this in OPENGL, because the other modes are too slow, or do not support what I am drawing. (specifically textured quad strips)
Any suggestions?
edit: These are not my actual code, but something I have broken down to the bare minimum to hopefully show the problems I am having.
First, the extremely basic code. This will flicker on machines that exhibit the bug.
// trying to get rid of the flicker caused by using OPENGL // when you do not clear the screen each frame.
// this simple example will flicker on some machines
second, this will fix (slowly) the issue by copying the buffer at the end of each draw cycle, and pasting it at the beginning. How can I speed this up?
// trying to get rid of the flicker caused by using OPENGL // when you do not clear the screen each frame.
// this appears to fix the flicker, but is not very efficient PImage buffer;
import processing.opengl.*;
void setup(){ size(500,500,OPENGL); background(255); buffer = get(); // grab frame for the first loop through }
void draw(){ image(buffer,0,0); // start of draw cycle, draw last frame line(mouseX,mouseY,pmouseX,pmouseY); buffer = get(); // end of draw cycle, grab frame }
third,... now the "fix" does not work, because the drawing occurs in mouseDragged(). Any ideas how to get this to work?
edit: ok, this will work if I do the get() right after drawing the line inside mouseDragged(), but can anyone help speed this up at all?
// trying to get rid of the flicker caused by using OPENGL // when you do not clear the screen each frame.
// by moving the drawing into mouseMoved(),copying the buffer does not work,... why? PImage buffer;
I probably used the wrong terminology in my description, but here is what I am trying to do.
I want to set up 2 arraylists, one of points, and one of lines. The line class simply refers to 2 points. I've got this working, but I'm not sure I'm using the best syntax. Here is the section I am wondering about:
allPoints.add ( new myPoint (new PVector(random(width),random(height)) ) ); allPoints.add ( new myPoint (new PVector(random(width),random(height)) ) );
void mousePressed(){ allPoints.add ( new myPoint (new PVector(random(width),random(height)) ) ); allPoints.add ( new myPoint (new PVector(random(width),random(height)) ) );