Deprecated attributes

Nibbie
Posts: 3
Joined: 2014.12
Post: #1
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.
VR
Quote this message in a reply
Sage
Posts: 1,234
Joined: 2002.10
Post: #2
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.
Quote this message in a reply
Nibbie
Posts: 3
Joined: 2014.12
Post: #3
Thank you, arekgusu, I'm glad to read you.
VR
Quote this message in a reply
Nibbie
Posts: 3
Joined: 2014.12
Post: #4
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 :
glu.h
Removed GLUQuadric
Added GLUQuadric, I do not feel that is some kind of joke.
VR
Quote this message in a reply
Sage
Posts: 1,234
Joined: 2002.10
Post: #5
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.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Antialiasing and NSOpenGLView attributes Jar445 2 8,098 Jan 20, 2009 10:42 AM
Last Post: maximile
  DMGetNameByAVID deprecated in 10.4 AnotherJake 10 7,556 May 10, 2005 03:00 PM
Last Post: AnotherJake
  aglContext attributes problem Sta7ic 1 3,466 Nov 12, 2002 02:13 AM
Last Post: OneSadCookie