Previous 199869 Revisions Next

r34881 Friday 6th February, 2015 at 00:13:55 UTC by Couriersud
Get rid of "resize" render method. (nw)
[src/osd/sdl]draw13.c drawbgfx.c drawogl.c drawsdl.c window.c window.h

trunk/src/osd/sdl/draw13.c
r243392r243393
145145    sdl_info13(sdl_window_info *w)
146146    : osd_renderer(w, FLAG_NONE), m_blittimer(0), m_sdl_renderer(NULL),
147147      m_last_hofs(0), m_last_vofs(0),
148      m_resize_pending(0), m_resize_width(0), m_resize_height(0),
148      m_last_width(0), m_last_height(0),
149149      m_last_blit_time(0), m_last_blit_pixels(0)
150150    {}
151151
152152   /* virtual */ int create(const int width, const int height);
153   /* virtual */ void resize(const int width, const int height);
154153   /* virtual */ int draw(const UINT32 dc, const int update);
155154   /* virtual */ int xy_to_render_target(const int x, const int y, int *xt, int *yt);
156155   /* virtual */ void destroy_all_textures();
r243392r243393
177176   float           m_last_hofs;
178177   float           m_last_vofs;
179178
180   // resize information
179   int            m_last_width;
180   int            m_last_height;
181181
182   UINT8           m_resize_pending;
183   UINT32          m_resize_width;
184   UINT32          m_resize_height;
185
186182   // Stats
187183   INT64           m_last_blit_time;
188184   INT64           m_last_blit_pixels;
r243392r243393
617613   return 0;
618614}
619615
620//============================================================
621//  sdl_info::resize
622//============================================================
623616
624void sdl_info13::resize(int width, int height)
625{
626   SDL_RenderSetViewport(m_sdl_renderer, NULL);
627   m_blittimer = 3;
628}
629
630
631617//============================================================
632618//  sdl_info::destroy
633619//============================================================
r243392r243393
695681      return 0;
696682   }
697683
698#if 0
699   if (m_resize_pending)
684   if ((window().width() != m_last_width) || (window().height() != m_last_height))
700685   {
701      SDL_SetWindowSize(window().m_sdl_window, m_resize_width, m_resize_height);
702      SDL_GetWindowSize(window().m_sdl_window, &window().width(), &window().height());
703      m_resize_pending = 0;
686      m_last_width = window().width();
687      m_last_height = window().height();
704688      SDL_RenderSetViewport(m_sdl_renderer, NULL);
705      //sdlvideo_monitor_refresh(window().monitor());
706
689      m_blittimer = 3;
707690   }
708#endif
709691   //SDL_SelectRenderer(window().sdl_window);
710692
711693   if (m_blittimer > 0)
trunk/src/osd/sdl/drawbgfx.c
r243392r243393
8080    {}
8181
8282   /* virtual */ int create(const int width, const int height);
83   /* virtual */ void resize(const int width, const int height);
8483   /* virtual */ int draw(const UINT32 dc, const int update);
8584   /* virtual */ int xy_to_render_target(const int x, const int y, int *xt, int *yt);
8685   /* virtual */ void destroy_all_textures();
r243392r243393
152151}
153152
154153//============================================================
155//  sdl_info_bgfx::resize
156//============================================================
157
158void sdl_info_bgfx::resize(int width, int height)
159{
160   m_blittimer = 3;
161}
162
163//============================================================
164154//  drawsdl_xy_to_render_target
165155//============================================================
166156
trunk/src/osd/sdl/drawogl.c
r243392r243393
224224   sdl_info_ogl(sdl_window_info *window)
225225   : osd_renderer(window, FLAG_NEEDS_OPENGL), m_blittimer(0),
226226      m_screen_width(0), m_screen_height(0),
227      m_last_width(0), m_last_height(0),
227228#if (SDLMAME_SDL2)
228229      m_gl_context_id(0),
229230#else
r243392r243393
252253   }
253254
254255   /* virtual */ int create(const int width, const int height);
255   /* virtual */ void resize(const int width, int const height);
256256   /* virtual */ int draw(const UINT32 dc, const int update);
257257   /* virtual */ int xy_to_render_target(const int x, const int y, int *xt, int *yt);
258258   /* virtual */ void destroy_all_textures();
r243392r243393
280280   INT32           m_blittimer;
281281   int             m_screen_width;
282282   int             m_screen_height;
283   int            m_last_width;
284   int            m_last_height;
283285
284286#if (SDLMAME_SDL2)
285287   SDL_GLContext   m_gl_context_id;
r243392r243393
754756   return 0;
755757}
756758
757//============================================================
758//  sdl_info::resize
759//============================================================
760759
761void sdl_info_ogl::resize(int width, int height)
762{
763#if (SDLMAME_SDL2)
764   m_blittimer = 3;
765#endif
766   m_init_context = 1;
767}
768
769
770760//============================================================
771761//  sdl_info::destroy
772762//============================================================
r243392r243393
12211211      return 0;
12221212   }
12231213
1214   if ((window().width() != m_last_width) || (window().height() != m_last_height))
1215   {
1216      m_last_width = window().width();
1217      m_last_height = window().height();
12241218#if (SDLMAME_SDL2)
1219      m_blittimer = 3;
1220#endif
1221      m_init_context = 1;
1222   }
1223
1224#if (SDLMAME_SDL2)
12251225   SDL_GL_MakeCurrent(window().sdl_window(), m_gl_context_id);
12261226#else
12271227   if (!m_init_context)
trunk/src/osd/sdl/drawsdl.c
r243392r243393
6565   m_last_hofs(0),
6666   m_last_vofs(0),
6767   m_old_blitwidth(0),
68   m_old_blitheight(0)
68   m_old_blitheight(0),
69   m_last_width(0),
70   m_last_height(0)
6971   { }
7072
7173   /* virtual */ int create(const int width, const int height);
72   /* virtual */ void resize(const int width, const int height);
7374   /* virtual */ int draw(const UINT32 dc, const int update);
7475   /* virtual */ int xy_to_render_target(const int x, const int y, int *xt, int *yt);
7576   /* virtual */ void destroy_all_textures();
r243392r243393
107108   int                 m_last_vofs;
108109   int                 m_old_blitwidth;
109110   int                 m_old_blitheight;
111   int                 m_last_width;
112   int                 m_last_height;
110113};
111114
112115struct sdl_scale_mode
r243392r243393
475478}
476479
477480//============================================================
478//  sdl_info::resize
479//============================================================
480
481void sdl_info::resize(int width, int height)
482{
483#if (SDLMAME_SDL2)
484   SDL_RenderSetViewport(m_sdl_renderer, NULL);
485#else
486   const sdl_scale_mode *sdl_sm = &scale_modes[video_config.scale_mode];
487   if (sdl_sm->is_yuv)
488   {
489      yuv_overlay_init();
490   }
491#endif
492}
493
494
495//============================================================
496481//  sdl_info::destroy
497482//============================================================
498483
r243392r243393
580565      return 0;
581566   }
582567
568   if ((window().width() != m_last_width) || (window().height() != m_last_height))
569   {
570      m_last_width = window().width();
571      m_last_height = window().height();
572#if (SDLMAME_SDL2)
573      SDL_RenderSetViewport(m_sdl_renderer, NULL);
574#else
575      const sdl_scale_mode *sdl_sm = &scale_modes[video_config.scale_mode];
576      if (sdl_sm->is_yuv)
577      {
578         yuv_overlay_init();
579      }
580#endif
581   }
582
583583   // lock it if we need it
584584#if (!SDLMAME_SDL2)
585585
trunk/src/osd/sdl/window.c
r243392r243393
491491   window->m_height = window->m_sdlsurf->h;
492492#endif
493493
494
495   window->renderer().resize(window->m_width, window->m_height);
496
497494   window->blit_surface_size(window->m_width, window->m_height);
498495
499496   window->clear();
trunk/src/osd/sdl/window.h
r243392r243393
5858   bool check_flag(const int flag) { return ((m_flags & flag)) == flag; }
5959
6060   virtual int create(const int width, const int height) = 0;
61   virtual void resize(const int width, const int height) = 0;
6261   virtual int draw(const UINT32 dc, const int update) = 0;
6362   virtual int xy_to_render_target(const int x, const int y, int *xt, int *yt) = 0;
6463   virtual void destroy_all_textures() = 0;


Previous 199869 Revisions Next


© 1997-2024 The MAME Team