Mercurial > sdl-ios-xcode
diff src/video/quartz/SDL_QuartzVideo.m @ 158:4382c38dfbee
Date: Tue, 21 Aug 2001 03:50:01 +0200
From: Max Horn <max@quendi.de>
Subject: New patch for OS X
Attached a .patch file for SDL/OSX with some nice bug fixes / enhancments.
* fixes the activation issues, which also caused the window to be
always drawn like an inactive. The close/minimize widgets now are
animated properly, too.
* the menu items are automatically adjusted to use the app name
instead of just "SDL App". I did this so that we really can use one
central SDLMain.nib file, w/o requiring developers to make a copy of
it and adjust it.
* libSDLMain now contains the proper cocoa code, not as before the
carbon code. This means apps no longer have to carry a copy of
SDLMain.m/SDLMain.h
* revamped configure.in to properly build a Cocoa/Quartz SDL lib, not
a Carbon based SDL lib
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Tue, 21 Aug 2001 07:19:59 +0000 |
parents | 2d162219f433 |
children | 37e3ca9254c7 |
line wrap: on
line diff
--- a/src/video/quartz/SDL_QuartzVideo.m Mon Aug 20 04:41:49 2001 +0000 +++ b/src/video/quartz/SDL_QuartzVideo.m Tue Aug 21 07:19:59 2001 +0000 @@ -267,9 +267,9 @@ UnlockPortBits ( [ windowView qdPort ] ); [ windowView release ]; } - [ window setContentView:nil ]; - [ window setDelegate:nil ]; - [ window close ]; + [ qz_window setContentView:nil ]; + [ qz_window setDelegate:nil ]; + [ qz_window close ]; } /* Set pixels to null (so other code doesn't try to free it) */ @@ -408,9 +408,9 @@ } /* Manually create a window, avoids having a nib file resource */ - window = [ [ SDL_QuartzWindow alloc ] initWithContentRect:rect + qz_window = [ [ SDL_QuartzWindow alloc ] initWithContentRect:rect styleMask:style backing:NSBackingStoreBuffered defer:NO ]; - if (window == nil) { + if (qz_window == nil) { SDL_SetError ("Could not create the Cocoa window"); return NULL; } @@ -419,12 +419,12 @@ current->w = width; current->h = height; - [ window setReleasedWhenClosed:YES ]; + [ qz_window setReleasedWhenClosed:YES ]; QZ_SetCaption(this, this->wm_title, this->wm_icon); - [ window setAcceptsMouseMovedEvents:YES ]; - [ window setViewsNeedDisplay:NO ]; - [ window center ]; - [ window setDelegate: + [ qz_window setAcceptsMouseMovedEvents:YES ]; + [ qz_window setViewsNeedDisplay:NO ]; + [ qz_window center ]; + [ qz_window setDelegate: [ [ [ SDL_QuartzWindowDelegate alloc ] init ] autorelease ] ]; /* For OpenGL, we set the content view to a NSOpenGLView */ @@ -434,17 +434,17 @@ return NULL; } - [ gl_context setView: [ window contentView ] ]; + [ gl_context setView: [ qz_window contentView ] ]; [ gl_context makeCurrentContext]; - [ window orderFront:nil ]; + [ qz_window makeKeyAndOrderFront:nil ]; current->flags |= SDL_OPENGL; } /* For 2D, we set the content view to a NSQuickDrawView */ else { windowView = [ [ NSQuickDrawView alloc ] init ]; - [ window setContentView:windowView ]; - [ window orderFront:nil ]; + [ qz_window setContentView:windowView ]; + [ qz_window makeKeyAndOrderFront:nil ]; LockPortBits ( [ windowView qdPort ] ); current->pixels = GetPixBaseAddr ( GetPortPixMap ( [ windowView qdPort ] ) );