How to get current renderer for an NSOpenGLView?
How to get current renderer for an NSOpenGLView?
- Subject: How to get current renderer for an NSOpenGLView?
- From: Duncan Champney <email@hidden>
- Date: Wed, 26 Mar 2008 17:54:00 -0400
I need to find out the amount of total VRAM and available VRAM in the
current renderer before creating a large renderbuffer object, to make
sure I don't choke the system in doing it.
I know how to find the current renderer for a given display, but I
want the current renderer for my NSOpenGLView. I can get to the core
graphics context like this:
//code is from my NSOpenGLView object, so self refers to an
NSOpenGLView
NSOpenGLContext* theContext = [self openGLContext];
void* the_CGLContext = [theContext CGLContextObj];
But that still doesn't get me to the renderer. What I want to to is
get a handle to the current renderer's CGLRendererInfoObj, then use
the call:
CGLDescribeRenderer (theRendererInfoObj, theRendererInex,
kCGLRPVideoMemory,
&deviceVRAM);
But I can't for the life of me figure out how to get from my
NSOpenGLView to the renderer's CGLRendererInfoObj. I don't want to
assume that the openGL view is on the main display, as all the example
code I can find does.
Can somebody help me here? I'm going in circles with the
documentation, and can't find an answer to this.
Thanks,
Duncan C
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden