gfx

package
v0.4.24 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2022 License: BSD-3-Clause Imports: 3 Imported by: 51

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. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives_8h.html#a46b037505b91133ae3bd18556092a632)

func AACircleRGBA

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

AACircleRGBA draws anti-aliased circle with blending. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives_8h.html#aa0b0f764826715353e9ca0fe937d0f0f)

func AAEllipseColor

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

AAEllipseColor draws anti-aliased ellipse with blending. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives_8h.html#af676a520e9ea0deabe711da842bc1e55)

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. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives_8h.html#a12e9ff795a5b9996f07f5b0bc4f60f81)

func AALineColor

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

AALineColor draws anti-aliased line with alpha blending. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives_8h.html#a86ab777f53655a509a3ac3c008941920)

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. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives_8h.html#ad7074bc1af414cea003712621b1c7d86)

func AAPolygonColor

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

AAPolygonColor draws anti-aliased polygon with alpha blending. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives_8h.html#a54c28d1e469b52483e952258c2f6f69b)

func AAPolygonRGBA

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

AAPolygonRGBA draws anti-aliased polygon with alpha blending. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives_8h.html#a6a18d7838305c636b8462e0ba587d859)

func ArcColor

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

ArcColor draws arc with blending. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives_8h.html#a493fe37b39da582668431ab7e1e3dbf0)

func ArcRGBA

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

ArcRGBA draws arc with blending. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives_8h.html#acf0091a17501f375f2b55032134b3017)

func BezierColor

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

BezierColor draws a bezier curve with alpha blending. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives_8h.html#a74d59d17ba21ce5d8c84697989456bfb)

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. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives_8h.html#a6cb082e6eb4253d591927c6bf7eba06f)

func BoxColor

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

BoxColor draws box (filled rectangle) with blending. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives_8h.html#a5799b0d1e99252b19d9acc77e7a94541)

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. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives_8h.html#a903bb79c5a03077047ff8820df263bd8)

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. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives_8h.html#aaeed3ccb288e032856cff488bdba381d)

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. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives_8h.html#abff6cc81b9a35e9380e0b02da905714f)

func CircleRGBA

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

CircleRGBA draws circle with blending. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives_8h.html#a1daab46976bf585477be1cfcef2fe1ad)

func EllipseColor

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

EllipseColor draws ellipse with blending. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives_8h.html#a9ac841634751689ddb1c26babe10f3f6)

func EllipseRGBA

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

EllipseRGBA draws ellipse with blending. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives_8h.html#a3ed26f8b2a25cb94a6412aa772f533aa)

func FilledCircleColor

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

FilledCircleColor draws filled circle with blending. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives_8h.html#ab973fd9868527fb13078c356d4a9c6f7)

func FilledCircleRGBA

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

FilledCircleRGBA draws filled circle with blending. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives_8h.html#a666bd764e2fe962656e5829d0aad5ba6)

func FilledEllipseColor

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

FilledEllipseColor draws filled ellipse with blending. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives_8h.html#aa3119e2dd056874c0ca92ded41fea43c)

func FilledEllipseRGBA

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

FilledEllipseRGBA draws filled ellipse with blending. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives_8h.html#a5240918c243c3e60dd8ae1cef50dd529)

func FilledPieColor

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

FilledPieColor draws filled pie with alpha blending. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives_8h.html#a86f189dabaa2a26115ecb819ad7da8e5)

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. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives_8h.html#adad0f423ae093b5c3cad51a438954a50)

func FilledPolygonColor

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

FilledPolygonColor draws filled polygon with alpha blending. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives_8h.html#a97308e4f19363baee0e5bdecee3265f1)

func FilledPolygonRGBA

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

FilledPolygonRGBA draws filled polygon with alpha blending. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives_8h.html#ab80fe08abcf78a6ce8f037f3fdc15625)

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. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives_8h.html#a57fd7355780a114b9d72b1e9591f955d)

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. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives_8h.html#a273cf4a88abf6c6a5e019b2c58ee2423)

func FramerateDelay

func FramerateDelay(manager *FPSmanager) uint32

FramerateDelay delays execution to maintain a constant framerate and calculate fps. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__framerate_8h.html#afc3b999d59d913771cd2588299096274)

func GetFramerate

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

GetFramerate returns the current target framerate in Hz. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__framerate_8h.html#aebe43457dbb9fbfec6de18e7adf49e21)

func HlineColor

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

HlineColor draws horizontal line with blending. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives_8h.html#a0d1977c09c0bcfe77b4e1a792ce1e79a)

func HlineRGBA

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

HlineRGBA draws horizontal line with blending. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives_8h.html#ace5a96b77edbccba3170852b093503aa)

