21 #include "../../SDL_internal.h"
23 #if SDL_VIDEO_DRIVER_COCOA
33 static int Cocoa_VideoInit(
_THIS);
34 static void Cocoa_VideoQuit(
_THIS);
52 Cocoa_CreateDevice(
int devindex)
114 #if SDL_VIDEO_OPENGL_CGL
125 #elif SDL_VIDEO_OPENGL_EGL
153 device->
free = Cocoa_DeleteDevice;
159 "cocoa",
"SDL Cocoa video driver",
160 Cocoa_Available, Cocoa_CreateDevice
165 Cocoa_VideoInit(
_THIS)
187 Cocoa_VideoQuit(
_THIS)
202 NSBitmapImageRep *imgrep;
212 imgrep = [[[NSBitmapImageRep alloc] initWithBitmapDataPlanes: NULL
213 pixelsWide: converted->w
214 pixelsHigh: converted->h
219 colorSpaceName: NSDeviceRGBColorSpace
220 bytesPerRow: converted->pitch
221 bitsPerPixel: converted->format->BitsPerPixel] autorelease];
228 pixels = [imgrep bitmapData];
233 for (i = (surface->
h * surface->
w); i--; ) {
235 pixels[0] = (
Uint8)(((
Uint16)pixels[0] * alpha) / 255);
241 img = [[[NSImage alloc] initWithSize: NSMakeSize(surface->w, surface->h)] autorelease];
243 [img addRepresentation: imgrep];
255 void SDL_NSLog(
const char *
text)