iDevGames Forums
Deprecated attributes - Printable Version

+- iDevGames Forums (
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Graphics & Audio Programming (/forum-9.html)
+--- Thread: Deprecated attributes (/thread-11538.html)

Deprecated attributes - VanceRegnet - Dec 8, 2014 07:26 PM

Hello friends, I'm new to this forum and search for code, because I have
only little experience with OpenGL.
I found the thread
"When to create custom OpenGL view instead of subclass NSOpenGL view"
on Oct 13, 2009 — 10:36 PM from Coyote and I think this code fits my needs. Implementing brought no errors, but two warnings:
'NSOpenGLPFAWindow' is deprecated: first deprecated in OS X 10.9'
'NSOpenGLPFASingleRenderer' is deprecated: first deprecated in OS X 10.9'
In the documentation these attributes appear not as deprecated.
My question is : Are they needless now ?
For an answer thank you in advance.

RE: Deprecated attributes - arekkusu - Dec 9, 2014 12:01 AM

Those attributes have never been needed:

* NSOpenGLPFAWindow limits the pixel format to renderers capable of rendering to a window. The other options (PixelBuffer, Fullscreen, Offscreen) were all deprecated earlier, making Window the only option left. Window is the default, so specifying none of the four options means Window.

* NSOpenGLPFASingleRenderer limits the pixel format to a single renderer. This is not useful; if you need to choose a specific renderer you can do that with NSOpenGLPFARendererID. But it is generally best if you make your application robust to renderer changes (i.e. dragging your window between two displays on a desktop with two GPUs, or on laptops with both discrete and integrated GPUs.)

FWIW, the online documentation and (with Xcode 6.1, 10.9 SDK) the option-click documentation and the cmd-click header clearly do mark these as deprecated.

Remember that in general**, the pixel format attributes limit your renderer selection. You can specify no attributes at all and get a perfectly useable pixel format (single color buffer only, all renderers on the system.)

** the exception to this is selecting offline (video card without a display attached) or low-power (laptop integrated GPU) renderers. Those are excluded by default, so you need to add an attribute to get them.

RE: Deprecated attributes - VanceRegnet - Dec 9, 2014 01:40 AM

Thank you, arekgusu, I'm glad to read you.

RE: Deprecated attributes - VanceRegnet - Dec 9, 2014 10:19 AM

Hi arekkusu, sorry I misspelled your name.
I have another deprecation warnings in my code, which do not seem useless.
gluLookAt(), gluErrorString(), GLUQuadric, gluNewQuadric(), gluSphere().

I did not found replacements, In the doc OPenGL Changes I red :
Removed GLUQuadric
Added GLUQuadric, I do not feel that is some kind of joke.

RE: Deprecated attributes - arekkusu - Dec 9, 2014 03:04 PM

That is a different flavor of deprecation. GLU (and other utility libraries such as GLUT which explicitly depend on fixed-function legacy OpenGL) are marked deprecated in 10.9.

The intended development direction is to use Core Profile GL, which is supported by all renderers in 10.8 and later. There are no direct API replacements for geometry utilities such as GLUquadric, glutSolidTeapot, etc -- the intended ("high performance") replacement is to calculate geometry meshes yourself into a VBO. (In GL4, tessellation shaders can be a similar replacement to the fixed-function evaluators, but are overkill for usually-static platonic-solid geometry.)

If you don't wish to adopt Core Profile, add -Wno-deprecated-declarations to your build flags and continue using GLU. It still works just fine.