Overview for Processing/Java users moving to OpenFrameworks


#1

Hey guys, I’ve been working with zach lieberman’s help on a tutorial/overview for those of you who are processing or java pros moving to openframeworks. It’s sort of a massive list of things that I feel like would be helpful to know when moving to OF. It’s not really a tutorial, but an explanation of things that are different or new about coding in c++ with an IDE.

It’s definitely a work in progress and I’m sure I made some mistakes in there, so I was hoping I could get some feedback on it. Also, any questions/problems that you have encountered would be helpful so that I can expand the document, and hopefully answer some questions that you might have.

Thanks, and I hope this helps some people out.

anyway, heres the link:

http://wiki.openframeworks.cc/index.php-…-sing-users


#2

Wow - looks great.
There are a ton of people who could benefit from this.

Going to send it out now :slight_smile:

Theo


#3

nice explanation of * and &
I have a friend who would totally dig this guide.

BTW: There is a lot in C++ that feels like implicit conversions. I am thinking of all the APIs that overload the assignment operator or have converting constructors. Also the example with printf is funny because if you use the c++ typical cout then you do have implicit conversion.


#4

awesome. thanks guys. Yeah I hope that people get some good use out of it. I feel like it still has a while to go though. There are just sooo many topics to be covered.
Thanks for the comment on &*. I felt like bringing it down to the basics would make it easier to learn. When you hit people in the face with all the crazy complicated stuff you can do with referencing/dereferencing it can be pretty overwhelming. :confused:

Yeah I hope that zach/theo include iostream at a low level, but if they dont I might put in a section about it. Actually, zach helped me with that code snippit as i never use printf, cout is way more convenient, especially with the implicit conversions.

Yeah there are a lot of places where things are nice and implicit, maybe I should make a note of that in the overview, and just say that you should assume its not going to be implicit, or at least explain how to recognize conversion errors in case you are assuming implicit conversion.


#5

looks very good

some other things that trip people up:

– background in p5 / OF being different
– fill / noFill being different
– textures / ofImage / OF objects that have textures. what to use where and why…
– update gets called repeatedly, don’t put heavy stuff there
– speeds of things very dependent on opengl (ie, texture upload is slow, texture draw = fast)
– c++ errors are related to the process, good to know that: preprocessor, processor, linker
– common errors that java heads wouldn’t have to think about (ie java would tell them) – array access, accessing a null object, etc. common errors list would be really helpful (ie, off by one in array access, calling unallocated object, deleting an object twice, etc)
– how to do object oriented, how OOP is done in processing IDE (both ways .pde and .java), and esp the idea of inner classes, some people might be used to creating classes that are .pde files so have access to all “p5” variables, like mouseX, etc. this is not “true” oop.
– what is a debugger and why is it useful / great, etc
– how to read error reports / compile reports

also maybe some examples of taking simple and not simple p5 projects and porting them, what are some of the differences? I know stefan’s doing that now with some p5 applets, and maybe can talk about that process.

great work, it’s going to be a very useful guide for many folks!

take care
zach


#6

Thought I’d give an update on my p5->OF tutorial.
( http://wiki.openframeworks.cc/index.php-…-ng-junkies. )

I’ve added a few sections since i last posted it:

# 1.7 PImage, updatePixels() vs. ofTexture, pixels[]

* 1.7.1 How are pixel values stored without a Color object?

# 1.8 Common Problems With C++ / Misc. Topics

* 1.8.1 Expecting implicit data conversion?
* 1.8.2 Changing window size
* 1.8.3 Update() and Draw()?
* 1.8.4 How in the world do I print to the console?
o 1.8.4.1 printf
o 1.8.4.2 iostream
* 1.8.5 Smoothing not working on filled shapes?
* 1.8.6 Displaying video problem (feature) related to ofSetColor
* 1.8.7 Processing background() vs. OF ofBackground()
* 1.8.8 ofFill() / ofNoFill() vs. processing fill() noFill()
* 1.8.9 Math functions, and where they come from (no more Math.*)
o 1.8.9.1 cmath
o 1.8.9.2 ofConstants
o 1.8.9.3 ofMath
* 1.8.10 Structs, what are they for, and how can we use them?
* 1.8.11 Memory Management and You
* 1.8.12 Basic Logic Problems
* 1.8.13 accidental breakpoints in Xcode and Why Having a Debugger Rocks

So i guess i’m just looking for feedback on those things, anc anything else that you think might be worthwhile to have in there.
c++ error lists are something that I would like to have eventually, but its really complicated to try and compile a list of things like that short of trying to make every possible thing go wrong.

I was kind of hoping maybe you all who are compiling in xcode could help me by writing down what kind of error you got and what xcode said or what the error caused to happen? I’m not sure how to do it all myself


#7

Hi Zach_gate do you have the active link of this tutorial?

Cheers,

Patrick