gfx

package
Version: v0.3.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 19, 2019 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package gfx is an add-on for SDL2 that provides drawing of graphics primitives, rotozoomer, MMX image filters and framerate control.

Index

Constants

View Source
const (
	FPS_UPPER_LIMIT = 200 // highest possible rate supported by framerate controller in Hz (1/s)
	FPS_LOWER_LIMIT = 1   // lowest possible rate supported by framerate controller in Hz (1/s)
	FPS_DEFAULT     = 30  // default rate of framerate controller in Hz (1/s)
)

FPS definitions.

View Source
const (
	SMOOTHING_OFF = 0 // disable anti-aliasing (no smoothing)
	SMOOTHING_ON  = 1 // enable anti-aliasing (smoothing)
)

Rotozoom smoothing settings.

Variables

This section is empty.

Functions

func AACircleColor

func AACircleColor(renderer *sdl.Renderer, x, y, rad int32, color sdl.Color) bool

AACircleColor draws anti-aliased circle with blending. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__gfx_primitives_8c.html#aad64361b01181e6aff940add96d23c61)

func AACircleRGBA

func AACircleRGBA(renderer *sdl.Renderer, x, y, rad int32, r, g, b, a uint8) bool

AACircleRGBA draws anti-aliased circle with blending. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__gfx_primitives_8c.html#a332780885aa2cfdc2de34dcff8d67e8b)

func AAEllipseColor

func AAEllipseColor(renderer *sdl.Renderer, x, y, rx, ry int32, color sdl.Color) bool

AAEllipseColor draws anti-aliased ellipse with blending. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__gfx_primitives_8c.html#a1c7d20dcba8e0d7ce483f4c854c438be)

func AAEllipseRGBA

func AAEllipseRGBA(renderer *sdl.Renderer, x, y, rx, ry int32, r, g, b, a uint8) bool

AAEllipseRGBA draws anti-aliased ellipse with blending. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__gfx_primitives_8c.html#ab9f0f00d7fb2f04aa9ba1630e31a27bf)

func AALineColor

func AALineColor(renderer *sdl.Renderer, x1, y1, x2, y2 int32, color sdl.Color) bool

AALineColor draws anti-aliased line with alpha blending. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__gfx_primitives_8c.html#a25c56f2def855db01dcf7ff7f7356182)

func AALineRGBA

func AALineRGBA(renderer *sdl.Renderer, x1, y1, x2, y2 int32, r, g, b, a uint8) bool

AALineRGBA draws anti-aliased line with alpha blending. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__gfx_primitives_8c.html#a25c56f2def855db01dcf7ff7f7356182)

func AAPolygonColor

func AAPolygonColor(renderer *sdl.Renderer, vx, vy []int16, color sdl.Color) bool

AAPolygonColor draws anti-aliased polygon with alpha blending. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__gfx_primitives_8c.html#a09950a50e8806e88bb20c543c58cc6a8)

func AAPolygonRGBA

func AAPolygonRGBA(renderer *sdl.Renderer, vx, vy []int16, r, g, b, a uint8) bool

AAPolygonRGBA draws anti-aliased polygon with alpha blending. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__gfx_primitives_8c.html#a7d08522e52d8290c5c498ce435fa51f0)

func ArcColor

func ArcColor(renderer *sdl.Renderer, x, y, rad, start, end int32, color sdl.Color) bool

ArcColor draws arc with blending. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__gfx_primitives_8c.html#a461b8ac31e00306aee5f8a4c242671d2)

func ArcRGBA

func ArcRGBA(renderer *sdl.Renderer, x, y, rad, start, end int32, r, g, b, a uint8) bool

ArcRGBA draws arc with blending. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__gfx_primitives_8c.html#a2aff993d0d8d64564e16145f401d3cf1)

func BezierColor

func BezierColor(renderer *sdl.Renderer, vx, vy []int16, s int, color sdl.Color) bool

BezierColor draws a bezier curve with alpha blending. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__gfx_primitives_8c.html#adfe8f9c42d29a090aae15eeb19b80d51)

func BezierRGBA

func BezierRGBA(renderer *sdl.Renderer, vx, vy []int16, s int, r, g, b, a uint8) bool

BezierRGBA draws a bezier curve with alpha blending. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__gfx_primitives_8c.html#a4b7fbf6cc366abdf345a25308d53e125)

func BoxColor

