Class GLDrawBuf

drawing buffer - image container which allows to perform some drawing operations

class GLDrawBuf
  : DrawBuf
  , GLConfigCallback;

Constructors

NameDescription
this (dx, dy, framebuffer)

Fields

NameTypeDescription
_dx int
_dy int
_framebuffer bool
_framebufferId uint
_scene Scene
_alpha uint
_clipRect Rect
_id uint
_ninePatch NinePatch*
_onDestroyCallback void function(uint)
_refCount intcount of references to this object from Ref

Properties

NameTypeDescription
height[get] intreturns current height
scene[get] Sceneget current scene (exists only between beforeDrawing() and afterDrawing() calls)
width[get] intreturns current width
alpha[get] uintget current alpha setting (to be applied to all drawing operations)
alpha[set] uintset new alpha setting (to be applied to all drawing operations)
bpp[get] intreturns buffer bits per pixel
clipRect[get] Rectreturns clipping rectangle, when clipRect.isEmpty == true -- means no clipping.
clipRect[set] const(Rect)returns clipping rectangle, or (0,0,dx,dy) when no clipping.
hasClipping[get] bool
hasNinePatch[get] boolcheck whether there is nine-patch information available for drawing buffer
id[get] uintunique ID of drawbug instance, for using with hardware accelerated rendering for caching
intersectClipRect[set] const(Rect)sets new clipping rectangle, intersect with previous one.
isClippedOut[set] boolreturns true if rectangle is completely clipped out and cannot be drawn.
ninePatch[get] const(NinePatch)*get nine patch information pointer, null if this is not a nine patch image buffer
ninePatch[set] NinePatch*set nine patch information pointer, null if this is not a nine patch image buffer
onDestroyCallback[set] void function(uint)
refCount[get] intreturns current value of reference counter

Methods

NameDescription
afterDrawing () reserved for hardware-accelerated drawing - ends drawing queue
beforeDrawing () reserved for hardware-accelerated drawing - begins drawing queue
clear () cleanup resources
drawCustomOpenGLScene (rc, handler) draw custom OpenGL scene
drawFragment (x, y, src, srcrect) draw source buffer rectangle contents to destination buffer
drawGlyph (x, y, glyph, color) draw 8bit alpha image - usually font glyph using specified color (clipping is applied)
drawLine (p1, p2, colour) draw line from point p1 to p2 with specified color
drawPixel (x, y, color) draw pixel at (x, y) with specified color
drawRescaled (dstrect, src, srcrect) draw source buffer rectangle contents to destination buffer rectangle applying rescaling
fill (color) fill the whole buffer with solid color (no clipping applied)
fillGradientRect (rc, color1, color2, color3, color4) fill rectangle with a gradient (clipping is applied)
fillRect (rc, color) fill rectangle with solid color (clipping is applied)
fillRectPattern (rc, color, pattern) fill rectangle with solid color and pattern (clipping is applied) 0=solid fill, 1 = dotted
resize (width, height) resize buffer
restoreConfiguration ()
saveConfiguration ()
addAlpha (alpha) apply additional transparency to current drawbuf alpha value
addRef () increments reference counter
applyAlpha (argb) applies current drawbuf alpha to argb color value
applyClipping (rc) apply clipRect and buffer bounds clipping to rectangle
applyClipping (rc, rc2) apply clipRect and buffer bounds clipping to rectangle; if clippinup applied to first rectangle, reduce second rectangle bounds proportionally.
calcRectRoundedCornerRadius (corners, w, h, keepSquareXY)
detectNinePatch () override to detect nine patch using image 1-pixel border; returns true if 9-patch markup is found in image.
drawEllipseArcF (centerX, centerY, xRadius, yRadius, startAngle, endAngle, lineWidth, lineColor, fillColor) draw ellipse arc or filled ellipse arc
drawEllipseF (centerX, centerY, xRadius, yRadius, lineWidth, lineColor, fillColor) draw ellipse or filled ellipse
drawFocusRect (rc, colors) draw focus rectangle; vertical gradient supported - colors[0] is top color, colors[1] is bottom color
drawFrame (rc, frameColor, frameSideWidths, innerAreaColor) draws rectangle frame of specified color and widths (per side), and optinally fills inner area
drawImage (x, y, src) draw unscaled image at specified coordinates
drawLineF (p1, p2, width, colour) draw line of arbitrary width in float coordinates
drawLineSegmentF (p0, p1, p2, p3, width, colour) draw line of arbitrary width in float coordinates p1..p2 with angle based on previous (p0..p1) and next (p2..p3) segments
drawRoundedRectF (rect, corners, keepSquareXY, frameWidth, frameColor, fillColor) draws rect with rounded corners
fillPolyF (points, colour) draw filled polyline (vertexes must be in clockwise order)
fillQuadF (p1, p2, p3, p4, colour) draw filled quad in float coordinates
fillTriangleF (p1, p2, p3, colour) draw filled triangle in float coordinates
invalidate () Call to remove this image from OpenGL cache when image is updated.
makeArcPath (center, radiusX, radiusY, startAngle, endAngle)
makeRoundedRectPath (rect, corners, keepSquareXY, outCornerSegmentsStart) builds outer rounded rect path the last parameter optionally writes out indices of first segment of corners excluding top-left
onDestroyCallback ()
polyLine (points, colour, cycled) draw poly line of width == 1px; when cycled is true, connect first and last point
polyLineF (points, width, colour, cycled, innerAreaColour) draw poly line of arbitrary width in float coordinates; when cycled is true, connect first and last point (optionally fill inner area)
releaseRef () decrement reference counter, destroy object if no more references left
resetClipping () init clip rectangle to full buffer size
transformColors (transform) create drawbuf with copy of current buffer with changed colors (returns this if not supported)
fillTriangleFClipped (p1, p2, p3, colour) draw filled triangle in float coordinates; clipping is already applied
calcLineSegmentQuad (p0, p1, p2, p3, width, quad)
intersectClipF (p1, p2, p1moved, p2moved) find intersection of line p1..p2 with clip rectangle
intersectVectors (p1, dir1, p2, dir2)

Aliases

NameDescription
~this