Cube  Check-in [fd3bba5332]

Overview
Comment:Default to desktop resolution
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: fd3bba533240e7de2e6ddec834f937cdcbcda3051229d035c2c0ad4030cb47dc
User & Date: js on 2025-03-05 01:32:39
Other Links: manifest | tags
Context
2025-03-05
22:25
Merge accidental fork check-in: 7cfa53cdf1 user: js tags: trunk
01:32
Default to desktop resolution check-in: fd3bba5332 user: js tags: trunk
01:15
Convert texture pixel format if necessary check-in: 12641927d9 user: js tags: trunk
Changes

Modified src/Cube.mm from [a97b4669e3] to [60096482fb].

12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
12
13
14
15
16
17
18










19
20
21
22
23
24
25







-
-
-
-
-
-
-
-
-
-







}

+ (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;

93
94
95
96
97
98
99












100
101
102
103
104
105
106
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 ||