+= bug

this int doesnt increase like it should. in the start it moves very slow and suddenly increases speed.

mac osx 10.4, xcode.


int xpos;


void testApp::setup(){




void testApp::update(){

xpos += 1;



void testApp::draw(){



The code you posted works fine for me.

I am on a Powerbook G4 Xcode 2.4.1 OS X 10.4

A couple of things it could be:
Set xpos to zero. There is no guarantee that its value will be zero if you don’t declare it.

So in

void testApp::setup(){  
  xpos = 0;  

It could be some sort of frame rate issue where when the app first launches the framerate is low and then it goes up.

What hardware are you on?

it still does the thing even when i declare it as 0.

im on a 2.0 ghz macbook. generation 2.1

fixed it with a ofSetFrameRate(60); . thank you


You might want to use ofSetVerticalSync(true); instead.
Will have the same result but it locks the apps refresh rate to your monitors refresh rate usually resulting in nicer looking animations.

smooth! looks good, of is nice!
btw i just noticed that on the documentation site if you press ofSetFrameRate() in the index you go to ofGetFrameRate()

oh cool - thanks!
I fixed it now - cheers.