no need to be exported
This commit is contained in:
parent
fe09ad82a8
commit
68b2c52b85
1 changed files with 12 additions and 12 deletions
|
@ -1,12 +1,12 @@
|
||||||
import genny, pixie, unicode
|
import genny, pixie, unicode
|
||||||
|
|
||||||
var lastError*: ref PixieError
|
var lastError: ref PixieError
|
||||||
|
|
||||||
proc takeError*(): string =
|
proc takeError(): string =
|
||||||
result = lastError.msg
|
result = lastError.msg
|
||||||
lastError = nil
|
lastError = nil
|
||||||
|
|
||||||
proc checkError*(): bool =
|
proc checkError(): bool =
|
||||||
result = lastError != nil
|
result = lastError != nil
|
||||||
|
|
||||||
type
|
type
|
||||||
|
@ -16,37 +16,37 @@ type
|
||||||
Matrix3* = object
|
Matrix3* = object
|
||||||
values*: array[9, float32]
|
values*: array[9, float32]
|
||||||
|
|
||||||
proc matrix3*(): Matrix3 =
|
proc matrix3(): Matrix3 =
|
||||||
cast[Matrix3](mat3())
|
cast[Matrix3](mat3())
|
||||||
|
|
||||||
proc mul*(a, b: Matrix3): Matrix3 =
|
proc mul(a, b: Matrix3): Matrix3 =
|
||||||
cast[Matrix3](cast[Mat3](a) * cast[Mat3](b))
|
cast[Matrix3](cast[Mat3](a) * cast[Mat3](b))
|
||||||
|
|
||||||
proc translate*(x, y: float32): Matrix3 =
|
proc translate(x, y: float32): Matrix3 =
|
||||||
cast[Matrix3](translate(vec2(x, y)))
|
cast[Matrix3](translate(vec2(x, y)))
|
||||||
|
|
||||||
proc rotate*(angle: float32): Matrix3 =
|
proc rotate(angle: float32): Matrix3 =
|
||||||
cast[Matrix3](rotate(angle))
|
cast[Matrix3](rotate(angle))
|
||||||
|
|
||||||
proc scale*(x, y: float32): Matrix3 =
|
proc scale(x, y: float32): Matrix3 =
|
||||||
cast[Matrix3](scale(vec2(x, y)))
|
cast[Matrix3](scale(vec2(x, y)))
|
||||||
|
|
||||||
proc inverse*(m: Matrix3): Matrix3 =
|
proc inverse(m: Matrix3): Matrix3 =
|
||||||
cast[Matrix3](inverse(cast[Mat3](m)))
|
cast[Matrix3](inverse(cast[Mat3](m)))
|
||||||
|
|
||||||
proc parseColor*(s: string): Color {.raises: [PixieError]} =
|
proc parseColor(s: string): Color {.raises: [PixieError]} =
|
||||||
try:
|
try:
|
||||||
result = parseHtmlColor(s)
|
result = parseHtmlColor(s)
|
||||||
except:
|
except:
|
||||||
let e = getCurrentException()
|
let e = getCurrentException()
|
||||||
raise newException(PixieError, e.msg, e)
|
raise newException(PixieError, e.msg, e)
|
||||||
|
|
||||||
proc drawImage2*(
|
proc drawImage2(
|
||||||
ctx: Context, image: Image, dx, dy, dWidth, dHeight: float32
|
ctx: Context, image: Image, dx, dy, dWidth, dHeight: float32
|
||||||
) {.raises: [PixieError].} =
|
) {.raises: [PixieError].} =
|
||||||
ctx.drawImage(image, dx, dy, dWidth, dHeight)
|
ctx.drawImage(image, dx, dy, dWidth, dHeight)
|
||||||
|
|
||||||
proc drawImage3*(
|
proc drawImage3(
|
||||||
ctx: Context,
|
ctx: Context,
|
||||||
image: Image,
|
image: Image,
|
||||||
sx, sy, sWidth, sHeight,
|
sx, sy, sWidth, sHeight,
|
||||||
|
|
Loading…
Reference in a new issue