func ImageFilterAbsDiff

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

ImageFilterAbsDiff filters using AbsDiff: D = | S1 - S2 |. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__image_filter_8h.html#aaa9e8718bcba856ddee135385ebdec26)

func ImageFilterAdd

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

ImageFilterAdd filters using Add: D = saturation255(S1 + S2). (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__image_filter_8h.html#a1e4de9be8feb43595719fd0494601952)

func ImageFilterAddByte

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

ImageFilterAddByte filters using AddByte: D = saturation255(S + C). (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__image_filter_8h.html#ad00178c9482a9959023a6bec03c8dba5)

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). (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__image_filter_8h.html#ab7d7f266f047a63755a2341cdfe018e9)

func ImageFilterBinarizeUsingThreshold

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

ImageFilterBinarizeUsingThreshold filters using BinarizeUsingThreshold: D = (S >= T) ? 255:0. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__image_filter_8h.html#a02d89f9fa47f1f5c2d969a9d86acb041)

func ImageFilterBitAnd

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

ImageFilterBitAnd filters using BitAnd: D = S1 & S2. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__image_filter_8h.html#a47a7564f857e42dcc2e3b5f8cd2943a9)

func ImageFilterBitNegation

func ImageFilterBitNegation(src1, dest []byte) bool

ImageFilterBitNegation filters using BitNegation: D = !S. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__image_filter_8h.html#ac11af558f478ec72eb2b61e8bdf43225)

func ImageFilterBitOr

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

ImageFilterBitOr filters using BitOr: D = S1 | S2. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__image_filter_8h.html#a7c6288c51dcf074b4ba8f1bf0c349f02)

func ImageFilterClipToRange

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

ImageFilterClipToRange filters using ClipToRange: D = (S >= Tmin) & (S <= Tmax) S:Tmin | Tmax. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__image_filter_8h.html#a46a5728f8857b0a06694828375527451)

func ImageFilterDiv

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

ImageFilterDiv filters using Div: D = S1 / S2. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__image_filter_8h.html#a2944f525acc587ca8d701fbdf1a49c36)

func ImageFilterMMXdetect

func ImageFilterMMXdetect() bool

ImageFilterMMXdetect reports whether MMX check for filter functions is enabled. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__image_filter_8h.html#ae3f67cbe712f604b16b6de3f4bfbf31c)

func ImageFilterMMXoff

func ImageFilterMMXoff()

ImageFilterMMXoff disables MMX check for filter functions and force to use non-MMX C based code. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__image_filter_8h.html#afc46d09d46b1302becfc170214dee0c0)

func ImageFilterMMXon

func ImageFilterMMXon()

ImageFilterMMXon enables MMX check for filter functions and use MMX code if available. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__image_filter_8h.html#a0b1d8468dc6e6304b62276acbb7336f6)

func ImageFilterMean

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

ImageFilterMean filters using Mean: D = S1/2 + S2/2. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__image_filter_8h.html#a6012332e1b5c33fad53d71c7848db823)

func ImageFilterMult

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

ImageFilterMult filters using Mult: D = saturation255(S1 * S2). (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__image_filter_8h.html#a1966f22bee81045917e776fd64821051)

func ImageFilterMultByByte

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

ImageFilterMultByByte filters using MultByByte: D = saturation255(S * C). (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__image_filter_8h.html#aef668f157cc152554872ccac491ee2f7)

func ImageFilterMultDivby2

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

ImageFilterMultDivby2 filter using MultDivby2: D = saturation255(S1/2 * S2) (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__image_filter_8h.html#a462b662e34e0ea7f1da83fb493f9d9f5)

func ImageFilterMultDivby4

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

ImageFilterMultDivby4 filters using MultDivby4: D = saturation255(S1/2 * S2/2). (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__image_filter_8h.html#a52e4de0e4818b4256c189f35e68e1242)

func ImageFilterMultNor

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

ImageFilterMultNor filters using MultNor: D = S1 * S2. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__image_filter_8h.html#aff3256626208bfc490268cf07e8a29af)

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). (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__image_filter_8h.html#ade0729be518dec0b26ec164ff4e63476)

func ImageFilterShiftLeft

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

ImageFilterShiftLeft filters ShiftLeft: D = saturation255(S << N). (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__image_filter_8h.html#a29891456dee25b30c8da8f767d7545c5)

func ImageFilterShiftLeftByte

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

ImageFilterShiftLeftByte filters using ShiftLeftByte: D = (S << N). (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__image_filter_8h.html#a656657c3f31effa01163532fd96b3011)

func ImageFilterShiftLeftUint

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

ImageFilterShiftLeftUint filters using ShiftLeftUint: D = ((uint)S << N). (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__image_filter_8h.html#a3ea712cad49735ca672e1d2da1e68516)

func ImageFilterShiftRight

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

ImageFilterShiftRight filters using ShiftRight: D = saturation0(S >> N). (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__image_filter_8h.html#a1ed688eb128d71af36386e9853d001a9)

func ImageFilterShiftRightAndMultByByte

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

ImageFilterShiftRightAndMultByByte filters using ShiftRightAndMultByByte: D = saturation255((S >> N) * C). (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__image_filter_8h.html#ad8d11768b921ba823d412166903340b8)

func ImageFilterShiftRightUint

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

ImageFilterShiftRightUint filters using ShiftRightUint: D = saturation0((uint)S[i] >> N). (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__image_filter_8h.html#a2e5ec075145b34c5ea797ffa70891e53)

func ImageFilterSub

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

ImageFilterSub filters using Sub: D = saturation0(S1 - S2). (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__image_filter_8h.html#a720893e0f6512aee4dd3875b9c9607b5)

func ImageFilterSubByte

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

ImageFilterSubByte filters using SubByte: D = saturation0(S - C). (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__image_filter_8h.html#a5899423c538fa35660ded0f5945c014f)

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). (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__image_filter_8h.html#a8532da4511ef9657c8688f66e6309118)

func LineColor

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

LineColor draws line with alpha blending. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives_8h.html#a84f917eb19ea41b586f1afa9eb4b552c)

func LineRGBA

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

LineRGBA draws line with alpha blending. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives_8h.html#ab56ec3fb82b59f2ab1d1877b6adb3b82)

func PieColor

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

PieColor draws pie (outline) with alpha blending. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives_8h.html#a9f9070739e72ea242fd48239a4ff48e4)

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. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives_8h.html#a3b8baf3eecea4738ac2a1c28af4bfb41)

func PixelColor

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

PixelColor pixel draws with blending enabled if a<255. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives_8h.html#a2bdb83ac58c2e091ef26f720bdeb66bd)

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. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives_8h.html#a6f4a05ba92bf39420280ee8ccf961e77)

func PolygonColor

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

PolygonColor draws polygon with alpha blending. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives_8h.html#a3577e5aee374d5176a3587343e11c4aa)

func PolygonRGBA

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

PolygonRGBA draws polygon with alpha blending. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives_8h.html#a69baa68215840bb54ddd0281e6ad63a0)

func RectangleColor

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

RectangleColor draws rectangle with blending. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives_8h.html#a53b996645c0acdf5cb74c969503e791e)

func RectangleRGBA

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

RectangleRGBA draws rectangle with blending. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives_8h.html#aa926924c3650d10d6a20cd7e4036a9a4)

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) (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__rotozoom_8h.html#ac2858dec47549c8f82360568b5a29363)

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. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__rotozoom_8h.html#a6f5f31a362f63370dc60049df14d6856)

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. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__rotozoom_8h.html#a592d84489ce544c050a9f3fe0e04f3f6)

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. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives_8h.html#a13ffcecd9c186d2522ae1e66bdedf8d7)

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. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives_8h.html#a3db064ca0f03a2c46852661494ff7a65)

func RoundedRectangleColor

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

RoundedRectangleColor draws rounded-corner rectangle with blending. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives_8h.html#a314698defb7da3f3415ddc5468315d83)

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. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives_8h.html#a2b54ba16d7e7243fb1921a286156cad9)

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]. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives_8h.html#adcbe6b74a9e0fef4165bc7bdb73294ec)

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. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives_8h.html#a2349bb02995a364f6b1069c46a09b7ba)

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. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__rotozoom_8h.html#a9adfe732cbca348e3287096e7c67e72d)

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. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives_8h.html#a329e9c81b07e5af08d73e3b3d6078bf0)

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. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives_8h.html#a744afe14139c1c553204a47cc284e478)

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. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives_8h.html#a3b4c81592098da506f534d4a81b266f2)

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. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives_8h.html#a613c16293c3571b695cc0c60358bb862)

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. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives_8h.html#a247136a562abec2649718d38f5819b44)

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. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives_8h.html#af4fc0fdb33e57047d9347d3fe7b1bdbd)

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. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives_8h.html#a152662f6985587d137837086aaa95311)

func VlineColor

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

VlineColor draws vertical line with blending. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives_8h.html#af8cf6591ddc81242369e50cb3e159dfe)

func VlineRGBA

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

VlineRGBA draws vertical line with blending. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives_8h.html#a60d71d2bc6e450d8063256ebc37f21f5)

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. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__rotozoom_8h.html#a0867857132421429994198cabacb0528)

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. (https://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__rotozoom_8h.html#a87a121da75a099fd980295c759a7005d)

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
y or Y : Canonical URL