use the new icon
This commit is contained in:
parent
0ff9eb4356
commit
c6f17f1360
|
@ -127,6 +127,7 @@ extern/imgui/backends/imgui_impl_sdl.cpp
|
||||||
extern/imgui/misc/cpp/imgui_stdlib.cpp
|
extern/imgui/misc/cpp/imgui_stdlib.cpp
|
||||||
extern/igfd/ImGuiFileDialog.cpp
|
extern/igfd/ImGuiFileDialog.cpp
|
||||||
|
|
||||||
|
src/gui/icon.c
|
||||||
src/gui/plot_nolerp.cpp
|
src/gui/plot_nolerp.cpp
|
||||||
src/gui/font_main.cpp
|
src/gui/font_main.cpp
|
||||||
src/gui/font_icon.cpp
|
src/gui/font_icon.cpp
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
#include "SDL_render.h"
|
#include "SDL_render.h"
|
||||||
#include "SDL_video.h"
|
#include "SDL_video.h"
|
||||||
#include "fonts.h"
|
#include "fonts.h"
|
||||||
|
#include "icon.h"
|
||||||
#include "../ta-log.h"
|
#include "../ta-log.h"
|
||||||
#include "imgui.h"
|
#include "imgui.h"
|
||||||
#include "imgui_impl_sdl.h"
|
#include "imgui_impl_sdl.h"
|
||||||
|
@ -2927,16 +2928,32 @@ bool FurnaceGUI::init() {
|
||||||
|
|
||||||
workingDir=e->getConfString("lastDir",getHomeDir());
|
workingDir=e->getConfString("lastDir",getHomeDir());
|
||||||
|
|
||||||
|
#ifndef __APPLE__
|
||||||
|
unsigned char* furIcon=getFurnaceIcon();
|
||||||
|
SDL_Surface* icon=SDL_CreateRGBSurfaceFrom(furIcon,256,256,32,256*4,0xff,0xff00,0xff0000,0xff000000);
|
||||||
|
#endif
|
||||||
|
|
||||||
sdlWin=SDL_CreateWindow("Furnace",SDL_WINDOWPOS_CENTERED,SDL_WINDOWPOS_CENTERED,scrW*dpiScale,scrH*dpiScale,SDL_WINDOW_RESIZABLE|SDL_WINDOW_ALLOW_HIGHDPI);
|
sdlWin=SDL_CreateWindow("Furnace",SDL_WINDOWPOS_CENTERED,SDL_WINDOWPOS_CENTERED,scrW*dpiScale,scrH*dpiScale,SDL_WINDOW_RESIZABLE|SDL_WINDOW_ALLOW_HIGHDPI);
|
||||||
if (sdlWin==NULL) {
|
if (sdlWin==NULL) {
|
||||||
logE("could not open window!\n");
|
logE("could not open window!\n");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
SDL_GetDisplayDPI(SDL_GetWindowDisplayIndex(sdlWin),&dpiScaleF,NULL,NULL);
|
SDL_GetDisplayDPI(SDL_GetWindowDisplayIndex(sdlWin),&dpiScaleF,NULL,NULL);
|
||||||
dpiScale=round(dpiScaleF/96.0f);
|
dpiScale=round(dpiScaleF/96.0f);
|
||||||
if (dpiScale<1) dpiScale=1;
|
if (dpiScale<1) dpiScale=1;
|
||||||
if (dpiScale!=1) SDL_SetWindowSize(sdlWin,scrW*dpiScale,scrH*dpiScale);
|
if (dpiScale!=1) SDL_SetWindowSize(sdlWin,scrW*dpiScale,scrH*dpiScale);
|
||||||
|
|
||||||
|
#ifndef __APPLE__
|
||||||
|
if (icon!=NULL) {
|
||||||
|
SDL_SetWindowIcon(sdlWin,icon);
|
||||||
|
SDL_FreeSurface(icon);
|
||||||
|
free(furIcon);
|
||||||
|
} else {
|
||||||
|
logW("could not create icon!\n");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
sdlRend=SDL_CreateRenderer(sdlWin,-1,SDL_RENDERER_ACCELERATED|SDL_RENDERER_PRESENTVSYNC|SDL_RENDERER_TARGETTEXTURE);
|
sdlRend=SDL_CreateRenderer(sdlWin,-1,SDL_RENDERER_ACCELERATED|SDL_RENDERER_PRESENTVSYNC|SDL_RENDERER_TARGETTEXTURE);
|
||||||
|
|
||||||
if (sdlRend==NULL) {
|
if (sdlRend==NULL) {
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,7 @@
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
unsigned char* getFurnaceIcon();
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
Loading…
Reference in New Issue