src/bbcvdu.c
// Change to a new screen mode:
Change to a new screen mode.
Change to a new screen mode .
static void newmode (short wx, short wy, short cx, short cy, short nc, signed char bc) 
{
	SDL_Texture *tex ;
	if (cx < 8) cx = 8 ;
        if (cy < 8) cy = 8 ;
	sizex = wx ;
	sizey = wy ;
	charx = cx ;
	pixelx = cx >> 3 ;
	chary = cy ;
	pixely = cy >> 3 ;
	cursb = cy ;
	colmsk = nc - 1 ;
	tex = SDL_GetRenderTarget (memhdc) ;
	SDL_SetRenderTarget (memhdc, NULL) ;
#if defined(__ANDROID__) || defined(__IPHONEOS__)
	{
		int w, h, wr, hr ;
		SDL_GL_GetDrawableSize (hwndProg, &w, &h) ;
		wr = (w << 15) / wx ;
		hr = (h << 15) / wy ;
		if (wr < hr)
			zoom = wr ;
		else
			zoom = hr ;
	}
#else
	{
		SDL_DisplayMode dm ;
		SDL_SetWindowSize (hwndProg, wx, wy) ;
		SDL_GetDesktopDisplayMode (0, &dm) ;
		SDL_SetWindowPosition (hwndProg, (dm.w - wx) >> 1, (dm.h - wy) >> 1) ;
	}
#endif
	SDL_SetRenderTarget (memhdc, tex) ;
	if ((modeno == 7) || ((modeno == -1) && (cx >= 16) && (cy >= 16)))
	{
		gfxPrimitivesSetFont (ttxtfont, 16, 16) ;
		gfxPrimitivesSetFontZoom (cx / 16,  cy / 16) ;
	}
	else
	{
		gfxPrimitivesSetFont (bbcfont, 8, 8) ;
		gfxPrimitivesSetFontZoom (cx / 8, cy / 8) ;
	}
	rescol () ;
	minit (bc) ;
}
static void newmode ( short wx , short wy , short cx , short cy , short nc , signed char bc ) { SDL_Texture * tex ; if ( cx < 8 ) cx = 8 ; if ( cy < 8 ) cy = 8 ; sizex = wx ; sizey = wy ; charx = cx ; pixelx = cx >> 3 ; chary = cy ; pixely = cy >> 3 ; cursb = cy ; colmsk = nc - 1 ; tex = SDL_GetRenderTarget ( memhdc ) ; SDL_SetRenderTarget ( memhdc , NULL ) ; #if defined ( __ANDROID__ ) || defined ( __IPHONEOS__ ) { int w , h , wr , hr ; SDL_GL_GetDrawableSize ( hwndProg , & w , & h ) ; wr = ( w << 15 ) / wx ; hr = ( h << 15 ) / wy ; if ( wr < hr ) zoom = wr ; else zoom = hr ; } #else { SDL_DisplayMode dm ; SDL_SetWindowSize ( hwndProg , wx , wy ) ; SDL_GetDesktopDisplayMode ( 0 , & dm ) ; SDL_SetWindowPosition ( hwndProg , ( dm . w - wx ) >> 1 , ( dm . h - wy ) >> 1 ) ; } #endif SDL_SetRenderTarget ( memhdc , tex ) ; if ( ( modeno == 7 ) || ( ( modeno == -1 ) && ( cx >= 16 ) && ( cy >= 16 ) ) ) { gfxPrimitivesSetFont ( ttxtfont , 16 , 16 ) ; gfxPrimitivesSetFontZoom ( cx / 16 , cy / 16 ) ; } else { gfxPrimitivesSetFont ( bbcfont , 8 , 8 ) ; gfxPrimitivesSetFontZoom ( cx / 8 , cy / 8 ) ; } rescol ( ) ; minit ( bc ) ; }
Change to a new screen mode:
Change to a new screen mode :
// Set font