Anti-aliasing on iOS

I’m new to oF and haven’t had much chance to play around with all the options available for iOS development. But is it possible to anti-alias shapes drawn with oF on iOS devices?

I know it’s possible on iOS4 (on iPhone 3GS+) using OpenGL but I’ve found it quite complicated to set up. Is there an easy way to enable anti-aliasing (multisampling) universally to all objects drawn in oF somehow? Perhaps using ofEnableSmoothing() or is it more complicated than that?

Thanks loads!
Paul.

Hi Paul,

It looks like anti-aliasing was added in this commit: https://github.com/openframeworks/openFrameworks/commit/94f362423e25de0d18282da2e99360dae6ac0b92 and that ofAppiPhoneWindow()->enableAntiAliasing(samples); may be the right call to enable anti-aliasing. https://github.com/openframeworks/openFrameworks/blob/master/addons/ofxiPhone/src/ofAppiPhoneWindow.mm

I haven’t tried it myself yet, but that should give you some direction.

-Seth

P.S. - Great to have you hear Paul. :slight_smile:

Great, I’ll investigate that method. Thanks loads Seth!

UPDATE: That did the trick, shapes looking all smooth now. The code from this example works a treat: https://github.com/openframeworks/openFrameworks/blob/master/apps/iPhoneExamples/fontsExample/src/main.mm

  
  
ofAppiPhoneWindow * iOSWindow = new ofAppiPhoneWindow();  
iOSWindow->enableAntiAliasing(4);  
iOSWindow->enableRetinaSupport();  
ofSetupOpenGL(iOSWindow, 480, 320, OF_FULLSCREEN);  
ofRunApp(new testApp);  
  

Excellent! I missed that example, good to know it’s there. :smiley:

Thanks for letting us know what worked.