// not work

NSData *data = [NSData dataWithContentsOfFile: filename];

NSBitmapImageRep *image = [[NSBitmapImageRep alloc] initWithData: data];


as opposed to:

// works fine

NSImage *source = [[NSImage alloc] initWithContentsOfFile: filename];

NSSize size = [source size];

 [source lockFocus];

NSBitmapImageRep *image = [[NSBitmapImageRep alloc] initWithFocusedViewRect:
NSMakeRect(0.0, 0.0, size.width, size.height)];

[source unlockFocus];


// OpenGL commands


gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGBA, [image pixelsWide], [image
pixelsHigh], GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, [image bitmapData]);

why?


as opposed to
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to