Benches iPhone

2

[ iPhone ] OpenGL ES glLineWidth()

apple Verified

Imported from the Apple Support Forums via the Wayback Machine 🔗

Hey guys,

Quick question: I'm using OpenGL on the iPhone and have code to set the width of rendered lines using glLineWidth(). This works great in the simulator but doesn't seem to work on an actual device.

I've searched the specification for OpenGL ES and it definitely should be functioning correctly. Anyone know i need to do anything special to get this feature to work on a device? Or if it's just not supported ( hopefully not )?

Thanks!

2 replies

Sign in or join Beachball Help to reply.

  1. 0

    Frogblast

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Is GL
    LINESMOOTH enabled? The iPhone does not support anti-aliased lines. If you query the SMOOTH
    LINE_WIDTHRANGE, it reports (1,1), which is kind of a hint that it doesn't work (ie, line widths are clamped to 1). Smoothed lines (and points) have long been a very inconsistent thing in OpenGL implementations, so the iPhone is not alone in having problems with it.

    See
    http://homepage.mac.com/arekkusu/bugs/invariance/index.html for an example of desktop GL renderers, and also some sample code on how to use Framebuffer Blending + Texturing to create fake smooth lines. Note, by 'fake', I mean 'much better quality than most built-in smoothed-line implementations', and perfectly portable as well (unlike lines themselves).

    Your other (easier) option is to use non-smoothed lines.

  2. 0

    BPerfetto

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Interesting.... GLLINESMOOTH is enabled. So if I disable GLLINESMOOTH they lines will look a little crappier but I'll get the glLineWidth() functionality back ( ie. I'll be able to render lines that have a width greater than 1 )?