debug messages

This commit is contained in:
tildearrow 2024-04-14 17:48:01 -05:00
parent 31f9559f5e
commit b39a775800

View file

@ -95,6 +95,7 @@ void FurnaceGUIRenderMetal::setBlendMode(FurnaceGUIBlendMode mode) {
// you should only call this once!!!
void FurnaceGUIRenderMetal::clear(ImVec4 color) {
logI("Metal: clear()");
int outW, outH;
getOutputSize(outW,outH);
priv->context.drawableSize=CGSizeMake(outW,outH);
@ -109,18 +110,22 @@ void FurnaceGUIRenderMetal::clear(ImVec4 color) {
}
bool FurnaceGUIRenderMetal::newFrame() {
logI("Metal: newFrame()");
ImGui_ImplMetal_NewFrame(priv->renderPass);
}
void FurnaceGUIRenderMetal::createFontsTexture() {
logI("Metal: createFontsTexture()");
ImGui_ImplMetal_CreateFontsTexture(priv->context.device);
}
void FurnaceGUIRenderMetal::destroyFontsTexture() {
logI("Metal: destroyFontsTexture()");
ImGui_ImplMetal_DestroyFontsTexture();
}
void FurnaceGUIRenderMetal::renderGUI() {
logI("Metal: renderGUI()");
ImGui_ImplMetal_RenderDrawData(ImGui::GetDrawData(),priv->cmdBuf,priv->renderEncoder);
}
@ -129,6 +134,7 @@ void FurnaceGUIRenderMetal::wipe(float alpha) {
}
void FurnaceGUIRenderMetal::present() {
logI("Metal: present()");
[priv->renderEncoder endEncoding];
[priv->cmdBuf presentDrawable:priv->drawable];
@ -149,18 +155,22 @@ void FurnaceGUIRenderMetal::preInit() {
}
bool FurnaceGUIRenderMetal::init(SDL_Window* win, int swapInterval) {
logI("Metal: init()");
SDL_SetHint(SDL_HINT_RENDER_DRIVER,"metal");
sdlRend=SDL_CreateRenderer(win,-1,SDL_RENDERER_ACCELERATED|SDL_RENDERER_PRESENTVSYNC|SDL_RENDERER_TARGETTEXTURE);
if (sdlRend==NULL) return false;
logI("retrieving context...");
priv->context=(__bridge CAMetalLayer*)SDL_RenderGetMetalLayer(sdlRend);
priv->context.pixelFormat=MTLPixelFormatBGRA8Unorm;
return true;
}
void FurnaceGUIRenderMetal::initGUI(SDL_Window* win) {
logI("Metal: initGUI()");
ImGui_ImplMetal_Init(priv->context.device);
ImGui_ImplSDL2_InitForMetal(win);