summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author couriersud <couriersud@arcor.de>2015-01-06 23:08:26 +0100
committer couriersud <couriersud@arcor.de>2015-01-06 23:08:26 +0100
commitdc4705d91f51dc5db059c6a39613191ab2d1c20a (patch)
tree12436226b93c8cfc5c41e84ff7b4d958c3e3f03e
parent8da5cfa3dd150a340457b4ed9deadc7135c29001 (diff)
SDL: Driver accel (draw13.c) now supports "-filter", i.e. bilinear
filtering. [Couriersud]
-rw-r--r--src/osd/sdl/draw13.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/osd/sdl/draw13.c b/src/osd/sdl/draw13.c
index b165ca411b6..57b21f8f02e 100644
--- a/src/osd/sdl/draw13.c
+++ b/src/osd/sdl/draw13.c
@@ -389,17 +389,6 @@ void texture_info::render_quad(const render_primitive *prim, const int x, const
target_rect.w = round_nearest(prim->bounds.x1 - prim->bounds.x0);
target_rect.h = round_nearest(prim->bounds.y1 - prim->bounds.y0);
-#if 0
- // no longer supported in SDL2
- if ((PRIMFLAG_GET_SCREENTEX(prim->m_flags)) && video_config.filter)
- {
- SDL_SetTextureScaleMode(texture->m_texture_id, DRAW2_SCALEMODE_BEST);
- }
- else
- {
- SDL_SetTextureScaleMode(texture->m_texture_id, DRAW2_SCALEMODE_NEAREST);
- }
-#endif
SDL_SetTextureBlendMode(m_texture_id, m_sdl_blendmode);
set_coloralphamode(m_texture_id, &prim->color);
SDL_RenderCopy(m_renderer, m_texture_id, NULL, &target_rect);
@@ -528,6 +517,19 @@ int drawsdl2_init(running_machine &machine, sdl_draw_info *callbacks)
else
osd_printf_verbose("Loaded opengl shared library: %s\n", stemp ? stemp : "<default>");
+ /* Enable bilinear filtering in case it is supported.
+ * This applies to all texture operations. However, artwort is pre-scaled
+ * and thus shouldn't be affected.
+ */
+ if (video_config.filter)
+ {
+ SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "1");
+ }
+ else
+ {
+ SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "0");
+ }
+
return 0;
}