renderGL: settings to change stencil and buffer si

This commit is contained in:
tildearrow 2024-05-20 03:15:43 -05:00
parent 45783e7797
commit c690c681c5
5 changed files with 23 additions and 1 deletions

View file

@ -6854,7 +6854,7 @@ bool FurnaceGUI::init() {
if (sdlWin==NULL) {
const char* sdlErr=SDL_GetError();
lastError=fmt::sprintf("could not open window! %s",sdlErr);
if (settings.renderBackend!="Software" && strcmp(sdlErr,"No matching GL pixel format available")==0) {
if (settings.renderBackend!="Software" && strstr(sdlErr,"matching")!=NULL) {
settings.renderBackend="Software";
e->setConf("renderBackend","Software");
e->saveConf();

View file

@ -1930,6 +1930,8 @@ class FurnaceGUI {
int glBlueSize;
int glAlphaSize;
int glDepthSize;
int glStencilSize;
int glBufferSize;
int glDoubleBuffer;
int backupEnable;
int backupInterval;
@ -2182,6 +2184,8 @@ class FurnaceGUI {
glBlueSize(8),
glAlphaSize(0),
glDepthSize(24),
glStencilSize(0),
glBufferSize(32),
glDoubleBuffer(1),
backupEnable(1),
backupInterval(30),

View file

@ -625,6 +625,8 @@ void FurnaceGUIRenderGL::preInit(const DivConfig& conf) {
SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE,conf.getInt("glAlphaSize",0));
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER,conf.getInt("glDoubleBuffer",1));
SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE,conf.getInt("glDepthSize",24));
SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE,conf.getInt("glStencilSize",0));
SDL_GL_SetAttribute(SDL_GL_BUFFER_SIZE,conf.getInt("glBufferSize",32));
}
#define LOAD_PROC_MANDATORY(_v,_t,_s) \

View file

@ -275,6 +275,8 @@ void FurnaceGUIRenderGL1::preInit(const DivConfig& conf) {
SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE,conf.getInt("glAlphaSize",0));
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER,conf.getInt("glDoubleBuffer",1));
SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE,conf.getInt("glDepthSize",24));
SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE,conf.getInt("glStencilSize",0));
SDL_GL_SetAttribute(SDL_GL_BUFFER_SIZE,conf.getInt("glBufferSize",32));
}
#define LOAD_PROC_MANDATORY(_v,_t,_s) \

View file

@ -490,6 +490,16 @@ void FurnaceGUI::drawSettings() {
if (settings.glDepthSize>128) settings.glDepthSize=128;
settingsChanged=true;
}
if (ImGui::InputInt("Stencil buffer size",&settings.glStencilSize)) {
if (settings.glStencilSize<0) settings.glStencilSize=0;
if (settings.glStencilSize>32) settings.glStencilSize=32;
settingsChanged=true;
}
if (ImGui::InputInt("Buffer size",&settings.glBufferSize)) {
if (settings.glBufferSize<0) settings.glBufferSize=0;
if (settings.glBufferSize>128) settings.glBufferSize=128;
settingsChanged=true;
}
bool glDoubleBufferB=settings.glDoubleBuffer;
if (ImGui::Checkbox("Double buffer",&glDoubleBufferB)) {
settings.glDoubleBuffer=glDoubleBufferB;
@ -4503,6 +4513,8 @@ void FurnaceGUI::readConfig(DivConfig& conf, FurnaceGUISettingGroups groups) {
settings.glBlueSize=conf.getInt("glBlueSize",8);
settings.glAlphaSize=conf.getInt("glAlphaSize",0);
settings.glDepthSize=conf.getInt("glDepthSize",24);
settings.glStencilSize=conf.getInt("glStencilSize",0);
settings.glBufferSize=conf.getInt("glBufferSize",32);
settings.glDoubleBuffer=conf.getInt("glDoubleBuffer",1);
settings.vsync=conf.getInt("vsync",1);
@ -5048,6 +5060,7 @@ void FurnaceGUI::readConfig(DivConfig& conf, FurnaceGUISettingGroups groups) {
clampSetting(settings.glBlueSize,0,32);
clampSetting(settings.glAlphaSize,0,32);
clampSetting(settings.glDepthSize,0,128);
clampSetting(settings.glStencilSize,0,32);
clampSetting(settings.glDoubleBuffer,0,1);
clampSetting(settings.backupEnable,0,1);
clampSetting(settings.backupInterval,10,86400);
@ -5080,6 +5093,7 @@ void FurnaceGUI::writeConfig(DivConfig& conf, FurnaceGUISettingGroups groups) {
conf.set("glBlueSize",settings.glBlueSize);
conf.set("glAlphaSize",settings.glAlphaSize);
conf.set("glDepthSize",settings.glDepthSize);
conf.set("glStencilSize",settings.glStencilSize);
conf.set("glDoubleBuffer",settings.glDoubleBuffer);
conf.set("vsync",settings.vsync);