GL Studio Safety Critical Embedded C++ Runtime Library
|
#include <gls_nine_patch.h>
Classes | |
struct | InitParameters |
Public Types | |
enum | Edge { EDGE_LEFT = 0u , EDGE_RIGHT = 1u , EDGE_TOP = 2u , EDGE_BOTTOM = 3u , NUM_EDGES = 4u } |
enum | { NUM_VERTS = 16u , NUM_DRAW_VERTS_NO_CENTER = 32u , NUM_DRAW_VERTS = 36u } |
enum | { LOWER_LEFT_CORNER_INDEX = 0u , LOWER_RIGHT_CORNER_INDEX = 3u , UPPER_LEFT_CORNER_INDEX = 12u , UPPER_RIGHT_CORNER_INDEX = 15u } |
![]() | |
enum | ObjectType { OBJECT_TYPE_COMPOSITE , OBJECT_TYPE_RENDERABLE } |
enum | PickMode { PICK_MODE_NEVER , PICK_MODE_FIRST , PICK_MODE_ALWAYS } |
Public Member Functions | |
GlsNinePatch (const InitParameters &initParameters, GlsEventDispatcher *const eventDispatcher) | |
virtual void | Draw (GlsStateManager &gl, const GlsFloat64 time) |
virtual void | OffsetTexture (const GlsVector2D &offset) |
void | SetTextureEdge (const Edge edge, const GlsUInt32 value) |
void | SetVertexEdge (const Edge edge, const GlsFloat32 value) |
void | SetCenterVisible (const GlsBool visible) |
![]() | |
virtual void | SetAlphaMode (const GlsAlphaMode alphaMode) |
virtual void | SetFillColor (const GlsColor &fillColor) |
virtual void | SetLineColor (const GlsColor &lineColor) |
virtual void | SetLineWidth (const GlsFloat32 lineWidth) |
virtual void | SetPolygonMode (const GlsPolygonMode polygonMode) |
virtual void | SetTextureIndex (const GlsUInt32 textureIndex) |
virtual void | OffsetTexture (const GlsVector2D &offset)=0 |
![]() | |
virtual void | Draw (GlsStateManager &gl, const GlsFloat64 time)=0 |
virtual void | Calculate (const GlsFloat64 time) |
virtual GlsDisplayObject * | PickTest (const GlsVector2D &windowCoord, GlsInputManager &inputManager, const GlsMatrixAffineD::GLMatrixAffineF &parentDrawMatrix) |
GlsDisplayObject * | HandleEvent (GlsEvent &event) |
ObjectType | GetObjectType (void) const |
void | SetBlinking (const GlsBool blinking) |
void | SetBlinkRate (const GlsFloat32 blinkRate) |
void | SetDynamicRotation (const GlsVector3D &dynamicRotation) |
void | SetDynamicScale (const GlsVector3D &dynamicScale) |
void | SetDynamicTranslation (const GlsVector3D &dynamicTranslation) |
void | SetVisibility (const GlsBool visible) |
void | SetParent (GlsDisplayObject *const parent) |
void | SetPickMode (const PickMode pickMode) |
GlsBool | NeedCalculate (void) const |
void | InvalidatePickCache (void) |
Additional Inherited Members | |
![]() | |
static const GLclampf | ALPHA_MODE_2_LEVEL_REF |
The GlsNinePatch abstracts a set of nine polygons which contain edges that maintain the same width/height after scaling the object.
anonymous enum |
enum GlsNinePatch::Edge |
GlsNinePatch::GlsNinePatch | ( | const InitParameters & | initParameters, |
GlsEventDispatcher *const | eventDispatcher | ||
) |
Constructor - create instance
initParameters | initialization parametets |
eventDispatcher | event dispatcher for this object else GLS_NULL |
|
protectedvirtual |
Destructor - shall never be called
|
virtual |
Draws this nine patch
gl | GL State manager for OpenGL into which polygon is drawn |
time | the elaspsed time in seconds since program start |
Implements GlsDisplayObject.
|
virtual |
Offset the texture on the object
offset | x, y offset for texture |
Implements GlsRenderObject.
|
protected |
Output the vertices in the array to GL
gl | GL state manager to receive verts |
doTextureCoordinates | GLS_TRUE to send texture coordinates with each vert else GLS_FALSE |
doVertexColors | GLS_TRUE to send vertex colors with each vert else GLS_FALSE |
|
protected |
Output the vertices in the array to GL
gl | GL state manager to receive verts |
doTextureCoordinates | GLS_TRUE to send texture coordinates with each vert else GLS_FALSE |
doVertexColors | GLS_TRUE to send vertex colors with each vert else GLS_FALSE |
|
protected |
Adjusts the vertices based on the current texture and vertex edge settings.
void GlsNinePatch::SetCenterVisible | ( | const GlsBool | visible | ) |
Sets whether the center is drawn or not
visible | boolean to control visibility of center quad |
Sets the texture edge value IN from the nine patch defined bounding region
edge | enumerated above |
value | in pixel measurements |
void GlsNinePatch::SetVertexEdge | ( | const Edge | edge, |
const GlsFloat32 | value | ||
) |
Sets the vertex edge value IN from the nine patch defined bounding region
edge | enumerated above |
value | in unit measurements |
|
protected |
Returns whether the total width or height is greater than the opposite edges combined
|
protected |
Whether or not the center patch will be drawn
|
protected |
current texture offset accumulated by OffsetTexture()
Values representing the distance from the edge of the texture that makes up the NinePatch borders. Units are in pixels and are the distance IN from the edge of the texture.
Values representing the original distance from the edge of the texture that makes up the NinePatch borders. Units are in pixels and are the distance IN from the edge of the texture.
|
protected |
array of vertices and texture vertices that are unaltered from initialization
|
protected |
Values representing the size of edges of the NinePatch. Units are in logical units measure going IN from the edge of the NinePatch Values range from 0.0f to the total width of the nine patch minus the opposite edge.
|
protected |
Array of vertices that defines the NinePatch, arranged as follows: 12–13—14—15 | | | | 8-—9—10—11 | | | | 4-—5-—6-—7 | | | | 0-—1-—2-—3 array of vertices and texture vertices for nine patch