NSOpenGLView - white line artifact
NSOpenGLView - white line artifact
- Subject: NSOpenGLView - white line artifact
- From: Michael Hanna <email@hidden>
- Date: Fri, 27 May 2005 13:05:35 -0400
Hello all,
Using the example code at
<http://homepage.mac.com/gstahl/FileSharing6.html> I copied and pasted
the methods from the BasicOpenGLView subclass to perform these
functions(---- Image Data Creation ---- and ---- Printing and copying
---- methods) into my own NSOpenGLView subclass. I had to override the
FirstResponder methods and perform a couple of connections in IB from
the -saveDocument and -print menu items to their corresponding
FirstResponder methods.
However whenever I copy, print or save, I get a horizontal white line
artifact ended with a pink pixel in the new bitmap. I made double-sure
that I wasn't writing the artifacts into the view and I'm certain they
appear as a result of the -copy, -print or -saveDocument methods. I'm
using 10.3.9 and XCode 1.5.
See the artifacts here:
http://siddha.ca/myimages/artifacts.png
The line length is proportional to the width of the view(1/4).
This also happens with a fresh project, compiling the BasicOpenGLView
class as-is and copying to the clipboard. I must be missing something
but I'm not sure what.
I also used the same +BasicPixelFormat method and the -initWithFrame
are identical. However the resizeGL, prepareOpenGL methods are
different (it's only two-dimensional):
- (void) resizeGL
{
NSRect rectView = [self bounds];
// ensure camera knows size changed
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluOrtho2D(rectView.origin.x,rectView.size.width,rectView.origin.y,
rectView.size.height);
glMatrixMode(GL_MODELVIEW);
glViewport((GLfloat)rectView.origin.x,
(GLfloat)rectView.origin.y,(GLfloat)rectView.size.width,
(GLfloat)rectView.size.height);
}
- (void) prepareOpenGL
{
long swapInt = 1;
[[self openGLContext] setValues:&swapInt
forParameter:NSOpenGLCPSwapInterval]; // set to vbl sync
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
}
best regards,
Michael
_______________________________________________
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