2021-05-05 23:43:30 +00:00
|
|
|
#pragma once
|
|
|
|
|
2021-05-10 22:16:42 +00:00
|
|
|
#include "../VISIRenderer.hpp"
|
2021-05-05 23:43:30 +00:00
|
|
|
#import <Metal/Metal.h>
|
2021-05-10 22:16:42 +00:00
|
|
|
|
|
|
|
#if !__has_feature(objc_arc)
|
|
|
|
#error ARC Required
|
|
|
|
#endif
|
2021-05-05 23:43:30 +00:00
|
|
|
|
|
|
|
@interface MetalRenderer : NSObject
|
|
|
|
@end
|
|
|
|
|
|
|
|
class VISIRendererMetal : public VISIRenderer {
|
|
|
|
MetalRenderer* view;
|
|
|
|
|
|
|
|
bool SetupShaders() override;
|
|
|
|
bool SetupVertexBuffersAndFormats() override;
|
|
|
|
void SetupRenderPass(const zeus::CVector3f& pos) override;
|
|
|
|
|
|
|
|
public:
|
|
|
|
VISIRendererMetal(int argc, const hecl::SystemChar** argv) : VISIRenderer(argc, argv) {
|
|
|
|
view = [[MetalRenderer alloc] init];
|
|
|
|
}
|
2021-05-10 22:16:42 +00:00
|
|
|
void Run(FPercent updatePercent) override;
|
2021-05-05 23:43:30 +00:00
|
|
|
void RenderPVSOpaque(RGBA8* out, bool& needTransparent) override;
|
|
|
|
void RenderPVSTransparent(const std::function<void(int)>& passFunc) override;
|
|
|
|
void RenderPVSEntitiesAndLights(const std::function<void(int)>& passFunc,
|
|
|
|
const std::function<void(int, EPVSVisSetState)>& lightPassFunc) override;
|
2021-05-10 22:16:42 +00:00
|
|
|
};
|