Reputation: 1183
I have NSImage
, and I draw NSBezierPath
to it. After that I need to draw that NSImage on top of NSOpenGLView
to achieve result like that:
Is it possible, and how can I do it? NSImage
is ready, it only needs to be drawn on top of NSOpenGLView.
Upvotes: 1
Views: 797
Reputation: 23
I hope this help, I have the same problem using opengl. The solution for me was to change the surface order parameter of the context of the openglView
GLint order = -1; // below window
[context setValues:&order forParameter:NSOpenGLCPSurfaceOrder];
this will allow your top view to be drawn after opengl flushBuffer command;
this is the documentation form apple where i found this: https://developer.apple.com/library/mac/documentation/graphicsimaging/conceptual/opengl-macprogguide/opengl_contexts/opengl_contexts.html
Upvotes: 0
Reputation: 9392
Does this work?
NSImageView *imageView = [[NSImageView alloc] initWithFrame:your_frame_here]
[imageView setImage:image]; //Your Image
[openGLView addSubView:imageView];
Upvotes: 1