Skip to content

Instantly share code, notes, and snippets.

View yushroom's full-sized avatar

Yunkang YU yushroom

  • Zhejiang University
  • china
View GitHub Profile
@yushroom
yushroom / macos_imgui_metal.mm
Last active January 18, 2022 18:19
Programmatically create a cocoa window without nib/xib/storyboard in C++ and render ImGui with metal support
#import <Foundation/Foundation.h>
#import <Cocoa/Cocoa.h>
#import <MetalKit/MetalKit.h>
#include <imgui.h>
#include <imgui_impl_metal.h>
#include <imgui_impl_osx.h>
@interface Renderer : NSObject<MTKViewDelegate>
-(nonnull instancetype)initWithView:(nonnull MTKView *)view;