12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
}
+ (Cube *)sharedInstance
{
return (Cube *)OFApplication.sharedApplication.delegate;
}
- (instancetype)init
{
self = [super init];
_width = 1920;
_height = 1080;
return self;
}
- (void)applicationDidFinishLaunching:(OFNotification *)notification
{
bool dedicated, windowed;
int par = 0, uprate = 0, maxcl = 4;
OFString *__autoreleasing sdesc, *__autoreleasing ip;
OFString *__autoreleasing master, *__autoreleasing passwd;
|
<
<
<
<
<
<
<
<
<
<
|
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
}
+ (Cube *)sharedInstance
{
return (Cube *)OFApplication.sharedApplication.delegate;
}
- (void)applicationDidFinishLaunching:(OFNotification *)notification
{
bool dedicated, windowed;
int par = 0, uprate = 0, maxcl = 4;
OFString *__autoreleasing sdesc, *__autoreleasing ip;
OFString *__autoreleasing master, *__autoreleasing passwd;
|
93
94
95
96
97
98
99
100
101
102
103
104
105
106
|
log(@"world");
empty_world(7, true);
log(@"video: sdl");
if (SDL_InitSubSystem(SDL_INIT_VIDEO) < 0)
fatal(@"Unable to initialize SDL Video");
log(@"video: mode");
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
if ((_window = SDL_CreateWindow("cube engine", SDL_WINDOWPOS_UNDEFINED,
SDL_WINDOWPOS_UNDEFINED, _width, _height,
SDL_WINDOW_SHOWN | SDL_WINDOW_OPENGL |
(!windowed ? SDL_WINDOW_FULLSCREEN : 0))) == NULL ||
|
>
>
>
>
>
>
>
>
>
>
>
>
|
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
|
log(@"world");
empty_world(7, true);
log(@"video: sdl");
if (SDL_InitSubSystem(SDL_INIT_VIDEO) < 0)
fatal(@"Unable to initialize SDL Video");
if (_width == 0 || _height == 0) {
SDL_DisplayMode mode;
if (SDL_GetDesktopDisplayMode(0, &mode) == 0) {
_width = mode.w;
_height = mode.h;
} else {
_width = 1920;
_height = 1080;
}
}
log(@"video: mode");
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
if ((_window = SDL_CreateWindow("cube engine", SDL_WINDOWPOS_UNDEFINED,
SDL_WINDOWPOS_UNDEFINED, _width, _height,
SDL_WINDOW_SHOWN | SDL_WINDOW_OPENGL |
(!windowed ? SDL_WINDOW_FULLSCREEN : 0))) == NULL ||
|