Quantcast
Channel: beginners - openFrameworks
Viewing all articles
Browse latest Browse all 4929

App doesn't auto clear every frame

$
0
0

@Majipan wrote:

Hi all, I am a beginner to OF, i am currently following this tutorial series on youtube:

In this particular short episode, it teaches how to draw an image and have it follow your mouse cursor. I followed the steps but instead of the image following my mouse cursor, it now duplicates and creates one instance every frame on my cursor’s xy coordinates.

void ofApp::draw(){
image.draw(ofGetMouseX(), ofGetMouseY());
}

I tried searching the forums, google, and can’t find anything on this(maybe wrong terminology?). I even tried using

ofSetBackgroundAuto(true);

on setup() but it doesn’t do anything. the image is a png. On OF_WINDOW the entire canvas kept blinking like its trying to refresh every frame but the duplicated images remained. On OF_FULLSCREEN the images remains on the screen. Any help would be appreciated. Thanks!

This is all I have on my ofApp.ccp:

void ofApp::setup(){
image.load(“image.png”); //loadImage has the same problem as well
}

//--------------------------------------------------------------
void ofApp::update(){

}

//--------------------------------------------------------------
void ofApp::draw(){
image.draw(ofGetMouseX(), ofGetMouseY());
}

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 4929

Trending Articles