func BoxColor(renderer *sdl.Renderer, x1, y1, x2, y2 int32, color sdl.Color) bool

BoxColor draws box (filled rectangle) with blending. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__gfx_primitives_8c.html#a6bb30dfc32d0aee20271a0356a2e2fd0)

func BoxRGBA

func BoxRGBA(renderer *sdl.Renderer, x1, y1, x2, y2 int32, r, g, b, a uint8) bool

BoxRGBA draws box (filled rectangle) with blending. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__gfx_primitives_8c.html#a1864b3062793a7f7dd81aaf8c8abd6b0)

func CharacterColor

func CharacterColor(renderer *sdl.Renderer, x, y int32, c byte, color sdl.Color) bool

CharacterColor draws a character of the currently set font. On first call for a particular character and color combination, the function needs to generate the character surface (slower. Subsequent calls blit a cached surface (fast). Uses alpha blending if A<255 in color. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__gfx_primitives_8c.html#aef5fdeb16c4578d8cd50e106299e993e)

func CharacterRGBA

func CharacterRGBA(renderer *sdl.Renderer, x, y int32, c, r, g, b, a uint8) bool

CharacterRGBA draws a character of the currently set font. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__gfx_primitives_8c.html#a96379d2ce808aa642afb57bced0c670e)

func CircleRGBA

func CircleRGBA(renderer *sdl.Renderer, x, y, rad int32, r, g, b, a uint8) bool

CircleRGBA draws circle with blending. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__gfx_primitives_8c.html#a7fe51d4c9426c8795e58c7ddd313b0a4)

func EllipseColor

func EllipseColor(renderer *sdl.Renderer, x, y, rx, ry int32, color sdl.Color) bool

EllipseColor draws ellipse with blending. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__gfx_primitives_8c.html#a476cff7702f4be9090871e35859782f0)

func EllipseRGBA

func EllipseRGBA(renderer *sdl.Renderer, x, y, rx, ry int32, r, g, b, a uint8) bool

EllipseRGBA draws ellipse with blending. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__gfx_primitives_8c.html#a18c8a26c9009482eec40f9f4a6945fd1)

func FilledCircleColor

func FilledCircleColor(renderer *sdl.Renderer, x, y, rad int32, color sdl.Color) bool

FilledCircleColor draws filled circle with blending. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__gfx_primitives_8c.html#a39147d1282ec814a1b9e31243aad0359)

func FilledCircleRGBA

func FilledCircleRGBA(renderer *sdl.Renderer, x, y, rad int32, r, g, b, a uint8) bool

FilledCircleRGBA draws filled circle with blending. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__gfx_primitives_8c.html#a562ba6b18fb70547cd50cb3bb0f70272)

func FilledEllipseColor

func FilledEllipseColor(renderer *sdl.Renderer, x, y, rx, ry int32, color sdl.Color) bool

FilledEllipseColor draws filled ellipse with blending. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__gfx_primitives_8c.html#a8fed50800f2f1bdfaa048698f5052f25)

func FilledEllipseRGBA

func FilledEllipseRGBA(renderer *sdl.Renderer, x, y, rx, ry int32, r, g, b, a uint8) bool

FilledEllipseRGBA draws filled ellipse with blending. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__gfx_primitives_8c.html#a33595ad996dd0dcccde3abbcef540eec)

func FilledPieColor

func FilledPieColor(renderer *sdl.Renderer, x, y, rad, start, end int32, color sdl.Color) bool

FilledPieColor draws filled pie with alpha blending. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__gfx_primitives_8c.html#a2c30ee985b2513dc58d9b19d4e71562b)

func FilledPieRGBA

func FilledPieRGBA(renderer *sdl.Renderer, x, y, rad, start, end int32, r, g, b, a uint8) bool

FilledPieRGBA draws filled pie with alpha blending. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__gfx_primitives_8c.html#a4ffdfd2834f3ef0fd0ee622b5f1d16b8)

func FilledPolygonColor

func FilledPolygonColor(renderer *sdl.Renderer, vx, vy []int16, color sdl.Color) bool

FilledPolygonColor draws filled polygon with alpha blending. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__gfx_primitives_8c.html#af22692175cb73329410cbcc7d7491c4d)

func FilledPolygonRGBA

func FilledPolygonRGBA(renderer *sdl.Renderer, vx, vy []int16, r, g, b, a uint8) bool

FilledPolygonRGBA draws filled polygon with alpha blending. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__gfx_primitives_8c.html#a40ef0b898905c190c193f0f55deb5a6c)

func FilledTrigonColor

func FilledTrigonColor(renderer *sdl.Renderer, x1, y1, x2, y2, x3, y3 int32, color sdl.Color) bool

FilledTrigonColor draws filled trigon (triangle) with alpha blending. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__gfx_primitives_8c.html#a78d4ed2372527f3b78f5893928b0f519)

func FilledTrigonRGBA

func FilledTrigonRGBA(renderer *sdl.Renderer, x1, y1, x2, y2, x3, y3 int32, r, g, b, a uint8) bool

FilledTrigonRGBA draws filled trigon (triangle) with alpha blending. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__gfx_primitives_8c.html#a8f318d776ff1e3c6790405e0e59e5356)

func FramerateDelay

func FramerateDelay(manager *FPSmanager) uint32

FramerateDelay delays execution to maintain a constant framerate and calculate fps. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__framerate_8c.html#afce13fa3dd37130deb4975d8b230c3ba)

func GetFramerate

func GetFramerate(manager *FPSmanager) (int, bool)

GetFramerate returns the current target framerate in Hz. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__framerate_8c.html#a575bb511d6f817ad846a788cbd08ae91)

func HlineColor

func HlineColor(renderer *sdl.Renderer, x1, x2, y int32, color sdl.Color) bool

HlineColor draws horizontal line with blending. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__gfx_primitives_8c.html#ac211a904dce45093315e15b10c80d8ac)

func HlineRGBA

func HlineRGBA(renderer *sdl.Renderer, x1, x2, y int32, r, g, b, a uint8) bool

HlineRGBA draws horizontal line with blending. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__gfx_primitives_8c.html#a6608a0d1d4c7e16fa1afcbd3eb5c3850)

func ImageFilterAbsDiff

func ImageFilterAbsDiff(src1, src2, dest []byte) bool

ImageFilterAbsDiff filters using AbsDiff: D = | S1 - S2 |. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__image_filter_8c.html#a472909f904274255cd6793c520172e48)

func ImageFilterAdd

func ImageFilterAdd(src1, src2, dest []byte) bool

ImageFilterAdd filters using Add: D = saturation255(S1 + S2). (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__image_filter_8c.html#a9f06507eb0b63198dbd67495d61c9b20)

func ImageFilterAddByte

func ImageFilterAddByte(src1, dest []byte, c byte) bool

ImageFilterAddByte filters using AddByte: D = saturation255(S + C). (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__image_filter_8c.html#a812cb307cb60ef31f1ffe81a9eee6bb1)

func ImageFilterAddUint

func ImageFilterAddUint(src1, dest []byte, c uint) bool

ImageFilterAddUint filters using AddUint: D = saturation255((S[i] + Cs[i % 4]), Cs=Swap32((uint)C). (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__image_filter_8c.html#a660543426c47dfec39a349eb3b8f905b)

func ImageFilterBinarizeUsingThreshold

func ImageFilterBinarizeUsingThreshold(src1, dest []byte, t byte) bool

ImageFilterBinarizeUsingThreshold filters using BinarizeUsingThreshold: D = (S >= T) ? 255:0. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__image_filter_8c.html#a951a062e15df290a137428e1e0f4d5ce)

func ImageFilterBitAnd

func ImageFilterBitAnd(src1, src2, dest []byte) bool

ImageFilterBitAnd filters using BitAnd: D = S1 & S2. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__image_filter_8c.html#a85837ce1b5de1f907b6b9053922b5cbc)

func ImageFilterBitNegation

func ImageFilterBitNegation(src1, dest []byte) bool

ImageFilterBitNegation filters using BitNegation: D = !S. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__image_filter_8c.html#ac3abfaa8ec2e88c3c4893588c5555856)

func ImageFilterBitOr

func ImageFilterBitOr(src1, src2, dest []byte) bool

ImageFilterBitOr filters using BitOr: D = S1 | S2. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__image_filter_8c.html#a5cf1c477f4e32d02f74ee95d9f7b0021)

func ImageFilterClipToRange

func ImageFilterClipToRange(src1, dest []byte, tmin, tmax byte) bool

ImageFilterClipToRange filters using ClipToRange: D = (S >= Tmin) & (S <= Tmax) S:Tmin | Tmax. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__image_filter_8c.html#ab7224abc4ecc1b8a6f4441ef8379515f)

func ImageFilterDiv

func ImageFilterDiv(src1, src2, dest []byte) bool

ImageFilterDiv filters using Div: D = S1 / S2. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__image_filter_8c.html#a0ea22f01c6a4724bac307da3e5355f58)

func ImageFilterMMXdetect

func ImageFilterMMXdetect() bool

ImageFilterMMXdetect reports whether MMX check for filter functions is enabled. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__image_filter_8c.html#a798ce71024ee1a1d1b174fd60fe79917)

func ImageFilterMMXoff

func ImageFilterMMXoff()

ImageFilterMMXoff disables MMX check for filter functions and force to use non-MMX C based code. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__image_filter_8c.html#a5dff661660755161bb4aaf6199cd1384)

func ImageFilterMMXon

func ImageFilterMMXon()

ImageFilterMMXon enables MMX check for filter functions and use MMX code if available. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__image_filter_8c.html#a353ee234c3b51b33c4c5c4b30db5832d)

func ImageFilterMean

func ImageFilterMean(src1, src2, dest []byte) bool

ImageFilterMean filters using Mean: D = S1/2 + S2/2. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__image_filter_8c.html#ace072118fef77973210eb04fb4bfc779)

func ImageFilterMult

func ImageFilterMult(src1, src2, dest []byte) bool

ImageFilterMult filters using Mult: D = saturation255(S1 * S2). (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__image_filter_8c.html#af4633031d40a9ea0956a2f3c6c87a384)

func ImageFilterMultByByte

func ImageFilterMultByByte(src1, dest []byte, c byte) bool

ImageFilterMultByByte filters using MultByByte: D = saturation255(S * C). (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__image_filter_8c.html#a06f7a19d6e2fc89d7b48cc45d715806d)

func ImageFilterMultDivby2

func ImageFilterMultDivby2(src1, src2, dest []byte) bool

ImageFilterMultDivby2 filter using MultDivby2: D = saturation255(S1/2 * S2) (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__image_filter_8c.html#a80737f6427c7bdb30d39a92f6524fc14)

func ImageFilterMultDivby4

func ImageFilterMultDivby4(src1, src2, dest []byte) bool

ImageFilterMultDivby4 filters using MultDivby4: D = saturation255(S1/2 * S2/2). (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__image_filter_8c.html#a30e685653eb1050c7d48feaeb8f801a1)

func ImageFilterMultNor

func ImageFilterMultNor(src1, src2, dest []byte) bool

ImageFilterMultNor filters using MultNor: D = S1 * S2. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__image_filter_8c.html#a5f3c9fd40426bb46eba5ac167505dcc5)

func ImageFilterNormalizeLinear

func ImageFilterNormalizeLinear(src1, dest []byte, cmin, cmax, nmin, nmax int) bool

ImageFilterNormalizeLinear filters using NormalizeLinear: D = saturation255((Nmax - Nmin)/(Cmax - Cmin)*(S - Cmin) + Nmin). (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__image_filter_8c.html#ab018ace4db884cac953b06b09c00828b)

func ImageFilterShiftLeft

func ImageFilterShiftLeft(src1, dest []byte, n byte) bool

ImageFilterShiftLeft filters ShiftLeft: D = saturation255(S << N). (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__image_filter_8c.html#a98372fea76310903abef7808db10d226)

func ImageFilterShiftLeftByte

func ImageFilterShiftLeftByte(src1, dest []byte, n byte) bool

ImageFilterShiftLeftByte filters using ShiftLeftByte: D = (S << N). (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__image_filter_8c.html#a4561a73b249a26babc4c469ffbdae604)

func ImageFilterShiftLeftUint

func ImageFilterShiftLeftUint(src1, dest []byte, n byte) bool

ImageFilterShiftLeftUint filters using ShiftLeftUint: D = ((uint)S << N). (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__image_filter_8c.html#a250e796fb2db470da0a78b74b78114e8)

func ImageFilterShiftRight

func ImageFilterShiftRight(src1, dest []byte, n byte) bool

ImageFilterShiftRight filters using ShiftRight: D = saturation0(S >> N). (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__image_filter_8c.html#a68851aed2dcc5dfd2f3b258236f3b88c)

func ImageFilterShiftRightAndMultByByte

func ImageFilterShiftRightAndMultByByte(src1, dest []byte, n, c byte) bool

ImageFilterShiftRightAndMultByByte filters using ShiftRightAndMultByByte: D = saturation255((S >> N) * C). (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__image_filter_8c.html#a0713d6c267fba9756d6beae81e89f9e4)

func ImageFilterShiftRightUint

func ImageFilterShiftRightUint(src1, dest []byte, n byte) bool

ImageFilterShiftRightUint filters using ShiftRightUint: D = saturation0((uint)S[i] >> N). (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__image_filter_8c.html#a540d4625d76bcd03318c2a59ce650fdb)

func ImageFilterSub

func ImageFilterSub(src1, src2, dest []byte) bool

ImageFilterSub filters using Sub: D = saturation0(S1 - S2). (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__image_filter_8c.html#a3c01cf8576ea7a0dfc09dbaa953c9287)

func ImageFilterSubByte

func ImageFilterSubByte(src1, dest []byte, c byte) bool

ImageFilterSubByte filters using SubByte: D = saturation0(S - C). (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__image_filter_8c.html#a387fb6f0d48cc5d08f37f7f9b92d14b2)

func ImageFilterSubUint

func ImageFilterSubUint(src1, dest []byte, c uint) bool

ImageFilterSubUint filters using SubUint: D = saturation0(S[i] - Cs[i % 4]), Cs=Swap32((uint)C). (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__image_filter_8c.html#abb343ef95e22945e1d4d648b2e176e64)

func LineColor

func LineColor(renderer *sdl.Renderer, x1, y1, x2, y2 int32, color sdl.Color) bool

LineColor draws line with alpha blending. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__gfx_primitives_8c.html#ad44c550fab3cb736eb049713ede94052)

func LineRGBA

func LineRGBA(renderer *sdl.Renderer, x1, y1, x2, y2 int32, r, g, b, a uint8) bool

LineRGBA draws line with alpha blending. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__gfx_primitives_8c.html#a760139e11a9ae5defeb755ca0c794f5f)

func PieColor

func PieColor(renderer *sdl.Renderer, x, y, rad, start, end int32, color sdl.Color) bool

PieColor draws pie (outline) with alpha blending. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__gfx_primitives_8c.html#a3c2bc64deabda74933f31daba6bed7be)

func PieRGBA

func PieRGBA(renderer *sdl.Renderer, x, y, rad, start, end int32, r, g, b, a uint8) bool

PieRGBA draws pie (outline) with alpha blending. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__gfx_primitives_8c.html#a8442f2c2bedbe27c96d8d44319981992)

func PixelColor

func PixelColor(renderer *sdl.Renderer, x, y int32, color sdl.Color) bool

PixelColor pixel draws with blending enabled if a<255. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__gfx_primitives_8c.html#ae6f8690e5c5a85d3263c8e16727b34ef)

func PixelRGBA

func PixelRGBA(renderer *sdl.Renderer, x, y int32, r, g, b, a uint8) bool

PixelRGBA pixel draws with blending enabled if a<255. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__gfx_primitives_8c.html#a7b6f83bdef72f6b356664a93841381c0)

func PolygonColor

func PolygonColor(renderer *sdl.Renderer, vx, vy []int16, color sdl.Color) bool

PolygonColor draws polygon with alpha blending. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__gfx_primitives_8c.html#a2d692dc25f3b579b386dff8dcd9cbc00)

func PolygonRGBA

func PolygonRGBA(renderer *sdl.Renderer, vx, vy []int16, r, g, b, a uint8) bool

PolygonRGBA draws polygon with alpha blending. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__gfx_primitives_8c.html#ae55541ec58990420dc6dc6b9d61f33d6)

func RectangleColor

func RectangleColor(renderer *sdl.Renderer, x1, y1, x2, y2 int32, color sdl.Color) bool

RectangleColor draws rectangle with blending. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__gfx_primitives_8c.html#a6ab25c393f6e5f8d68ea3365f6ea98d2)

func RectangleRGBA

func RectangleRGBA(renderer *sdl.Renderer, x1, y1, x2, y2 int32, r, g, b, a uint8) bool

RectangleRGBA draws rectangle with blending. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__gfx_primitives_8c.html#a40991c6eeb936d35d0a8e8aa95268f72)

func RotateSurface90Degrees

func RotateSurface90Degrees(src *sdl.Surface, numClockwiseTurns int) *sdl.Surface

RotateSurface90Degrees rotates a 32 bit surface in increments of 90 degrees. Specialized 90 degree rotator which rotates a 'src' surface in 90 degree increments clockwise returning a new surface. Faster than rotozoomer since not scanning or interpolation takes place. Input surface must be 32 bit. (code contributed by J. Schiller, improved by C. Allport and A. Schiffler) (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__rotozoom_8c.html#a77563d68634cb2624d4f2f0bcdc19e73)

func RotoZoomSurface

func RotoZoomSurface(src *sdl.Surface, angle, zoom float64, smooth int) *sdl.Surface

RotoZoomSurface rotates and zooms a surface and optional anti-aliasing. Rotates and zoomes a 32bit or 8bit 'src' surface to newly created 'dst' surface. 'angle' is the rotation in degrees and 'zoom' a scaling factor. If 'smooth' is set then the destination 32bit surface is anti-aliased. If the surface is not 8bit or 32bit RGBA/ABGR it will be converted into a 32bit RGBA format on the fly. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__rotozoom_8c.html#a5f64ed53eeee5f2667971c857698d1e5)

func RotoZoomSurfaceXY

func RotoZoomSurfaceXY(src *sdl.Surface, angle, zoomx, zoomy float64, smooth int) *sdl.Surface

RotoZoomSurfaceXY rotates and zooms a surface with different horizontal and vertival scaling factors and optional anti-aliasing. Rotates and zooms a 32bit or 8bit 'src' surface to newly created 'dst' surface. 'angle' is the rotation in degrees, 'zoomx and 'zoomy' scaling factors. If 'smooth' is set then the destination 32bit surface is anti-aliased. If the surface is not 8bit or 32bit RGBA/ABGR it will be converted into a 32bit RGBA format on the fly. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__rotozoom_8c.html#aab98b5b0da4ea468bacf47f7b85f0ee2)

func RoundedBoxColor

func RoundedBoxColor(renderer *sdl.Renderer, x1, y1, x2, y2, rad int32, color sdl.Color) bool

RoundedBoxColor draws rounded-corner box (filled rectangle) with blending. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__gfx_primitives_8c.html#a718c4f31d1e145106959c2a77d5fee9d)

func RoundedBoxRGBA

func RoundedBoxRGBA(renderer *sdl.Renderer, x1, y1, x2, y2, rad int32, r, g, b, a uint8) bool

RoundedBoxRGBA draws rounded-corner box (filled rectangle) with blending. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__gfx_primitives_8c.html#aad706348fec18631d7bc48a2d91f5b4d)

func RoundedRectangleColor

func RoundedRectangleColor(renderer *sdl.Renderer, x1, y1, x2, y2, rad int32, color sdl.Color) bool

RoundedRectangleColor draws rounded-corner rectangle with blending. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__gfx_primitives_8c.html#a830dd9dcfa39f4718aa2c269060326d0)

func RoundedRectangleRGBA

func RoundedRectangleRGBA(renderer *sdl.Renderer, x1, y1, x2, y2, rad int32, r, g, b, a uint8) bool

RoundedRectangleRGBA draws rounded-corner rectangle with blending. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__gfx_primitives_8c.html#a300272b3b799f09ca6cd5c541b19f07a)

func SetFont

func SetFont(fontdata []byte, cw, ch uint32)

SetFont sets or resets the current global font data. The font data array is organized in follows: [fontdata] = [character 0][character 1]...[character 255] where [character n] = [byte 1 row 1][byte 2 row 1]...[byte {pitch} row 1][byte 1 row 2] ...[byte {pitch} row height] where [byte n] = [bit 0]...[bit 7] where [bit n] = [0 for transparent pixel|1 for colored pixel]. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__gfx_primitives_8c.html#afacd57651ec0e0ccab60753636862cd0)

func SetFontRotation

func SetFontRotation(rotation uint32)

SetFontRotation sets current global font character rotation steps. Default is 0 (no rotation). 1 = 90deg clockwise. 2 = 180deg clockwise. 3 = 270deg clockwise. Changing the rotation, will reset the character cache.(http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__gfx_primitives_8c.html#aef6796a883f07d31bbf7c7df6d1153d2)

func ShrinkSurface

func ShrinkSurface(src *sdl.Surface, factorx, factory int) *sdl.Surface

ShrinkSurface shrink a surface by an integer ratio using averaging. Shrinks a 32bit or 8bit 'src' surface to a newly created 'dst' surface. 'factorx' and 'factory' are the shrinking ratios (i.e. 2=1/2 the size, 3=1/3 the size, etc.) The destination surface is antialiased by averaging the source box RGBA or Y information. If the surface is not 8bit or 32bit RGBA/ABGR it will be converted into a 32bit RGBA format on the fly. The input surface is not modified. The output surface is newly allocated. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__rotozoom_8c.html#aad3bf0cd89cc39ff874ffa778fa1495d)

func StringColor

func StringColor(renderer *sdl.Renderer, x, y int32, s string, color sdl.Color) bool

StringColor draws a string in the currently set font. The spacing between consequtive characters in the string is the fixed number of pixels of the character width of the current global font. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__gfx_primitives_8c.html#a62d2ba55abc7673f2dfa29e6bbffefdf)

func StringRGBA

func StringRGBA(renderer *sdl.Renderer, x, y int32, s string, r, g, b, a uint8) bool

StringRGBA draws a string in the currently set font. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__gfx_primitives_8c.html#a6ca71826e311bdd9acf13b009256aa1c)

func TexturedPolygon

func TexturedPolygon(renderer *sdl.Renderer, vx, vy []int16, surface *sdl.Surface, textureDX, textureDY int) bool

TexturedPolygon draws a polygon filled with the given texture. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__gfx_primitives_8c.html#a65137af308ea878f28abc95419e8aef5)

func ThickLineColor

func ThickLineColor(renderer *sdl.Renderer, x1, y1, x2, y2, width int32, color sdl.Color) bool

ThickLineColor draws a thick line with alpha blending. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__gfx_primitives_8c.html#a1494109358b4e4b7ec300d83e3f90300)

func ThickLineRGBA

func ThickLineRGBA(renderer *sdl.Renderer, x1, y1, x2, y2, width int32, r, g, b, a uint8) bool

ThickLineRGBA draws a thick line with alpha blending. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__gfx_primitives_8c.html#a8b24d64b51e23592c93abc2aa50c818e)

func TrigonColor

func TrigonColor(renderer *sdl.Renderer, x1, y1, x2, y2, x3, y3 int32, color sdl.Color) bool

TrigonColor draws trigon (triangle outline) with alpha blending. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__gfx_primitives_8c.html#a7465d08ef930ebb5442c7dd246fed4b5)

func TrigonRGBA

func TrigonRGBA(renderer *sdl.Renderer, x1, y1, x2, y2, x3, y3 int32, r, g, b, a uint8) bool

TrigonRGBA draws trigon (triangle outline) with alpha blending. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__gfx_primitives_8c.html#a45d6a7edcd8b25e1a60e39b7f60bda3f)

func VlineColor

func VlineColor(renderer *sdl.Renderer, x, y1, y2 int32, color sdl.Color) bool

VlineColor draws vertical line with blending. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__gfx_primitives_8c.html#a9b45060155a19fee24f998d7790f1d67)

func VlineRGBA

func VlineRGBA(renderer *sdl.Renderer, x, y1, y2 int32, r, g, b, a uint8) bool

VlineRGBA draws vertical line with blending. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__gfx_primitives_8c.html#a8b79ac1e779755aee92b04f3a6cfc5d7)

func ZoomSurface

func ZoomSurface(src *sdl.Surface, zoomx, zoomy float64, smooth int) *sdl.Surface

ZoomSurface zoom a surface by independent horizontal and vertical factors with optional smoothing. Zooms a 32bit or 8bit 'src' surface to newly created 'dst' surface. 'zoomx' and 'zoomy' are scaling factors for width and height. If 'smooth' is on then the destination 32bit surface is anti-aliased. If the surface is not 8bit or 32bit RGBA/ABGR it will be converted into a 32bit RGBA format on the fly. If zoom factors are negative, the image is flipped on the axes. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__rotozoom_8c.html#abdd772b2f6b1f26134e4e90cda657a21)

func ZoomSurfaceSize

func ZoomSurfaceSize(width, height int32, zoomx, zoomy float64) (dstwidth, dstheight int)

ZoomSurfaceSize calculates the size of the target surface for a gfx.ZoomSurface() call. The minimum size of the target surface is 1. The input factors can be positive or negative. (http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__rotozoom_8c.html#a8ba40859c1a977dae87488dd8be1bf9a)

Types

type FPSmanager

type FPSmanager struct {
	FrameCount uint32
	RateTicks  float32
	BaseTicks  uint32
	LastTicks  uint32
	Rate       uint32
}

FPSmanager contains the state and timing information of the framerate controller.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto