Hi Ken,
the problem was solved by checking bitsPerPixel and changed the pixel format
to GL_RGB, GL_UNSIGNED_BYTE
but, if the best combination of format / type is GL_BGRA,
GL_UNSIGNED_INT_8_8_8_8_REV so does it means we need to convert RGB / RGBA
to BGRA?
sorry for posting in cocoa list
2010/3/1
Hi,
Please go down to the phrase "apps are rather fond of hardcoding bitmap
formats" in the AppKit release notes.
http://developer.apple.com/mac/library/releasenotes/cocoa/appkit.html
> If the latter I suspect that your file is not in the needed format.
Does your image have alpha?
format is bm
2010/3/12 Alexander Spohr
Exactly what does not work?
> The loading? Or the opengl command?
>
>
texture is corrupted with artifact on the screen and sometimes
gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGBA, [image pixelsWide], [image
pixelsHigh], GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV, [image bitmapDa
Exactly what does not work?
The loading? Or the opengl command?
If the latter I suspect that your file is not in the needed format.
Does your image have alpha?
atze
Am 12.03.2010 um 13:09 schrieb Ariel Feinerman:
> // not work
>
> NSData *data = [NSData dataWithContentsOfFile: filena
// 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];