Skip to content

Commit

Permalink
Ok look, use the framebuffer size of the 3Dfx card in OpenGL mode. Pl…
Browse files Browse the repository at this point in the history
…ease.
  • Loading branch information
joncampbell123 committed Feb 3, 2018
1 parent 1be4d04 commit 307c0c9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/gui/sdlmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -959,6 +959,10 @@ static SDL_Surface * GFX_SetupSurfaceScaledOpenGL(Bit32u sdl_flags, Bit32u bpp)
Bit16u fixedWidth;
Bit16u fixedHeight;

int Voodoo_OGL_GetWidth();
int Voodoo_OGL_GetHeight();
bool Voodoo_OGL_Active();

if (sdl.desktop.prevent_fullscreen) /* 3Dfx openGL do not allow resize */
sdl_flags &= ~SDL_RESIZABLE;

Expand All @@ -983,10 +987,11 @@ static SDL_Surface * GFX_SetupSurfaceScaledOpenGL(Bit32u sdl_flags, Bit32u bpp)
fixedWidth = final_width;
fixedHeight = final_height;
}
if (sdl.desktop.prevent_fullscreen) { /* 3Dfx openGL do not allow resize */
if (Voodoo_OGL_GetWidth() != 0 && Voodoo_OGL_GetHeight() != 0 &&
Voodoo_OGL_Active() && sdl.desktop.prevent_fullscreen) { /* 3Dfx openGL do not allow resize */
sdl.clip.x=0;sdl.clip.y=0;
sdl.clip.w=(Bit16u)(render.src.width);
sdl.clip.h=(Bit16u)(render.src.height);
sdl.clip.w=(Bit16u)Voodoo_OGL_GetWidth();
sdl.clip.h=(Bit16u)Voodoo_OGL_GetHeight();
sdl.surface=SDL_SetVideoMode(sdl.clip.w,sdl.clip.h,bpp,sdl_flags);
sdl.deferred_resize = false;
sdl.must_redraw_all = true;
Expand Down
12 changes: 12 additions & 0 deletions src/hardware/voodoo_opengl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,18 @@ std::map <const UINT32, ogl_texmap> textures[2];

void GFX_PreventFullscreen(bool lockout);

int Voodoo_OGL_GetWidth() {
return v->fbi.width;
}

int Voodoo_OGL_GetHeight() {
return v->fbi.height;
}

bool Voodoo_OGL_Active() {
return (v->clock_enabled && v->output_on);
}

static void ogl_get_depth(voodoo_state* VV, INT32 ITERZ, INT64 ITERW, INT32 *depthval, INT32 *out_wfloat)
{
INT32 wfloat;
Expand Down

0 comments on commit 307c0c9

Please sign in to comment.