Mixing OpenGL and NS (2)
Mixing OpenGL and NS (2)
- Subject: Mixing OpenGL and NS (2)
- From: Valerio Ferrucci <email@hidden>
- Date: Wed, 22 Mar 2006 18:02:03 +0100
Does someone can give some help about "NSOpenGLCPSurfaceOrder"?
I tried it but with no success!
I did not understand the sample app "UnderlaySurface" (I never see
the opengl scene that should happen in background).
Thank for help
Il giorno 22/mar/06, alle ore 16:19, Valerio Ferrucci ha scritto:
Hi,
in the drawRect method of my NSOpenGLView I draw some openGL stuff
and then I want to draw a line on it (with NSBezierPath).
The problem is that the line is always covered by opengl and I
never see it.
Any help?
Follows the code:
- (void)drawRect:(NSRect)rect
{
// OpenGL
glClearColor(0,0,0,0);
glClear(GL_COLOR_BUFFER_BIT);
if (draggedIcon >= 0)
{ glColor3f(0.0f,1.0f,0.0f);
glBegin(GL_TRIANGLES);
glVertex3f(-1.0f,1.0f,0.0f);
glVertex3f(1.0f,1.0f,0.0f);
glVertex3f(0.,-1.,0.0f);
glEnd();
}
glFinish();
[[self openGLContext] flushBuffer];
// Cocoa: draw a line with NSBezier
NSRect bounds = [self bounds];
[[NSColor whiteColor] set];
[NSBezierPath setDefaultLineWidth: 4];
float h = bounds.size.height * 3 / 4;
NSPoint from = NSMakePoint(0, h);
NSPoint to = NSMakePoint(bounds.size.width, h);
[NSBezierPath strokeLineFromPoint:from toPoint:to];
}
==================================================================
Valerio Ferrucci Tabasoft Sas
email@hidden http://www.tabasoft.it
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40tabasoft.it
This email sent to email@hidden
==================================================================
Valerio Ferrucci Tabasoft Sas
email@hidden http://www.tabasoft.it
_______________________________________________
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