Skip to content

Commit

Permalink
gfxlib2: unable to set opengl scaling after initial screen mode
Browse files Browse the repository at this point in the history
- unable to set set open GL scaling  (with screencontrol(SET_GL_SCALE, 1))
  after initial mode with greater than 1 is set
- due to bad logic in the driver initialization
- gfxlib stores the scaling requested for the next mode and the logic was
  only setting the new scaling if it was > 1, which prevents setting the
  scaling to 1
  • Loading branch information
jayrm committed Jun 22, 2023
1 parent 097ed6a commit b9da161
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion changelog.txt
Expand Up @@ -5,9 +5,10 @@ Version 1.10.1
[added]

[fixed]
- sf.net #982: Array descriptors emitted incorrectly in gcc backend
- sf.net #982: Array descriptors emitted incorrectly in gcc backend
- gas64: emit debug information for statics
- gas64: handle #inf's and NaN's in float comparisons
- unable to set opengl scaling to 1 after initial screen mode - previously: logic error in the driver code prevented the scaling from being set to 1


Version 1.10.0
Expand Down
4 changes: 3 additions & 1 deletion src/gfxlib2/unix/gfx_driver_opengl_x11.c
Expand Up @@ -222,8 +222,10 @@ static int driver_init(char *title, int w, int h, int depth, int refresh_rate, i

__fb_gl_params.mode_2d = __fb_gl_params.init_mode_2d;

if (__fb_gl_params.init_scale>1){
if (__fb_gl_params.init_scale>=1){
__fb_gl_params.scale = __fb_gl_params.init_scale;
}
if (__fb_gl_params.scale>1){
free(__fb_gfx->dirty);
__fb_gfx->dirty = (char *)calloc(1, __fb_gfx->h * __fb_gfx->scanline_size * __fb_gl_params.scale);
}
Expand Down
4 changes: 3 additions & 1 deletion src/gfxlib2/win32/gfx_driver_opengl.c
Expand Up @@ -435,8 +435,10 @@ static int driver_init(char *title, int w, int h, int depth_arg, int refresh_rat

__fb_gl_params.mode_2d = __fb_gl_params.init_mode_2d;

if (__fb_gl_params.init_scale>1){
if (__fb_gl_params.init_scale>=1){
__fb_gl_params.scale = __fb_gl_params.init_scale;
}
if (__fb_gl_params.scale>1){
free(__fb_gfx->dirty);
__fb_gfx->dirty = (char *)calloc(1, __fb_gfx->h * __fb_gfx->scanline_size * __fb_gl_params.scale);
w *= __fb_gl_params.scale;
Expand Down

0 comments on commit b9da161

Please sign in to comment.