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