openframeworks/ofBook — pull request #88 by bakercp (2014-10-11 02:43:10+00:00)
Title: Edits and comments for intro-to-graphics.

Hey @mikewesthad really nice chapter.

I included a few edits and also propose these comments:

- Note the limitations of `ofSetLineWidth()` (in openGL 3.2+ has no effect `glLineWidth(...)`).
- In recent versions of openFrameworks, anti-aliasing is enabled by default.
- `ofSetCircleResolution(...)` and `ofSetCurveResolution(...)` would probably be as (or more) valuable to cover as that is the source of much "jagginess".
- I would prefer to encourage `ofGetMouseX()` and `ofGetMouseY()`, rather than the Processing-inspired `mouseX` / `mouseY` (we've talked about deprecating these public convenience variables in the roadmap conversations.
- For mouse button presses -- you use the `mousePressed(...)` methods later in the chapter, so you may have set your earlier example like this intentionally ...

```c++
void testApp::mousePressed(int x, int y, int button){
if (button == OF_MOUSE_BUTTON_LEFT) isLeftMousePressed = true;
}

void testApp::mouseReleased(int x, int y, int button){
if (button == OF_MOUSE_BUTTON_LEFT) isLeftMousePressed = false;
}
```

But for the first simple example, couldn't you just do this to keep it simple?

```c++
void draw()
{
if (ofGetMousePressed(OF_MOUSE_BUTTON_LEFT))
{
ofSetColor(255);
ofSetRectMode(OF_RECTMODE_CENTER);
ofRect(mouseX, mouseY, 50, 50); // Draw a 50 x 50 rect centered over the mouse
}
}
```

- Why the odd formatting in the section (xOffset, yOffset) values of (-40, -40), (40, -40), (40, 40), (-40, 40)
- I would avoid introducing radians, PI etc (a graphics intro chapter ) and use `ofToRadians(360)` for the intro chapter.
- In `ofColor` mention the predefined colors `ofColor::yellow`, etc. Our poor little raspberry pi compilers work so hard to process those templates :)!
- At some point you mention the `/bin/data` folder -- that makes it look like an absolute path ...

Nice work!