API Docs for: 2.0.0

Class SAGE2_BlockStreamingApp

Class defined in: public/src/SAGE2_BlockStreamingApp.js:21

Base class for block streaming applications

draw( date )
public/src/SAGE2_BlockStreamingApp.js:720

Draw function, draws each blocks

Parameters:
  • date <Date>

    current time from the server

event( eventType, position, user_id, data, date )
public/src/SAGE2_BlockStreamingApp.js:952

Handles event processing for the app

Parameters:
  • eventType <String>

    the type of event

  • position <Object>

    contains the x and y positions of the event

  • user_id <Object>

    data about the user who triggered the event

  • data <Object>

    object containing extra data about the event,

  • date <Date>

    current time from the server

firstLoad( )
public/src/SAGE2_BlockStreamingApp.js:706

Loads the app from a previous state and initializes the buffers and textures

getShaders( vertFile, fragFile, callback )
public/src/SAGE2_BlockStreamingApp.js:256

Loads the shaders files from the server and creates the shaders

Parameters:
  • vertFile <String>

    filename of the vertex shader

  • fragFile <String>

    filename of the fragment shader

  • callback <Function>

    to be executed when shaders are loaded

init( data )
public/src/SAGE2_BlockStreamingApp.js:28

Init method, creates an 'canvas' tag in the DOM and setups up WebGL

Parameters:
  • data <Object>

    contains initialization values (id, width, height, ...)

initBuffers( )
public/src/SAGE2_BlockStreamingApp.js:323

Initializes the GL buffers for the blocks of pixel

initGL( )
public/src/SAGE2_BlockStreamingApp.js:100

Gets a WebGL context from the canvas

initShaders( callback )
public/src/SAGE2_BlockStreamingApp.js:130

Loads the yuv2rgb shaders

Parameters:
  • callback <Function>

    to be executed when shaders are loaded

initTextures( )
public/src/SAGE2_BlockStreamingApp.js:402

Initializes the GL textures for the blocks of pixel

move( date )
public/src/SAGE2_BlockStreamingApp.js:918

After move, show the canvas and update the coordinate system (resizeCanvas)

Parameters:
  • date <Date>

    current time from the server

resize( date )
public/src/SAGE2_BlockStreamingApp.js:940

After resize, show the canvas and update the coordinate system (resizeCanvas)

Parameters:
  • date <Date>

    current time from the server

resizeCanvas( )
public/src/SAGE2_BlockStreamingApp.js:852

Resize the canvas in local (client) coordinates, never bigger than the local screen

setValidBlocksFalse( )
public/src/SAGE2_BlockStreamingApp.js:115

Reset valid blocks to false

startMove( date )
public/src/SAGE2_BlockStreamingApp.js:908

When a move starts, hide the canvas

Parameters:
  • date <Date>

    current time from the server

startResize( date )
public/src/SAGE2_BlockStreamingApp.js:930

When a resize starts, hide the canvas

Parameters:
  • date <Date>

    current time from the server

textureData( blockIdx, yuvBuffer )
public/src/SAGE2_BlockStreamingApp.js:539

Sets a block of pixels into a buffer

Parameters:
  • blockIdx <Number>

    index to the block

  • yuvBuffer <Object>

    pixel data

updateTextures( )
public/src/SAGE2_BlockStreamingApp.js:621

Update the textures with the new pixel data