Re: Printing an NSOpenGLView
Re: Printing an NSOpenGLView
- Subject: Re: Printing an NSOpenGLView
- From: Erik Buck <email@hidden>
- Date: Thu, 25 Aug 2005 08:02:48 -0700 (PDT)
OpenGL is NOT device independent. OpenGL drawing always effects a pixel buffer/bitmap. There is no easy or straight forward way to translate OpenGL drawing into vector commands to a printer or any other non-pixel-buffer type of device.
There are several options:
1) Draw to a bitmap of suitable size/resolution and just print the bitmap.
2) Convert OpenGL drawing commands into device independent drawing commands like PDF, Postscript, or Quartz 2D. However, the output will not look exactly like the on screen version [no WYSIWYG]
3) Write your own drawing API that uses OpenGL for pixel buffer drawing and something else for all other devices.
4) Use someone else's API that uses OpenGL for pixel buffer drawing and something else for all other devices.
I always say it like this:
- OpenGL worships speed over quality in all cases [even to the extent that OpenGL is sometimes useless due to poor quality]. Modern GL hardware is designed to work with only very specific pixel buffers, and the basic design of OpenGL is contrary to device independence.
- Quartz2D worships quality over speed in all cases [even to the extent that Quartz2D is sometimes useless due to poor speed]. Quartz2D is hardware accelerated only in specific circumstances such as rendering to a low resolution pixel buffer, and Quartz2D is so pure regarding device independence that many operations aren't optimized.
In response to the OP: I have never seen very satisfactory printed output from OpenGL particularly when alpha channels, lighting, fog, stencil buffers, etc. are used. It is hard to do better than a screen shot printed at an appropriate DPI.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden