Merge accidental fork

FossilOrigin-Name: 7cfa53cdf1894df2e2a3f969a53c06689f9451c010b4318554d82401addf6a61
This commit is contained in:
Jonathan Schleifer 2025-03-05 22:25:32 +00:00
commit a6a0247bb2

View file

@ -16,16 +16,6 @@ VARP(minmillis, 0, 5, 1000);
return (Cube *)OFApplication.sharedApplication.delegate;
}
- (instancetype)init
{
self = [super init];
_width = 1920;
_height = 1080;
return self;
}
- (void)applicationDidFinishLaunching:(OFNotification *)notification
{
bool dedicated, windowed;
@ -98,6 +88,18 @@ VARP(minmillis, 0, 5, 1000);
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,