WebGLGraphics Class
A set of functions used by the webGL renderer to draw the primitive graphics data
Item Index
Methods
- buildCircle static
- buildComplexPoly static
- buildLine static
- buildPoly static
- buildRectangle static
- buildRoundedRectangle static
- quadraticBezierCurve static
- renderGraphics static
- switchMode static
- updateGraphics static
Methods
buildCircle
-
graphicsData -
webGLData
Builds a circle to draw
Parameters:
-
graphicsDataGraphicsThe graphics object to draw
-
webGLDataObject
buildComplexPoly
-
graphicsData -
webGLData
Builds a complex polygon to draw
Parameters:
-
graphicsDataGraphicsThe graphics object containing all the necessary properties
-
webGLDataObject
buildLine
-
graphicsData -
webGLData
Builds a line to draw
Parameters:
-
graphicsDataGraphicsThe graphics object containing all the necessary properties
-
webGLDataObject
buildPoly
-
graphicsData -
webGLData
Builds a polygon to draw
Parameters:
-
graphicsDataGraphicsThe graphics object containing all the necessary properties
-
webGLDataObject
buildRectangle
-
graphicsData -
webGLData
Builds a rectangle to draw
Parameters:
-
graphicsDataGraphicsThe graphics object containing all the necessary properties
-
webGLDataObject
buildRoundedRectangle
-
graphicsData -
webGLData
Builds a rounded rectangle to draw
Parameters:
-
graphicsDataGraphicsThe graphics object containing all the necessary properties
-
webGLDataObject
quadraticBezierCurve
-
fromX -
fromY -
cpX -
cpY -
toX -
toY
Calculate the points for a quadratic bezier curve. (helper function..) Based on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c
Parameters:
-
fromXNumberOrigin point x
-
fromYNumberOrigin point x
-
cpXNumberControl point x
-
cpYNumberControl point y
-
toXNumberDestination point x
-
toYNumberDestination point y
Returns:
renderGraphics
-
graphics -
renderSession
Renders the graphics object
Parameters:
-
graphicsGraphics -
renderSessionObject
switchMode
-
webGL -
type
Parameters:
-
webGLWebGLContext -
typeNumber
updateGraphics
-
graphicsData -
gl
Updates the graphics object
Parameters:
-
graphicsDataGraphicsThe graphics object to update
-
glWebGLContextthe current WebGL drawing context
