KDE/app/src/main/m/MetalViewDelegate.h

27 lines
816 B
Objective-C

//
// Renderer.h
// KDE
//
// Created by Ronja Enseleit on 01.07.23.
//
#import <MetalKit/MetalKit.h>
#include "../cpp/Gfx.h"
#include "../cpp/StringRepository.h"
// Our platform independent renderer class. Implements the MTKViewDelegate protocol which
// allows it to accept per-frame update and drawable resize callbacks.
@interface MetalViewDelegate : NSObject <MTKViewDelegate>
-(nonnull instancetype)initWithMetalKitView:(nonnull MTKView *)view;
-(void)pushRect:(KDERect)rect withTexture:(KDEStringHandle)texture;
-(void)pushRect:(KDERect)rect withFont:(KDEStringHandle)font withCharHeight:(float)char_height withKey:(KDEStringHandle)key;
-(nonnull id<MTLTexture>)createTexture:(nonnull const void*)data width:(unsigned int)width height:(unsigned int)height format:(MTLPixelFormat)format;
@end