openframeworks/openFrameworks — pull request #2324 by ofTheo (2013-07-22 15:02:20+00:00)
Title: feature: added ofEnableAntiAliasing / ofDisableAntiAliasing

Allows you to set anti-aliasing on or off without the window handle in main.cpp.
Implemented for GLUT and GLFW window.

If people are okay with this, I can add it to ofxiOS too.

The reason we need this is that we currently can't have AA disable for some core examples because it requires us to expose the type of window we are using Raspberry PI / other devices need a different window handle.

Tested for OS X GLFW and GLUT - AA on and off with different sampling ( 0, 2, 4, 8, 16 )
Works great. Might need nix / win testing.

Example disabling AA which is on with default GLFW window:

```
#include "ofMain.h"
#include "testApp.h"

//========================================================================
int main( ){

ofDisableAntiAliasing();
ofSetupOpenGL(1024,768, OF_WINDOW);	// <-------- setup the GL context

// this kicks off the running of my app
// can be OF_WINDOW or OF_FULLSCREEN
// pass in width and height too:
ofRunApp( new testApp());

}

```

Example using Glut window ( non default ) and enabling AA for both mac / nix / pc:

```
#include "ofMain.h"
#include "testApp.h"
#include "ofAppGlutWindow.h"

//========================================================================
int main( ){

ofAppGlutWindow * window = new ofAppGlutWindow();

ofEnableAntiAliasing(4);
ofSetupOpenGL(window, 1024,768, OF_WINDOW);	// <-------- setup the GL context

// this kicks off the running of my app
// can be OF_WINDOW or OF_FULLSCREEN
// pass in width and height too:
ofRunApp( new testApp());

}
```