Obj3DEngine/tests/TestsAppDelegate.m
Jonathan Schleifer 6ed1bf1eff Create a window on Windows
FossilOrigin-Name: bf625526315ec71308288cbf7e91dc425ca1dd9e4e762a4c264cf2235c06558e
2022-12-27 19:00:12 +00:00

46 lines
1.3 KiB
Objective-C

/*
* Copyright (c) 2022 Jonathan Schleifer <js@nil.im>
*
* All rights reserved.
*
* This file is part of Obj3DEngine. It may be distributed under the terms of
* the Q Public License 1.0, which can be found in the file LICENSE.QPL
* included in the packaging of this file.
*
* Alternatively, it may be distributed under the terms of the GNU General
* Public License, either version 2 or 3, which can be found in the file
* LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of
* this file.
*/
#import <ObjFW/ObjFW.h>
#import "O3DEngine.h"
@interface TestsAppDelegate: OFObject <OFApplicationDelegate>
@end
OF_APPLICATION_DELEGATE(TestsAppDelegate)
@implementation TestsAppDelegate
- (void)applicationDidFinishLaunching: (OFNotification *)notification
{
Class <O3DRenderer> renderer =
[O3DEngine availableRenderers].firstObject;
O3DEngine *engine =
[[[O3DEngine alloc] initWithRenderer: renderer
options: nil] autorelease];
[OFStdOut writeFormat: @"Available resolutions: %@\n",
engine.renderer.availableResolutions];
O3DResolution resolution = [OFPair
pairWithFirstObject: [OFValue valueWithSize: OFMakeSize(800, 600)]
secondObject: [OFNumber numberWithFloat: 60]];
[engine.renderer createWithResolution: resolution];
[OFThread sleepForTimeInterval: 5];
[OFApplication terminate];
}
@end