medea/medea.context.js
// Get time delta and detect canvas changes
Get time delta and detect canvas changes
Get time delta and detect canvas changes
function update_stats() {
			if (dtime === undefined) {
				var old = medeactx.time;
				medeactx.time = Date.now() * 0.001;
				dtime = medeactx.time - old;
			}
			if(medeactx.cached_cw != medeactx.canvas.width) {
				medeactx.cached_cw = medeactx.canvas.width;
				medeactx.frame_flags |= medeactx.FRAME_CANVAS_SIZE_CHANGED;
			}
			if(medeactx.cached_ch != medeactx.canvas.height) {
				medeactx.cached_ch = medeactx.canvas.height;
				medeactx.frame_flags |= medeactx.FRAME_CANVAS_SIZE_CHANGED;
			}
			medeactx._UpdateFrameStatistics(dtime);
		}
function update_stats ( ) { if ( dtime === undefined ) { var old = medeactx . time ; medeactx . time = Date . now ( ) * 0.001 ; dtime = medeactx . time - old ; } if ( medeactx . cached_cw != medeactx . canvas . width ) { medeactx . cached_cw = medeactx . canvas . width ; medeactx . frame_flags |= medeactx . FRAME_CANVAS_SIZE_CHANGED ; } if ( medeactx . cached_ch != medeactx . canvas . height ) { medeactx . cached_ch = medeactx . canvas . height ; medeactx . frame_flags |= medeactx . FRAME_CANVAS_SIZE_CHANGED ; } medeactx . _UpdateFrameStatistics ( dtime ) ; }
Get time delta and detect canvas changes
Get time delta and detect canvas changes
// get time delta if not specified // check if the canvas sized changed