Difference between revisions of "Jsvx"

From April
Jump to: navigation, search
Line 5: Line 5:
 
=== Vx_world ===
 
=== Vx_world ===
 
A vx_world is a collection of objects that can be rendered in the same scene. Most simple applications only need one vx_world, but nothing says you can’t have more. You can think of a vx_world as a setting, a scene, or a room. If objects can appear in the same camera frame,  they need to be in the same vx_world. A vx_world is created with a call to vx_world_create:
 
A vx_world is a collection of objects that can be rendered in the same scene. Most simple applications only need one vx_world, but nothing says you can’t have more. You can think of a vx_world as a setting, a scene, or a room. If objects can appear in the same camera frame,  they need to be in the same vx_world. A vx_world is created with a call to vx_world_create:
<code>vx_world *vw = vx_world_create();</code>
+
vx_world *vw = vx_world_create();
  
 
=== Vx_buffer ===
 
=== Vx_buffer ===

Revision as of 19:07, 2 April 2015

The Boilerplate

Before we dive in, we need to discuss the basic building blocks of an application in Jsvx.

Vx_world

A vx_world is a collection of objects that can be rendered in the same scene. Most simple applications only need one vx_world, but nothing says you can’t have more. You can think of a vx_world as a setting, a scene, or a room. If objects can appear in the same camera frame, they need to be in the same vx_world. A vx_world is created with a call to vx_world_create:

vx_world *vw = vx_world_create();

Vx_buffer

A vx_buffer is a collection of objects in a vx_world that are rendered together. They represent a group of objects that can be “turned on and off”, similar to a layer in many photo editing platforms. Vx_buffers are also the only way to render objects in Jsvx. To render an object, or collection of objects, you follow these steps.

Vx_canvas

A Vx_canvas represents a portion of a literal display device such as a computer monitor or a phone screen. (Does it? look through the code)

Vx_layer

A vx_layer represents a “view” into a vx_world. It acts like a moveable camera that inspects the scene (the vx_world). Vx_layers are also responsible for communicating user-initiated events such as mouse clicks and keystrokes to the server system.