Oolite 1.91.0.7646-241128-10e222e
Loading...
Searching...
No Matches
GameController(FullScreen) Category Reference

#include <GameController.h>

Instance Methods

(IBAction) - toggleFullScreenAction:
 
(void) - setFullScreenMode:
 
(void) - exitFullScreenMode
 
(BOOL) - inFullScreenMode
 
(BOOL) - setDisplayWidth:Height:Refresh:
 
(NSDictionary *) - findDisplayModeForWidth:Height:Refresh:
 
(NSArray *) - displayModes
 
(NSUInteger) - indexOfCurrentDisplayMode
 
(void) - pauseFullScreenModeToPerform:onTarget:
 
(void) - setUpDisplayModes
 
(void) - toggleFullScreenCalledForWindow:withSender: [implementation]
 

Detailed Description

Definition at line 47 of file GameController+FullScreen.m.

Method Documentation

◆ displayModes

- (NSArray *) displayModes

Extends class GameController.

Definition at line 1 of file GameController+FullScreen.m.

157{
158 return [_fullScreenController displayModes];
159}

◆ exitFullScreenMode

- (void) exitFullScreenMode

Extends class GameController.

Definition at line 1 of file GameController+FullScreen.m.

124{
125 [self setFullScreenMode:NO];
126}

◆ findDisplayModeForWidth:Height:Refresh:

- (NSDictionary *) findDisplayModeForWidth: (unsigned int) d_width
Height: (unsigned int) d_height
Refresh: (unsigned int) d_refresh 

Extends class GameController.

Definition at line 1 of file GameController+FullScreen.m.

150 :(unsigned int)d_width Height:(unsigned int)d_height Refresh:(unsigned int)d_refresh
151{
152 return [_fullScreenController findDisplayModeForWidth:d_width height:d_height refreshRate:d_refresh];
153}
typedef int(ZCALLBACK *close_file_func) OF((voidpf opaque

◆ indexOfCurrentDisplayMode

- (NSUInteger) indexOfCurrentDisplayMode

Extends class GameController.

Definition at line 1 of file GameController+FullScreen.m.

163{
164 return [_fullScreenController indexOfCurrentDisplayMode];
165}

◆ inFullScreenMode

- (BOOL) inFullScreenMode

Extends class GameController.

Definition at line 1 of file GameController+FullScreen.m.

101{
102 return [_fullScreenController inFullScreenMode];
103}

◆ pauseFullScreenModeToPerform:onTarget:

- (void) pauseFullScreenModeToPerform: (SEL) selector
onTarget: (id) target 

Extends class GameController.

Definition at line 1 of file GameController+FullScreen.m.

168 :(SEL)selector onTarget:(id)target
169{
170 [target performSelector:selector];
171}

◆ setDisplayWidth:Height:Refresh:

- (BOOL) setDisplayWidth: (unsigned int) d_width
Height: (unsigned int) d_height
Refresh: (unsigned int) d_refresh 

Extends class GameController.

Definition at line 1 of file GameController+FullScreen.m.

129 :(unsigned int)width Height:(unsigned int)height Refresh:(unsigned int)refreshRate
130{
131 if ([_fullScreenController setDisplayWidth:width height:height refreshRate:refreshRate])
132 {
133 NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
134
135 [userDefaults setInteger:width forKey:@"display_width"];
136 [userDefaults setInteger:height forKey:@"display_height"];
137 [userDefaults setInteger:refreshRate forKey:@"display_refresh"];
138
139 [userDefaults synchronize];
140
141 return YES;
142 }
143 else
144 {
145 return NO;
146 }
147}

◆ setFullScreenMode:

- (void) setFullScreenMode: (BOOL) value

Extends class GameController.

Definition at line 1 of file GameController+FullScreen.m.

106 :(BOOL)value
107{
108 if (value == [self inFullScreenMode]) return;
109
110 [[NSUserDefaults standardUserDefaults] setBool:value forKey:@"fullscreen"];
111
112 if (value)
113 {
114 [_fullScreenController setFullScreenMode:YES];
115 }
116 else
117 {
118 [_fullScreenController setFullScreenMode:NO];
119 }
120}

◆ setUpDisplayModes

- (void) setUpDisplayModes

Extends class GameController.

Definition at line 1 of file GameController+FullScreen.m.

50{
51#if OOLITE_MAC_OS_X
52 OOFullScreenController *fullScreenController = nil;
53
54#if OO_MAC_SUPPORT_SYSTEM_STANDARD_FULL_SCREEN
55 if ([OOMacSystemStandardFullScreenController shouldUseSystemStandardFullScreenController])
56 {
57 fullScreenController = [[OOMacSystemStandardFullScreenController alloc] initWithGameView:gameView];
58 }
59#endif
60
61 if (fullScreenController == nil)
62 {
63 fullScreenController = [[OOMacSnowLeopardFullScreenController alloc] initWithGameView:gameView];
64 }
65#endif
66
67 // Load preferred display mode, falling back to current mode if no preferences set.
68 NSDictionary *currentMode = [fullScreenController currentDisplayMode];
69 NSUInteger width = [currentMode oo_unsignedIntegerForKey:kOODisplayWidth];
70 NSUInteger height = [currentMode oo_unsignedIntegerForKey:kOODisplayHeight];
71 NSUInteger refresh = [currentMode oo_unsignedIntegerForKey:kOODisplayRefreshRate];
72
73 NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
74 width = [userDefaults oo_unsignedIntegerForKey:@"display_width" defaultValue:width];
75 height = [userDefaults oo_unsignedIntegerForKey:@"display_height" defaultValue:height];
76 refresh = [userDefaults oo_unsignedIntegerForKey:@"display_refresh" defaultValue:refresh];
77
78 [fullScreenController setDisplayWidth:width height:height refreshRate:refresh];
79
80 _fullScreenController = fullScreenController;
81}
return nil
BOOL setDisplayWidth:height:refreshRate:(NSUInteger width,[height] NSUInteger height,[refreshRate] NSUInteger refresh)

◆ toggleFullScreenAction:

- (IBAction) toggleFullScreenAction: (id) sender

Extends class GameController.

Definition at line 1 of file GameController+FullScreen.m.

86 :(id)sender
87{
88 [self setFullScreenMode:![self inFullScreenMode]];
89}

◆ toggleFullScreenCalledForWindow:withSender:

- (void) toggleFullScreenCalledForWindow: (OOPrimaryWindow *) window
withSender: (id) sender 
implementation

Extends class GameController.

Definition at line 1 of file GameController+FullScreen.m.

92 :(OOPrimaryWindow *)window withSender:(id)sender
93{
94 [self toggleFullScreenAction:sender];
95}

The documentation for this category was generated from the following files: