Obj3DEngine/tests/TestsAppDelegate.m
Jonathan Schleifer 3ffafe1164 Add -[O3DRenderer createWithResolution:]
FossilOrigin-Name: eb5ac4e75ec321429073f4975efc2c7a9f7eb304f52cdfb598649b4c51914726
2022-12-25 21:19:41 +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(640, 480)]
secondObject: [OFNumber numberWithFloat: 60]];
[engine.renderer createWithResolution: resolution];
[OFThread sleepForTimeInterval: 5];
[OFApplication terminate];
}
@end