[Fuse-for-macosx-commits] SF.net SVN: fuse-for-macosx: [282] branches/fusegl/fuse
Brought to you by:
fredm
From: <fr...@us...> - 2007-01-02 12:58:10
|
Revision: 282 http://svn.sourceforge.net/fuse-for-macosx/?rev=282&view=rev Author: fredm Date: 2007-01-02 04:58:11 -0800 (Tue, 02 Jan 2007) Log Message: ----------- Add zoom for common screensizes and ratios. Modified Paths: -------------- branches/fusegl/fuse/TODO branches/fusegl/fuse/fusepb/nibs/MainMenu.nib/classes.nib branches/fusegl/fuse/fusepb/nibs/MainMenu.nib/keyedobjects.nib branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.h branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.m Modified: branches/fusegl/fuse/TODO =================================================================== --- branches/fusegl/fuse/TODO 2007-01-02 12:44:43 UTC (rev 281) +++ branches/fusegl/fuse/TODO 2007-01-02 12:58:11 UTC (rev 282) @@ -13,7 +13,7 @@ X Restore fullscreen support X Fix scalers X Add support for bilinear etc. OpenGL filters -* Add option to snap window size to 1x, 2x, 3x GL_NEAREST filter +X Add option to snap window size to 1x, 2x, 3x * Grab mouse in fullscreen mode * Use sheets rather than modal dialogs * Run emulation in seperate thread to avoid sound glitches when menus are Modified: branches/fusegl/fuse/fusepb/nibs/MainMenu.nib/classes.nib =================================================================== --- branches/fusegl/fuse/fusepb/nibs/MainMenu.nib/classes.nib 2007-01-02 12:44:43 UTC (rev 281) +++ branches/fusegl/fuse/fusepb/nibs/MainMenu.nib/classes.nib 2007-01-02 12:58:11 UTC (rev 282) @@ -1,7 +1,7 @@ { IBClasses = ( { - ACTIONS = {fullscreen = id; }; + ACTIONS = {fullscreen = id; zoom = id; }; CLASS = DisplayOpenGLView; LANGUAGE = ObjC; SUPERCLASS = NSOpenGLView; Modified: branches/fusegl/fuse/fusepb/nibs/MainMenu.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.h =================================================================== --- branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.h 2007-01-02 12:44:43 UTC (rev 281) +++ branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.h 2007-01-02 12:58:11 UTC (rev 282) @@ -58,6 +58,7 @@ +(DisplayOpenGLView *) instance; -(IBAction) fullscreen:(id)sender; +-(IBAction) zoom:(id)sender; -(void) setViewPort:(NSRect)rect; Modified: branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.m =================================================================== --- branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.m 2007-01-02 12:44:43 UTC (rev 281) +++ branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.m 2007-01-02 12:58:11 UTC (rev 282) @@ -81,6 +81,32 @@ } } +-(IBAction) zoom:(id)sender +{ + NSSize size; + + switch( [sender tag] ) { + case 1: /* 320x240 */ + size.width = 320; + size.height = 240; + break; + case 2: /* 640x480 */ + size.width = 640; + size.height = 480; + break; + case 3: /* 960x720 */ + size.width = 960; + size.height = 720; + break; + case 0: + default: /* Actual size */ + size.width = screenTex.image_width; + size.height = screenTex.image_height; + } + + [[self window] setContentSize:size]; +} + -(id) initWithFrame:(NSRect)frameRect { /* Init pixel format attribs */ @@ -226,8 +252,6 @@ glMatrixMode( GL_PROJECTION ); glLoadIdentity(); - gluOrtho2D( 0, rect.size.width, 0, rect.size.height ); - glMatrixMode( GL_MODELVIEW ); glLoadIdentity(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |