Obj3DEngine/src/O3DRenderer.h
Jonathan Schleifer 95fd0d1a5d Change O3DVertex struct
FossilOrigin-Name: 2bf3eabe2875f0326928d79864923dab8a34d4d0a706d21bcf9370cb456fdd0d
2023-01-13 14:43:43 +00:00

52 lines
1.2 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>
OF_ASSUME_NONNULL_BEGIN
typedef struct OF_BOXABLE {
struct {
float x, y;
} position;
struct {
float r, g, b, a;
} color;
} O3DVertex;
@protocol O3DRenderer <OFObject>
@property (nonatomic) bool syncsToVerticalBlank;
+ (unsigned int)numAvailableDevices;
- (instancetype)initWithResolution: (OFSize)resolution
bitsPerPixel: (uint8_t)bitsPerPixel
refreshRate: (float)refreshRate
options: (nullable OFDictionary *)options;
- (void)beginFrame;
- (void)drawPolygonWithVertices: (const O3DVertex *)vertices
count: (size_t)count;
- (void)endFrame;
@end
#ifdef __cplusplus
extern "C" {
#endif
extern OFString *const O3DRendererDeviceIndex;
#ifdef __cplusplus
}
#endif
OF_ASSUME_NONNULL_END