Correct way to draw lines?

Hey all,

I just downloaded the newest version of openframeworks (0.9.0) and am a bit embarassed that I’m not sure what the current data structure for holding lines is. It used to be ofLine(), but that seems to have become deprecated, with the preferred call being ofDrawLines. However, this has two issues:

  1. Visual Studio doesn’t appear to recognize this call either, even when I include ofGraphics. This may be a problem with the property sheet that I can correct.

  2. This doesn’t provide a structure for actually holding the line data, this just draws a line to the screen. I could use std::pair or std::vector to hold the data, but I felt like there was probably a more openFrameworks way to do it.

So I find myself a bit confused! What’s the best way to draw lines now?

thanks!

Hi there!

The methods have changed. You used to have ofLine, ofCircle, et cetera, and know is ofDrawLine, ofDrawCircle and so on.

Great!

Are these all in ofGraphics? Including ofMain.h in my file doesn’t seem to give me access to these functions, so I’m trying to figure out which includes I need.

thanks again!

ofPolyline or ofMesh are data structures that can hold a line. ofLine and now ofDrawLine only draw a line that’s why we changed the name so it’s more explicit what’s going on

Thanks; I’ll look into those!