•Try•
Catch

Immediate Mode

one thing to almost remember about HTML5 Canvas

HTML5 Canvas is pretty amazing. I actually haven't worked with it extensively, but just by cracking open the HTML5 Canvas book there's some must-share, must-understand knowledge about the drawing mode behind Canvas and why it may be something new to you.

I've forgotten and had to look back up the specific terms more times than I can count and you may too. Luckily as long as you understand how these two drawing modes are fundamentally different you are that much better off.

HTML5 runs in what's called immediate mode, while things like Flash, Silverlight, and SVG run in retained mode. So what's the difference?

 

Retained Mode

In retained mode, a display list of objects is kept by the graphics renderer and objects are displayed on the screen according to attributes set in code. This keeps the programmer away from the low-level operations, but gives her less control over the final rendering of the bitmapped screen.

- HTML5 Canvas

Basically what that means is in Flash you can do something like "create ball" and then however many frames later "move ball", and the ball will still exist.

 

Immediate Mode

HTML5 Canvas is an immediate mode bitmapped area of the screen that can be manipulated with JavaScript. Immediate mode refers to the way the canvas renders pixels on the screen. HTML5 Canvas completely redraws the bitmapped screen on every frame using Canvas API calls from JavaScript. As a programmer, your job is to set up the screen display before each frame is rendered so that the correct pixels will be shown.

- HTML5 Canvas

So in canvas its "create ball" and then a few frames later there is no ball, unless you recreate one. In Canvas everything is gone at the end of every frame.

Comments (0)


Add a Comment





Allowed tags: <b><i><br>Comment:


** Immediate vs Retained **

modmore