updated SDL wrapper
This commit is contained in:
parent
03744be67e
commit
e7140f290b
8 changed files with 732 additions and 747 deletions
File diff suppressed because it is too large
Load diff
|
|
@ -39,10 +39,10 @@ const # Some rates in Hz
|
||||||
type
|
type
|
||||||
PFPSmanager* = ptr TFPSmanager
|
PFPSmanager* = ptr TFPSmanager
|
||||||
TFPSmanager*{.final.} = object # ---- Structures
|
TFPSmanager*{.final.} = object # ---- Structures
|
||||||
framecount*: Uint32
|
framecount*: uint32
|
||||||
rateticks*: float32
|
rateticks*: float32
|
||||||
lastticks*: Uint32
|
lastticks*: uint32
|
||||||
rate*: Uint32
|
rate*: uint32
|
||||||
|
|
||||||
PColorRGBA* = ptr TColorRGBA
|
PColorRGBA* = ptr TColorRGBA
|
||||||
TColorRGBA*{.final.} = object
|
TColorRGBA*{.final.} = object
|
||||||
|
|
@ -79,102 +79,102 @@ proc framerateDelay*(manager: PFPSmanager){.cdecl,
|
||||||
#
|
#
|
||||||
# Note: all ___Color routines expect the color to be in format 0xRRGGBBAA
|
# Note: all ___Color routines expect the color to be in format 0xRRGGBBAA
|
||||||
# Pixel
|
# Pixel
|
||||||
proc pixelColor*(dst: PSurface, x: int16, y: int16, color: Uint32): cint{.
|
proc pixelColor*(dst: PSurface, x: int16, y: int16, color: uint32): cint{.
|
||||||
cdecl, importc: "pixelColor", dynlib: gfxLibName.}
|
cdecl, importc: "pixelColor", dynlib: gfxLibName.}
|
||||||
proc pixelRGBA*(dst: PSurface, x: int16, y: int16, r: byte, g: byte,
|
proc pixelRGBA*(dst: PSurface, x: int16, y: int16, r: byte, g: byte,
|
||||||
b: byte, a: byte): cint{.cdecl, importc: "pixelRGBA",
|
b: byte, a: byte): cint{.cdecl, importc: "pixelRGBA",
|
||||||
dynlib: gfxLibName.}
|
dynlib: gfxLibName.}
|
||||||
# Horizontal line
|
# Horizontal line
|
||||||
proc hlineColor*(dst: PSurface, x1: int16, x2: int16, y: int16, color: Uint32): cint{.
|
proc hlineColor*(dst: PSurface, x1: int16, x2: int16, y: int16, color: uint32): cint{.
|
||||||
cdecl, importc: "hlineColor", dynlib: gfxLibName.}
|
cdecl, importc: "hlineColor", dynlib: gfxLibName.}
|
||||||
proc hlineRGBA*(dst: PSurface, x1: int16, x2: int16, y: int16, r: byte,
|
proc hlineRGBA*(dst: PSurface, x1: int16, x2: int16, y: int16, r: byte,
|
||||||
g: byte, b: byte, a: byte): cint{.cdecl, importc: "hlineRGBA",
|
g: byte, b: byte, a: byte): cint{.cdecl, importc: "hlineRGBA",
|
||||||
dynlib: gfxLibName.}
|
dynlib: gfxLibName.}
|
||||||
# Vertical line
|
# Vertical line
|
||||||
proc vlineColor*(dst: PSurface, x: int16, y1: int16, y2: int16, color: Uint32): cint{.
|
proc vlineColor*(dst: PSurface, x: int16, y1: int16, y2: int16, color: uint32): cint{.
|
||||||
cdecl, importc: "vlineColor", dynlib: gfxLibName.}
|
cdecl, importc: "vlineColor", dynlib: gfxLibName.}
|
||||||
proc vlineRGBA*(dst: PSurface, x: int16, y1: int16, y2: int16, r: byte,
|
proc vlineRGBA*(dst: PSurface, x: int16, y1: int16, y2: int16, r: byte,
|
||||||
g: byte, b: byte, a: byte): cint{.cdecl, importc: "vlineRGBA",
|
g: byte, b: byte, a: byte): cint{.cdecl, importc: "vlineRGBA",
|
||||||
dynlib: gfxLibName.}
|
dynlib: gfxLibName.}
|
||||||
# Rectangle
|
# Rectangle
|
||||||
proc rectangleColor*(dst: PSurface, x1: int16, y1: int16, x2: int16,
|
proc rectangleColor*(dst: PSurface, x1: int16, y1: int16, x2: int16,
|
||||||
y2: int16, color: Uint32): cint{.cdecl,
|
y2: int16, color: uint32): cint{.cdecl,
|
||||||
importc: "rectangleColor", dynlib: gfxLibName.}
|
importc: "rectangleColor", dynlib: gfxLibName.}
|
||||||
proc rectangleRGBA*(dst: PSurface, x1: int16, y1: int16, x2: int16,
|
proc rectangleRGBA*(dst: PSurface, x1: int16, y1: int16, x2: int16,
|
||||||
y2: int16, r: byte, g: byte, b: byte, a: byte): cint{.
|
y2: int16, r: byte, g: byte, b: byte, a: byte): cint{.
|
||||||
cdecl, importc: "rectangleRGBA", dynlib: gfxLibName.}
|
cdecl, importc: "rectangleRGBA", dynlib: gfxLibName.}
|
||||||
# Filled rectangle (Box)
|
# Filled rectangle (Box)
|
||||||
proc boxColor*(dst: PSurface, x1: int16, y1: int16, x2: int16, y2: int16,
|
proc boxColor*(dst: PSurface, x1: int16, y1: int16, x2: int16, y2: int16,
|
||||||
color: Uint32): cint{.cdecl, importc: "boxColor",
|
color: uint32): cint{.cdecl, importc: "boxColor",
|
||||||
dynlib: gfxLibName.}
|
dynlib: gfxLibName.}
|
||||||
proc boxRGBA*(dst: PSurface, x1: int16, y1: int16, x2: int16, y2: int16,
|
proc boxRGBA*(dst: PSurface, x1: int16, y1: int16, x2: int16, y2: int16,
|
||||||
r: byte, g: byte, b: byte, a: byte): cint{.cdecl,
|
r: byte, g: byte, b: byte, a: byte): cint{.cdecl,
|
||||||
importc: "boxRGBA", dynlib: gfxLibName.}
|
importc: "boxRGBA", dynlib: gfxLibName.}
|
||||||
# Line
|
# Line
|
||||||
proc lineColor*(dst: PSurface, x1: int16, y1: int16, x2: int16, y2: int16,
|
proc lineColor*(dst: PSurface, x1: int16, y1: int16, x2: int16, y2: int16,
|
||||||
color: Uint32): cint{.cdecl, importc: "lineColor",
|
color: uint32): cint{.cdecl, importc: "lineColor",
|
||||||
dynlib: gfxLibName.}
|
dynlib: gfxLibName.}
|
||||||
proc lineRGBA*(dst: PSurface, x1: int16, y1: int16, x2: int16, y2: int16,
|
proc lineRGBA*(dst: PSurface, x1: int16, y1: int16, x2: int16, y2: int16,
|
||||||
r: byte, g: byte, b: byte, a: byte): cint{.cdecl,
|
r: byte, g: byte, b: byte, a: byte): cint{.cdecl,
|
||||||
importc: "lineRGBA", dynlib: gfxLibName.}
|
importc: "lineRGBA", dynlib: gfxLibName.}
|
||||||
# AA Line
|
# AA Line
|
||||||
proc aalineColor*(dst: PSurface, x1: int16, y1: int16, x2: int16, y2: int16,
|
proc aalineColor*(dst: PSurface, x1: int16, y1: int16, x2: int16, y2: int16,
|
||||||
color: Uint32): cint{.cdecl, importc: "aalineColor",
|
color: uint32): cint{.cdecl, importc: "aalineColor",
|
||||||
dynlib: gfxLibName.}
|
dynlib: gfxLibName.}
|
||||||
proc aalineRGBA*(dst: PSurface, x1: int16, y1: int16, x2: int16, y2: int16,
|
proc aalineRGBA*(dst: PSurface, x1: int16, y1: int16, x2: int16, y2: int16,
|
||||||
r: byte, g: byte, b: byte, a: byte): cint{.cdecl,
|
r: byte, g: byte, b: byte, a: byte): cint{.cdecl,
|
||||||
importc: "aalineRGBA", dynlib: gfxLibName.}
|
importc: "aalineRGBA", dynlib: gfxLibName.}
|
||||||
# Circle
|
# Circle
|
||||||
proc circleColor*(dst: PSurface, x: int16, y: int16, r: int16, color: Uint32): cint{.
|
proc circleColor*(dst: PSurface, x: int16, y: int16, r: int16, color: uint32): cint{.
|
||||||
cdecl, importc: "circleColor", dynlib: gfxLibName.}
|
cdecl, importc: "circleColor", dynlib: gfxLibName.}
|
||||||
proc circleRGBA*(dst: PSurface, x: int16, y: int16, rad: int16, r: byte,
|
proc circleRGBA*(dst: PSurface, x: int16, y: int16, rad: int16, r: byte,
|
||||||
g: byte, b: byte, a: byte): cint{.cdecl,
|
g: byte, b: byte, a: byte): cint{.cdecl,
|
||||||
importc: "circleRGBA", dynlib: gfxLibName.}
|
importc: "circleRGBA", dynlib: gfxLibName.}
|
||||||
# AA Circle
|
# AA Circle
|
||||||
proc aacircleColor*(dst: PSurface, x: int16, y: int16, r: int16,
|
proc aacircleColor*(dst: PSurface, x: int16, y: int16, r: int16,
|
||||||
color: Uint32): cint{.cdecl, importc: "aacircleColor",
|
color: uint32): cint{.cdecl, importc: "aacircleColor",
|
||||||
dynlib: gfxLibName.}
|
dynlib: gfxLibName.}
|
||||||
proc aacircleRGBA*(dst: PSurface, x: int16, y: int16, rad: int16, r: byte,
|
proc aacircleRGBA*(dst: PSurface, x: int16, y: int16, rad: int16, r: byte,
|
||||||
g: byte, b: byte, a: byte): cint{.cdecl,
|
g: byte, b: byte, a: byte): cint{.cdecl,
|
||||||
importc: "aacircleRGBA", dynlib: gfxLibName.}
|
importc: "aacircleRGBA", dynlib: gfxLibName.}
|
||||||
# Filled Circle
|
# Filled Circle
|
||||||
proc filledCircleColor*(dst: PSurface, x: int16, y: int16, r: int16,
|
proc filledCircleColor*(dst: PSurface, x: int16, y: int16, r: int16,
|
||||||
color: Uint32): cint{.cdecl,
|
color: uint32): cint{.cdecl,
|
||||||
importc: "filledCircleColor", dynlib: gfxLibName.}
|
importc: "filledCircleColor", dynlib: gfxLibName.}
|
||||||
proc filledCircleRGBA*(dst: PSurface, x: int16, y: int16, rad: int16,
|
proc filledCircleRGBA*(dst: PSurface, x: int16, y: int16, rad: int16,
|
||||||
r: byte, g: byte, b: byte, a: byte): cint{.cdecl,
|
r: byte, g: byte, b: byte, a: byte): cint{.cdecl,
|
||||||
importc: "filledCircleRGBA", dynlib: gfxLibName.}
|
importc: "filledCircleRGBA", dynlib: gfxLibName.}
|
||||||
# Ellipse
|
# Ellipse
|
||||||
proc ellipseColor*(dst: PSurface, x: int16, y: int16, rx: int16, ry: int16,
|
proc ellipseColor*(dst: PSurface, x: int16, y: int16, rx: int16, ry: int16,
|
||||||
color: Uint32): cint{.cdecl, importc: "ellipseColor",
|
color: uint32): cint{.cdecl, importc: "ellipseColor",
|
||||||
dynlib: gfxLibName.}
|
dynlib: gfxLibName.}
|
||||||
proc ellipseRGBA*(dst: PSurface, x: int16, y: int16, rx: int16, ry: int16,
|
proc ellipseRGBA*(dst: PSurface, x: int16, y: int16, rx: int16, ry: int16,
|
||||||
r: byte, g: byte, b: byte, a: byte): cint{.cdecl,
|
r: byte, g: byte, b: byte, a: byte): cint{.cdecl,
|
||||||
importc: "ellipseRGBA", dynlib: gfxLibName.}
|
importc: "ellipseRGBA", dynlib: gfxLibName.}
|
||||||
# AA Ellipse
|
# AA Ellipse
|
||||||
proc aaellipseColor*(dst: PSurface, xc: int16, yc: int16, rx: int16,
|
proc aaellipseColor*(dst: PSurface, xc: int16, yc: int16, rx: int16,
|
||||||
ry: int16, color: Uint32): cint{.cdecl,
|
ry: int16, color: uint32): cint{.cdecl,
|
||||||
importc: "aaellipseColor", dynlib: gfxLibName.}
|
importc: "aaellipseColor", dynlib: gfxLibName.}
|
||||||
proc aaellipseRGBA*(dst: PSurface, x: int16, y: int16, rx: int16, ry: int16,
|
proc aaellipseRGBA*(dst: PSurface, x: int16, y: int16, rx: int16, ry: int16,
|
||||||
r: byte, g: byte, b: byte, a: byte): cint{.cdecl,
|
r: byte, g: byte, b: byte, a: byte): cint{.cdecl,
|
||||||
importc: "aaellipseRGBA", dynlib: gfxLibName.}
|
importc: "aaellipseRGBA", dynlib: gfxLibName.}
|
||||||
# Filled Ellipse
|
# Filled Ellipse
|
||||||
proc filledEllipseColor*(dst: PSurface, x: int16, y: int16, rx: int16,
|
proc filledEllipseColor*(dst: PSurface, x: int16, y: int16, rx: int16,
|
||||||
ry: int16, color: Uint32): cint{.cdecl,
|
ry: int16, color: uint32): cint{.cdecl,
|
||||||
importc: "filledEllipseColor", dynlib: gfxLibName.}
|
importc: "filledEllipseColor", dynlib: gfxLibName.}
|
||||||
proc filledEllipseRGBA*(dst: PSurface, x: int16, y: int16, rx: int16,
|
proc filledEllipseRGBA*(dst: PSurface, x: int16, y: int16, rx: int16,
|
||||||
ry: int16, r: byte, g: byte, b: byte, a: byte): cint{.
|
ry: int16, r: byte, g: byte, b: byte, a: byte): cint{.
|
||||||
cdecl, importc: "filledEllipseRGBA", dynlib: gfxLibName.}
|
cdecl, importc: "filledEllipseRGBA", dynlib: gfxLibName.}
|
||||||
# Pie
|
# Pie
|
||||||
proc pieColor*(dst: PSurface, x: int16, y: int16, rad: int16, start: int16,
|
proc pieColor*(dst: PSurface, x: int16, y: int16, rad: int16, start: int16,
|
||||||
finish: int16, color: Uint32): cint{.cdecl, importc: "pieColor",
|
finish: int16, color: uint32): cint{.cdecl, importc: "pieColor",
|
||||||
dynlib: gfxLibName.}
|
dynlib: gfxLibName.}
|
||||||
proc pieRGBA*(dst: PSurface, x: int16, y: int16, rad: int16, start: int16,
|
proc pieRGBA*(dst: PSurface, x: int16, y: int16, rad: int16, start: int16,
|
||||||
finish: int16, r: byte, g: byte, b: byte, a: byte): cint{.
|
finish: int16, r: byte, g: byte, b: byte, a: byte): cint{.
|
||||||
cdecl, importc: "pieRGBA", dynlib: gfxLibName.}
|
cdecl, importc: "pieRGBA", dynlib: gfxLibName.}
|
||||||
# Filled Pie
|
# Filled Pie
|
||||||
proc filledPieColor*(dst: PSurface, x: int16, y: int16, rad: int16,
|
proc filledPieColor*(dst: PSurface, x: int16, y: int16, rad: int16,
|
||||||
start: int16, finish: int16, color: Uint32): cint{.cdecl,
|
start: int16, finish: int16, color: uint32): cint{.cdecl,
|
||||||
importc: "filledPieColor", dynlib: gfxLibName.}
|
importc: "filledPieColor", dynlib: gfxLibName.}
|
||||||
proc filledPieRGBA*(dst: PSurface, x: int16, y: int16, rad: int16,
|
proc filledPieRGBA*(dst: PSurface, x: int16, y: int16, rad: int16,
|
||||||
start: int16, finish: int16, r: byte, g: byte, b: byte,
|
start: int16, finish: int16, r: byte, g: byte, b: byte,
|
||||||
|
|
@ -182,14 +182,14 @@ proc filledPieRGBA*(dst: PSurface, x: int16, y: int16, rad: int16,
|
||||||
dynlib: gfxLibName.}
|
dynlib: gfxLibName.}
|
||||||
# Trigon
|
# Trigon
|
||||||
proc trigonColor*(dst: PSurface, x1: int16, y1: int16, x2: int16, y2: int16,
|
proc trigonColor*(dst: PSurface, x1: int16, y1: int16, x2: int16, y2: int16,
|
||||||
x3: int16, y3: int16, color: Uint32): cint{.cdecl,
|
x3: int16, y3: int16, color: uint32): cint{.cdecl,
|
||||||
importc: "trigonColor", dynlib: gfxLibName.}
|
importc: "trigonColor", dynlib: gfxLibName.}
|
||||||
proc trigonRGBA*(dst: PSurface, x1: int16, y1: int16, x2: int16, y2: int16,
|
proc trigonRGBA*(dst: PSurface, x1: int16, y1: int16, x2: int16, y2: int16,
|
||||||
x3: int16, y3: int16, r: byte, g: byte, b: byte, a: byte): cint{.
|
x3: int16, y3: int16, r: byte, g: byte, b: byte, a: byte): cint{.
|
||||||
cdecl, importc: "trigonRGBA", dynlib: gfxLibName.}
|
cdecl, importc: "trigonRGBA", dynlib: gfxLibName.}
|
||||||
# AA-Trigon
|
# AA-Trigon
|
||||||
proc aatrigonColor*(dst: PSurface, x1: int16, y1: int16, x2: int16,
|
proc aatrigonColor*(dst: PSurface, x1: int16, y1: int16, x2: int16,
|
||||||
y2: int16, x3: int16, y3: int16, color: Uint32): cint{.
|
y2: int16, x3: int16, y3: int16, color: uint32): cint{.
|
||||||
cdecl, importc: "aatrigonColor", dynlib: gfxLibName.}
|
cdecl, importc: "aatrigonColor", dynlib: gfxLibName.}
|
||||||
proc aatrigonRGBA*(dst: PSurface, x1: int16, y1: int16, x2: int16,
|
proc aatrigonRGBA*(dst: PSurface, x1: int16, y1: int16, x2: int16,
|
||||||
y2: int16, x3: int16, y3: int16, r: byte, g: byte,
|
y2: int16, x3: int16, y3: int16, r: byte, g: byte,
|
||||||
|
|
@ -197,7 +197,7 @@ proc aatrigonRGBA*(dst: PSurface, x1: int16, y1: int16, x2: int16,
|
||||||
dynlib: gfxLibName.}
|
dynlib: gfxLibName.}
|
||||||
# Filled Trigon
|
# Filled Trigon
|
||||||
proc filledTrigonColor*(dst: PSurface, x1: int16, y1: int16, x2: int16,
|
proc filledTrigonColor*(dst: PSurface, x1: int16, y1: int16, x2: int16,
|
||||||
y2: int16, x3: int16, y3: int16, color: Uint32): cint{.
|
y2: int16, x3: int16, y3: int16, color: uint32): cint{.
|
||||||
cdecl, importc: "filledTrigonColor", dynlib: gfxLibName.}
|
cdecl, importc: "filledTrigonColor", dynlib: gfxLibName.}
|
||||||
proc filledTrigonRGBA*(dst: PSurface, x1: int16, y1: int16, x2: int16,
|
proc filledTrigonRGBA*(dst: PSurface, x1: int16, y1: int16, x2: int16,
|
||||||
y2: int16, x3: int16, y3: int16, r: byte, g: byte,
|
y2: int16, x3: int16, y3: int16, r: byte, g: byte,
|
||||||
|
|
@ -205,21 +205,21 @@ proc filledTrigonRGBA*(dst: PSurface, x1: int16, y1: int16, x2: int16,
|
||||||
importc: "filledTrigonRGBA", dynlib: gfxLibName.}
|
importc: "filledTrigonRGBA", dynlib: gfxLibName.}
|
||||||
# Polygon
|
# Polygon
|
||||||
proc polygonColor*(dst: PSurface, vx: ptr int16, vy: ptr int16, n: cint,
|
proc polygonColor*(dst: PSurface, vx: ptr int16, vy: ptr int16, n: cint,
|
||||||
color: Uint32): cint{.cdecl, importc: "polygonColor",
|
color: uint32): cint{.cdecl, importc: "polygonColor",
|
||||||
dynlib: gfxLibName.}
|
dynlib: gfxLibName.}
|
||||||
proc polygonRGBA*(dst: PSurface, vx: ptr int16, vy: ptr int16, n: cint, r: byte,
|
proc polygonRGBA*(dst: PSurface, vx: ptr int16, vy: ptr int16, n: cint, r: byte,
|
||||||
g: byte, b: byte, a: byte): cint{.cdecl,
|
g: byte, b: byte, a: byte): cint{.cdecl,
|
||||||
importc: "polygonRGBA", dynlib: gfxLibName.}
|
importc: "polygonRGBA", dynlib: gfxLibName.}
|
||||||
# AA-Polygon
|
# AA-Polygon
|
||||||
proc aapolygonColor*(dst: PSurface, vx: ptr int16, vy: ptr int16, n: cint,
|
proc aapolygonColor*(dst: PSurface, vx: ptr int16, vy: ptr int16, n: cint,
|
||||||
color: Uint32): cint{.cdecl, importc: "aapolygonColor",
|
color: uint32): cint{.cdecl, importc: "aapolygonColor",
|
||||||
dynlib: gfxLibName.}
|
dynlib: gfxLibName.}
|
||||||
proc aapolygonRGBA*(dst: PSurface, vx: ptr int16, vy: ptr int16, n: cint, r: byte,
|
proc aapolygonRGBA*(dst: PSurface, vx: ptr int16, vy: ptr int16, n: cint, r: byte,
|
||||||
g: byte, b: byte, a: byte): cint{.cdecl,
|
g: byte, b: byte, a: byte): cint{.cdecl,
|
||||||
importc: "aapolygonRGBA", dynlib: gfxLibName.}
|
importc: "aapolygonRGBA", dynlib: gfxLibName.}
|
||||||
# Filled Polygon
|
# Filled Polygon
|
||||||
proc filledPolygonColor*(dst: PSurface, vx: ptr int16, vy: ptr int16, n: cint,
|
proc filledPolygonColor*(dst: PSurface, vx: ptr int16, vy: ptr int16, n: cint,
|
||||||
color: Uint32): cint{.cdecl,
|
color: uint32): cint{.cdecl,
|
||||||
importc: "filledPolygonColor", dynlib: gfxLibName.}
|
importc: "filledPolygonColor", dynlib: gfxLibName.}
|
||||||
proc filledPolygonRGBA*(dst: PSurface, vx: ptr int16, vy: ptr int16, n: cint,
|
proc filledPolygonRGBA*(dst: PSurface, vx: ptr int16, vy: ptr int16, n: cint,
|
||||||
r: byte, g: byte, b: byte, a: byte): cint{.cdecl,
|
r: byte, g: byte, b: byte, a: byte): cint{.cdecl,
|
||||||
|
|
@ -227,23 +227,23 @@ proc filledPolygonRGBA*(dst: PSurface, vx: ptr int16, vy: ptr int16, n: cint,
|
||||||
# Bezier
|
# Bezier
|
||||||
# s = number of steps
|
# s = number of steps
|
||||||
proc bezierColor*(dst: PSurface, vx: ptr int16, vy: ptr int16, n: cint, s: cint,
|
proc bezierColor*(dst: PSurface, vx: ptr int16, vy: ptr int16, n: cint, s: cint,
|
||||||
color: Uint32): cint{.cdecl, importc: "bezierColor",
|
color: uint32): cint{.cdecl, importc: "bezierColor",
|
||||||
dynlib: gfxLibName.}
|
dynlib: gfxLibName.}
|
||||||
proc bezierRGBA*(dst: PSurface, vx: ptr int16, vy: ptr int16, n: cint, s: cint,
|
proc bezierRGBA*(dst: PSurface, vx: ptr int16, vy: ptr int16, n: cint, s: cint,
|
||||||
r: byte, g: byte, b: byte, a: byte): cint{.cdecl,
|
r: byte, g: byte, b: byte, a: byte): cint{.cdecl,
|
||||||
importc: "bezierRGBA", dynlib: gfxLibName.}
|
importc: "bezierRGBA", dynlib: gfxLibName.}
|
||||||
# Characters/Strings
|
# Characters/Strings
|
||||||
proc characterColor*(dst: PSurface, x: int16, y: int16, c: char, color: Uint32): cint{.
|
proc characterColor*(dst: PSurface, x: int16, y: int16, c: char, color: uint32): cint{.
|
||||||
cdecl, importc: "characterColor", dynlib: gfxLibName.}
|
cdecl, importc: "characterColor", dynlib: gfxLibName.}
|
||||||
proc characterRGBA*(dst: PSurface, x: int16, y: int16, c: char, r: byte,
|
proc characterRGBA*(dst: PSurface, x: int16, y: int16, c: char, r: byte,
|
||||||
g: byte, b: byte, a: byte): cint{.cdecl,
|
g: byte, b: byte, a: byte): cint{.cdecl,
|
||||||
importc: "characterRGBA", dynlib: gfxLibName.}
|
importc: "characterRGBA", dynlib: gfxLibName.}
|
||||||
proc stringColor*(dst: PSurface, x: int16, y: int16, c: cstring, color: Uint32): cint{.
|
proc stringColor*(dst: PSurface, x: int16, y: int16, c: cstring, color: uint32): cint{.
|
||||||
cdecl, importc: "stringColor", dynlib: gfxLibName.}
|
cdecl, importc: "stringColor", dynlib: gfxLibName.}
|
||||||
proc stringRGBA*(dst: PSurface, x: int16, y: int16, c: cstring, r: byte,
|
proc stringRGBA*(dst: PSurface, x: int16, y: int16, c: cstring, r: byte,
|
||||||
g: byte, b: byte, a: byte): cint{.cdecl,
|
g: byte, b: byte, a: byte): cint{.cdecl,
|
||||||
importc: "stringRGBA", dynlib: gfxLibName.}
|
importc: "stringRGBA", dynlib: gfxLibName.}
|
||||||
proc gfxPrimitivesSetFont*(fontdata: Pointer, cw: cint, ch: cint){.cdecl,
|
proc gfxPrimitivesSetFont*(fontdata: pointer, cw: cint, ch: cint){.cdecl,
|
||||||
importc: "gfxPrimitivesSetFont", dynlib: gfxLibName.}
|
importc: "gfxPrimitivesSetFont", dynlib: gfxLibName.}
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
|
@ -271,132 +271,132 @@ proc imageFilterMMXon*(){.cdecl, importc: "SDL_imageFilterMMXon",
|
||||||
# -1 Error (internal error, parameter error)
|
# -1 Error (internal error, parameter error)
|
||||||
#
|
#
|
||||||
# SDL_imageFilterAdd: D = saturation255(S1 + S2)
|
# SDL_imageFilterAdd: D = saturation255(S1 + S2)
|
||||||
proc imageFilterAdd*(Src1: cstring, Src2: cstring, Dest: cstring, len: cint): cint{.
|
proc imageFilterAdd*(src1: cstring, src2: cstring, dest: cstring, len: cint): cint{.
|
||||||
cdecl, importc: "SDL_imageFilterAdd", dynlib: gfxLibName.}
|
cdecl, importc: "SDL_imageFilterAdd", dynlib: gfxLibName.}
|
||||||
# SDL_imageFilterMean: D = S1/2 + S2/2
|
# SDL_imageFilterMean: D = S1/2 + S2/2
|
||||||
proc imageFilterMean*(Src1: cstring, Src2: cstring, Dest: cstring, len: cint): cint{.
|
proc imageFilterMean*(src1: cstring, src2: cstring, dest: cstring, len: cint): cint{.
|
||||||
cdecl, importc: "SDL_imageFilterMean", dynlib: gfxLibName.}
|
cdecl, importc: "SDL_imageFilterMean", dynlib: gfxLibName.}
|
||||||
# SDL_imageFilterSub: D = saturation0(S1 - S2)
|
# SDL_imageFilterSub: D = saturation0(S1 - S2)
|
||||||
proc imageFilterSub*(Src1: cstring, Src2: cstring, Dest: cstring, len: cint): cint{.
|
proc imageFilterSub*(src1: cstring, src2: cstring, dest: cstring, len: cint): cint{.
|
||||||
cdecl, importc: "SDL_imageFilterSub", dynlib: gfxLibName.}
|
cdecl, importc: "SDL_imageFilterSub", dynlib: gfxLibName.}
|
||||||
# SDL_imageFilterAbsDiff: D = | S1 - S2 |
|
# SDL_imageFilterAbsDiff: D = | S1 - S2 |
|
||||||
proc imageFilterAbsDiff*(Src1: cstring, Src2: cstring, Dest: cstring, len: cint): cint{.
|
proc imageFilterAbsDiff*(src1: cstring, src2: cstring, dest: cstring, len: cint): cint{.
|
||||||
cdecl, importc: "SDL_imageFilterAbsDiff", dynlib: gfxLibName.}
|
cdecl, importc: "SDL_imageFilterAbsDiff", dynlib: gfxLibName.}
|
||||||
# SDL_imageFilterMult: D = saturation(S1 * S2)
|
# SDL_imageFilterMult: D = saturation(S1 * S2)
|
||||||
proc imageFilterMult*(Src1: cstring, Src2: cstring, Dest: cstring, len: cint): cint{.
|
proc imageFilterMult*(src1: cstring, src2: cstring, dest: cstring, len: cint): cint{.
|
||||||
cdecl, importc: "SDL_imageFilterMult", dynlib: gfxLibName.}
|
cdecl, importc: "SDL_imageFilterMult", dynlib: gfxLibName.}
|
||||||
# SDL_imageFilterMultNor: D = S1 * S2 (non-MMX)
|
# SDL_imageFilterMultNor: D = S1 * S2 (non-MMX)
|
||||||
proc imageFilterMultNor*(Src1: cstring, Src2: cstring, Dest: cstring, len: cint): cint{.
|
proc imageFilterMultNor*(src1: cstring, src2: cstring, dest: cstring, len: cint): cint{.
|
||||||
cdecl, importc: "SDL_imageFilterMultNor", dynlib: gfxLibName.}
|
cdecl, importc: "SDL_imageFilterMultNor", dynlib: gfxLibName.}
|
||||||
# SDL_imageFilterMultDivby2: D = saturation255(S1/2 * S2)
|
# SDL_imageFilterMultDivby2: D = saturation255(S1/2 * S2)
|
||||||
proc imageFilterMultDivby2*(Src1: cstring, Src2: cstring, Dest: cstring,
|
proc imageFilterMultDivby2*(src1: cstring, src2: cstring, dest: cstring,
|
||||||
len: cint): cint{.cdecl,
|
len: cint): cint{.cdecl,
|
||||||
importc: "SDL_imageFilterMultDivby2", dynlib: gfxLibName.}
|
importc: "SDL_imageFilterMultDivby2", dynlib: gfxLibName.}
|
||||||
# SDL_imageFilterMultDivby4: D = saturation255(S1/2 * S2/2)
|
# SDL_imageFilterMultDivby4: D = saturation255(S1/2 * S2/2)
|
||||||
proc imageFilterMultDivby4*(Src1: cstring, Src2: cstring, Dest: cstring,
|
proc imageFilterMultDivby4*(src1: cstring, src2: cstring, dest: cstring,
|
||||||
len: cint): cint{.cdecl,
|
len: cint): cint{.cdecl,
|
||||||
importc: "SDL_imageFilterMultDivby4", dynlib: gfxLibName.}
|
importc: "SDL_imageFilterMultDivby4", dynlib: gfxLibName.}
|
||||||
# SDL_imageFilterBitAnd: D = S1 & S2
|
# SDL_imageFilterBitAnd: D = S1 & S2
|
||||||
proc imageFilterBitAnd*(Src1: cstring, Src2: cstring, Dest: cstring, len: cint): cint{.
|
proc imageFilterBitAnd*(src1: cstring, src2: cstring, dest: cstring, len: cint): cint{.
|
||||||
cdecl, importc: "SDL_imageFilterBitAnd", dynlib: gfxLibName.}
|
cdecl, importc: "SDL_imageFilterBitAnd", dynlib: gfxLibName.}
|
||||||
# SDL_imageFilterBitOr: D = S1 | S2
|
# SDL_imageFilterBitOr: D = S1 | S2
|
||||||
proc imageFilterBitOr*(Src1: cstring, Src2: cstring, Dest: cstring, len: cint): cint{.
|
proc imageFilterBitOr*(src1: cstring, src2: cstring, dest: cstring, len: cint): cint{.
|
||||||
cdecl, importc: "SDL_imageFilterBitOr", dynlib: gfxLibName.}
|
cdecl, importc: "SDL_imageFilterBitOr", dynlib: gfxLibName.}
|
||||||
# SDL_imageFilterDiv: D = S1 / S2 (non-MMX)
|
# SDL_imageFilterDiv: D = S1 / S2 (non-MMX)
|
||||||
proc imageFilterDiv*(Src1: cstring, Src2: cstring, Dest: cstring, len: cint): cint{.
|
proc imageFilterDiv*(src1: cstring, src2: cstring, dest: cstring, len: cint): cint{.
|
||||||
cdecl, importc: "SDL_imageFilterDiv", dynlib: gfxLibName.}
|
cdecl, importc: "SDL_imageFilterDiv", dynlib: gfxLibName.}
|
||||||
# SDL_imageFilterBitNegation: D = !S
|
# SDL_imageFilterBitNegation: D = !S
|
||||||
proc imageFilterBitNegation*(Src1: cstring, Dest: cstring, len: cint): cint{.
|
proc imageFilterBitNegation*(src1: cstring, dest: cstring, len: cint): cint{.
|
||||||
cdecl, importc: "SDL_imageFilterBitNegation", dynlib: gfxLibName.}
|
cdecl, importc: "SDL_imageFilterBitNegation", dynlib: gfxLibName.}
|
||||||
# SDL_imageFilterAddByte: D = saturation255(S + C)
|
# SDL_imageFilterAddByte: D = saturation255(S + C)
|
||||||
proc imageFilterAddByte*(Src1: cstring, Dest: cstring, len: cint, C: char): cint{.
|
proc imageFilterAddByte*(src1: cstring, dest: cstring, len: cint, c: char): cint{.
|
||||||
cdecl, importc: "SDL_imageFilterAddByte", dynlib: gfxLibName.}
|
cdecl, importc: "SDL_imageFilterAddByte", dynlib: gfxLibName.}
|
||||||
# SDL_imageFilterAddUint: D = saturation255(S + (uint)C)
|
# SDL_imageFilterAddUint: D = saturation255(S + (uint)C)
|
||||||
proc imageFilterAddUint*(Src1: cstring, Dest: cstring, len: cint, C: cint): cint{.
|
proc imageFilterAddUint*(src1: cstring, dest: cstring, len: cint, c: cint): cint{.
|
||||||
cdecl, importc: "SDL_imageFilterAddUint", dynlib: gfxLibName.}
|
cdecl, importc: "SDL_imageFilterAddUint", dynlib: gfxLibName.}
|
||||||
# SDL_imageFilterAddByteToHalf: D = saturation255(S/2 + C)
|
# SDL_imageFilterAddByteToHalf: D = saturation255(S/2 + C)
|
||||||
proc imageFilterAddByteToHalf*(Src1: cstring, Dest: cstring, len: cint, C: char): cint{.
|
proc imageFilterAddByteToHalf*(src1: cstring, dest: cstring, len: cint, c: char): cint{.
|
||||||
cdecl, importc: "SDL_imageFilterAddByteToHalf", dynlib: gfxLibName.}
|
cdecl, importc: "SDL_imageFilterAddByteToHalf", dynlib: gfxLibName.}
|
||||||
# SDL_imageFilterSubByte: D = saturation0(S - C)
|
# SDL_imageFilterSubByte: D = saturation0(S - C)
|
||||||
proc imageFilterSubByte*(Src1: cstring, Dest: cstring, len: cint, C: char): cint{.
|
proc imageFilterSubByte*(src1: cstring, dest: cstring, len: cint, c: char): cint{.
|
||||||
cdecl, importc: "SDL_imageFilterSubByte", dynlib: gfxLibName.}
|
cdecl, importc: "SDL_imageFilterSubByte", dynlib: gfxLibName.}
|
||||||
# SDL_imageFilterSubUint: D = saturation0(S - (uint)C)
|
# SDL_imageFilterSubUint: D = saturation0(S - (uint)C)
|
||||||
proc imageFilterSubUint*(Src1: cstring, Dest: cstring, len: cint, C: cint): cint{.
|
proc imageFilterSubUint*(src1: cstring, dest: cstring, len: cint, c: cint): cint{.
|
||||||
cdecl, importc: "SDL_imageFilterSubUint", dynlib: gfxLibName.}
|
cdecl, importc: "SDL_imageFilterSubUint", dynlib: gfxLibName.}
|
||||||
# SDL_imageFilterShiftRight: D = saturation0(S >> N)
|
# SDL_imageFilterShiftRight: D = saturation0(S >> N)
|
||||||
proc imageFilterShiftRight*(Src1: cstring, Dest: cstring, len: cint, N: char): cint{.
|
proc imageFilterShiftRight*(src1: cstring, dest: cstring, len: cint, n: char): cint{.
|
||||||
cdecl, importc: "SDL_imageFilterShiftRight", dynlib: gfxLibName.}
|
cdecl, importc: "SDL_imageFilterShiftRight", dynlib: gfxLibName.}
|
||||||
# SDL_imageFilterShiftRightUint: D = saturation0((uint)S >> N)
|
# SDL_imageFilterShiftRightUint: D = saturation0((uint)S >> N)
|
||||||
proc imageFilterShiftRightUint*(Src1: cstring, Dest: cstring, len: cint, N: char): cint{.
|
proc imageFilterShiftRightUint*(src1: cstring, dest: cstring, len: cint, n: char): cint{.
|
||||||
cdecl, importc: "SDL_imageFilterShiftRightUint", dynlib: gfxLibName.}
|
cdecl, importc: "SDL_imageFilterShiftRightUint", dynlib: gfxLibName.}
|
||||||
# SDL_imageFilterMultByByte: D = saturation255(S * C)
|
# SDL_imageFilterMultByByte: D = saturation255(S * C)
|
||||||
proc imageFilterMultByByte*(Src1: cstring, Dest: cstring, len: cint, C: char): cint{.
|
proc imageFilterMultByByte*(src1: cstring, dest: cstring, len: cint, c: char): cint{.
|
||||||
cdecl, importc: "SDL_imageFilterMultByByte", dynlib: gfxLibName.}
|
cdecl, importc: "SDL_imageFilterMultByByte", dynlib: gfxLibName.}
|
||||||
# SDL_imageFilterShiftRightAndMultByByte: D = saturation255((S >> N) * C)
|
# SDL_imageFilterShiftRightAndMultByByte: D = saturation255((S >> N) * C)
|
||||||
proc imageFilterShiftRightAndMultByByte*(Src1: cstring, Dest: cstring, len: cint,
|
proc imageFilterShiftRightAndMultByByte*(src1: cstring, dest: cstring, len: cint,
|
||||||
N: char, C: char): cint{.cdecl,
|
n: char, c: char): cint{.cdecl,
|
||||||
importc: "SDL_imageFilterShiftRightAndMultByByte",
|
importc: "SDL_imageFilterShiftRightAndMultByByte",
|
||||||
dynlib: gfxLibName.}
|
dynlib: gfxLibName.}
|
||||||
# SDL_imageFilterShiftLeftByte: D = (S << N)
|
# SDL_imageFilterShiftLeftByte: D = (S << N)
|
||||||
proc imageFilterShiftLeftByte*(Src1: cstring, Dest: cstring, len: cint, N: char): cint{.
|
proc imageFilterShiftLeftByte*(src1: cstring, dest: cstring, len: cint, n: char): cint{.
|
||||||
cdecl, importc: "SDL_imageFilterShiftLeftByte", dynlib: gfxLibName.}
|
cdecl, importc: "SDL_imageFilterShiftLeftByte", dynlib: gfxLibName.}
|
||||||
# SDL_imageFilterShiftLeftUint: D = ((uint)S << N)
|
# SDL_imageFilterShiftLeftUint: D = ((uint)S << N)
|
||||||
proc imageFilterShiftLeftUint*(Src1: cstring, Dest: cstring, len: cint, N: char): cint{.
|
proc imageFilterShiftLeftUint*(src1: cstring, dest: cstring, len: cint, n: char): cint{.
|
||||||
cdecl, importc: "SDL_imageFilterShiftLeftUint", dynlib: gfxLibName.}
|
cdecl, importc: "SDL_imageFilterShiftLeftUint", dynlib: gfxLibName.}
|
||||||
# SDL_imageFilterShiftLeft: D = saturation255(S << N)
|
# SDL_imageFilterShiftLeft: D = saturation255(S << N)
|
||||||
proc imageFilterShiftLeft*(Src1: cstring, Dest: cstring, len: cint, N: char): cint{.
|
proc imageFilterShiftLeft*(src1: cstring, dest: cstring, len: cint, n: char): cint{.
|
||||||
cdecl, importc: "SDL_imageFilterShiftLeft", dynlib: gfxLibName.}
|
cdecl, importc: "SDL_imageFilterShiftLeft", dynlib: gfxLibName.}
|
||||||
# SDL_imageFilterBinarizeUsingThreshold: D = S >= T ? 255:0
|
# SDL_imageFilterBinarizeUsingThreshold: D = S >= T ? 255:0
|
||||||
proc imageFilterBinarizeUsingThreshold*(Src1: cstring, Dest: cstring, len: cint,
|
proc imageFilterBinarizeUsingThreshold*(src1: cstring, dest: cstring, len: cint,
|
||||||
T: char): cint{.cdecl,
|
t: char): cint{.cdecl,
|
||||||
importc: "SDL_imageFilterBinarizeUsingThreshold", dynlib: gfxLibName.}
|
importc: "SDL_imageFilterBinarizeUsingThreshold", dynlib: gfxLibName.}
|
||||||
# SDL_imageFilterClipToRange: D = (S >= Tmin) & (S <= Tmax) 255:0
|
# SDL_imageFilterClipToRange: D = (S >= Tmin) & (S <= Tmax) 255:0
|
||||||
proc imageFilterClipToRange*(Src1: cstring, Dest: cstring, len: cint, Tmin: int8,
|
proc imageFilterClipToRange*(src1: cstring, dest: cstring, len: cint, tmin: int8,
|
||||||
Tmax: int8): cint{.cdecl,
|
tmax: int8): cint{.cdecl,
|
||||||
importc: "SDL_imageFilterClipToRange", dynlib: gfxLibName.}
|
importc: "SDL_imageFilterClipToRange", dynlib: gfxLibName.}
|
||||||
# SDL_imageFilterNormalizeLinear: D = saturation255((Nmax - Nmin)/(Cmax - Cmin)*(S - Cmin) + Nmin)
|
# SDL_imageFilterNormalizeLinear: D = saturation255((Nmax - Nmin)/(Cmax - Cmin)*(S - Cmin) + Nmin)
|
||||||
proc imageFilterNormalizeLinear*(Src1: cstring, Dest: cstring, len: cint,
|
proc imageFilterNormalizeLinear*(src1: cstring, dest: cstring, len: cint,
|
||||||
Cmin: cint, Cmax: cint, Nmin: cint, Nmax: cint): cint{.
|
cmin: cint, cmax: cint, nmin: cint, nmax: cint): cint{.
|
||||||
cdecl, importc: "SDL_imageFilterNormalizeLinear", dynlib: gfxLibName.}
|
cdecl, importc: "SDL_imageFilterNormalizeLinear", dynlib: gfxLibName.}
|
||||||
# !!! NO C-ROUTINE FOR THESE FUNCTIONS YET !!!
|
# !!! NO C-ROUTINE FOR THESE FUNCTIONS YET !!!
|
||||||
# SDL_imageFilterConvolveKernel3x3Divide: Dij = saturation0and255( ... )
|
# SDL_imageFilterConvolveKernel3x3Divide: Dij = saturation0and255( ... )
|
||||||
proc imageFilterConvolveKernel3x3Divide*(Src: cstring, Dest: cstring, rows: cint,
|
proc imageFilterConvolveKernel3x3Divide*(src: cstring, dest: cstring, rows: cint,
|
||||||
columns: cint, Kernel: pointer, Divisor: int8): cint{.cdecl,
|
columns: cint, kernel: pointer, divisor: int8): cint{.cdecl,
|
||||||
importc: "SDL_imageFilterConvolveKernel3x3Divide", dynlib: gfxLibName.}
|
importc: "SDL_imageFilterConvolveKernel3x3Divide", dynlib: gfxLibName.}
|
||||||
# SDL_imageFilterConvolveKernel5x5Divide: Dij = saturation0and255( ... )
|
# SDL_imageFilterConvolveKernel5x5Divide: Dij = saturation0and255( ... )
|
||||||
proc imageFilterConvolveKernel5x5Divide*(Src: cstring, Dest: cstring, rows: cint,
|
proc imageFilterConvolveKernel5x5Divide*(src: cstring, dest: cstring, rows: cint,
|
||||||
columns: cint, Kernel: pointer, Divisor: int8): cint{.cdecl,
|
columns: cint, kernel: pointer, divisor: int8): cint{.cdecl,
|
||||||
importc: "SDL_imageFilterConvolveKernel5x5Divide", dynlib: gfxLibName.}
|
importc: "SDL_imageFilterConvolveKernel5x5Divide", dynlib: gfxLibName.}
|
||||||
# SDL_imageFilterConvolveKernel7x7Divide: Dij = saturation0and255( ... )
|
# SDL_imageFilterConvolveKernel7x7Divide: Dij = saturation0and255( ... )
|
||||||
proc imageFilterConvolveKernel7x7Divide*(Src: cstring, Dest: cstring, rows: cint,
|
proc imageFilterConvolveKernel7x7Divide*(src: cstring, dest: cstring, rows: cint,
|
||||||
columns: cint, Kernel: pointer, Divisor: int8): cint{.cdecl,
|
columns: cint, kernel: pointer, divisor: int8): cint{.cdecl,
|
||||||
importc: "SDL_imageFilterConvolveKernel7x7Divide", dynlib: gfxLibName.}
|
importc: "SDL_imageFilterConvolveKernel7x7Divide", dynlib: gfxLibName.}
|
||||||
# SDL_imageFilterConvolveKernel9x9Divide: Dij = saturation0and255( ... )
|
# SDL_imageFilterConvolveKernel9x9Divide: Dij = saturation0and255( ... )
|
||||||
proc imageFilterConvolveKernel9x9Divide*(Src: cstring, Dest: cstring, rows: cint,
|
proc imageFilterConvolveKernel9x9Divide*(src: cstring, dest: cstring, rows: cint,
|
||||||
columns: cint, Kernel: pointer, Divisor: int8): cint{.cdecl,
|
columns: cint, kernel: pointer, divisor: int8): cint{.cdecl,
|
||||||
importc: "SDL_imageFilterConvolveKernel9x9Divide", dynlib: gfxLibName.}
|
importc: "SDL_imageFilterConvolveKernel9x9Divide", dynlib: gfxLibName.}
|
||||||
# SDL_imageFilterConvolveKernel3x3ShiftRight: Dij = saturation0and255( ... )
|
# SDL_imageFilterConvolveKernel3x3ShiftRight: Dij = saturation0and255( ... )
|
||||||
proc imageFilterConvolveKernel3x3ShiftRight*(Src: cstring, Dest: cstring,
|
proc imageFilterConvolveKernel3x3ShiftRight*(src: cstring, dest: cstring,
|
||||||
rows: cint, columns: cint, Kernel: pointer, NRightShift: char): cint{.cdecl,
|
rows: cint, columns: cint, kernel: pointer, nRightShift: char): cint{.cdecl,
|
||||||
importc: "SDL_imageFilterConvolveKernel3x3ShiftRight", dynlib: gfxLibName.}
|
importc: "SDL_imageFilterConvolveKernel3x3ShiftRight", dynlib: gfxLibName.}
|
||||||
# SDL_imageFilterConvolveKernel5x5ShiftRight: Dij = saturation0and255( ... )
|
# SDL_imageFilterConvolveKernel5x5ShiftRight: Dij = saturation0and255( ... )
|
||||||
proc imageFilterConvolveKernel5x5ShiftRight*(Src: cstring, Dest: cstring,
|
proc imageFilterConvolveKernel5x5ShiftRight*(src: cstring, dest: cstring,
|
||||||
rows: cint, columns: cint, Kernel: pointer, NRightShift: char): cint{.cdecl,
|
rows: cint, columns: cint, kernel: pointer, nRightShift: char): cint{.cdecl,
|
||||||
importc: "SDL_imageFilterConvolveKernel5x5ShiftRight", dynlib: gfxLibName.}
|
importc: "SDL_imageFilterConvolveKernel5x5ShiftRight", dynlib: gfxLibName.}
|
||||||
# SDL_imageFilterConvolveKernel7x7ShiftRight: Dij = saturation0and255( ... )
|
# SDL_imageFilterConvolveKernel7x7ShiftRight: Dij = saturation0and255( ... )
|
||||||
proc imageFilterConvolveKernel7x7ShiftRight*(Src: cstring, Dest: cstring,
|
proc imageFilterConvolveKernel7x7ShiftRight*(src: cstring, dest: cstring,
|
||||||
rows: cint, columns: cint, Kernel: pointer, NRightShift: char): cint{.cdecl,
|
rows: cint, columns: cint, kernel: pointer, nRightShift: char): cint{.cdecl,
|
||||||
importc: "SDL_imageFilterConvolveKernel7x7ShiftRight", dynlib: gfxLibName.}
|
importc: "SDL_imageFilterConvolveKernel7x7ShiftRight", dynlib: gfxLibName.}
|
||||||
# SDL_imageFilterConvolveKernel9x9ShiftRight: Dij = saturation0and255( ... )
|
# SDL_imageFilterConvolveKernel9x9ShiftRight: Dij = saturation0and255( ... )
|
||||||
proc imageFilterConvolveKernel9x9ShiftRight*(Src: cstring, Dest: cstring,
|
proc imageFilterConvolveKernel9x9ShiftRight*(src: cstring, dest: cstring,
|
||||||
rows: cint, columns: cint, Kernel: pointer, NRightShift: char): cint{.cdecl,
|
rows: cint, columns: cint, kernel: pointer, nRightShift: char): cint{.cdecl,
|
||||||
importc: "SDL_imageFilterConvolveKernel9x9ShiftRight", dynlib: gfxLibName.}
|
importc: "SDL_imageFilterConvolveKernel9x9ShiftRight", dynlib: gfxLibName.}
|
||||||
# SDL_imageFilterSobelX: Dij = saturation255( ... )
|
# SDL_imageFilterSobelX: Dij = saturation255( ... )
|
||||||
proc imageFilterSobelX*(Src: cstring, Dest: cstring, rows: cint, columns: cint): cint{.
|
proc imageFilterSobelX*(src: cstring, dest: cstring, rows: cint, columns: cint): cint{.
|
||||||
cdecl, importc: "SDL_imageFilterSobelX", dynlib: gfxLibName.}
|
cdecl, importc: "SDL_imageFilterSobelX", dynlib: gfxLibName.}
|
||||||
# SDL_imageFilterSobelXShiftRight: Dij = saturation255( ... )
|
# SDL_imageFilterSobelXShiftRight: Dij = saturation255( ... )
|
||||||
proc imageFilterSobelXShiftRight*(Src: cstring, Dest: cstring, rows: cint,
|
proc imageFilterSobelXShiftRight*(src: cstring, dest: cstring, rows: cint,
|
||||||
columns: cint, NRightShift: char): cint{.cdecl,
|
columns: cint, nRightShift: char): cint{.cdecl,
|
||||||
importc: "SDL_imageFilterSobelXShiftRight", dynlib: gfxLibName.}
|
importc: "SDL_imageFilterSobelXShiftRight", dynlib: gfxLibName.}
|
||||||
# Align/restore stack to 32 byte boundary -- Functionality untested! --
|
# Align/restore stack to 32 byte boundary -- Functionality untested! --
|
||||||
proc imageFilterAlignStack*(){.cdecl, importc: "SDL_imageFilterAlignStack",
|
proc imageFilterAlignStack*(){.cdecl, importc: "SDL_imageFilterAlignStack",
|
||||||
|
|
|
||||||
|
|
@ -148,12 +148,12 @@ const
|
||||||
# This macro can be used to fill a version structure with the compile-time
|
# This macro can be used to fill a version structure with the compile-time
|
||||||
# version of the SDL_image library.
|
# version of the SDL_image library.
|
||||||
|
|
||||||
proc IMAGE_VERSION*(X: var TVersion)
|
proc imageVersion*(x: var Tversion)
|
||||||
# This function gets the version of the dynamically linked SDL_image library.
|
# This function gets the version of the dynamically linked SDL_image library.
|
||||||
# it should NOT be used to fill a version structure, instead you should
|
# it should NOT be used to fill a version structure, instead you should
|
||||||
# use the SDL_IMAGE_VERSION() macro.
|
# use the SDL_IMAGE_VERSION() macro.
|
||||||
#
|
#
|
||||||
proc IMG_Linked_Version*(): Pversion{.importc: "IMG_Linked_Version",
|
proc imgLinkedVersion*(): Pversion{.importc: "IMG_Linked_Version",
|
||||||
dynlib: ImageLibName.}
|
dynlib: ImageLibName.}
|
||||||
# Load an image from an SDL data source.
|
# Load an image from an SDL data source.
|
||||||
# The 'type' may be one of: "BMP", "GIF", "PNG", etc.
|
# The 'type' may be one of: "BMP", "GIF", "PNG", etc.
|
||||||
|
|
@ -170,74 +170,74 @@ const
|
||||||
IMG_INIT_TIF* = 0x00000004
|
IMG_INIT_TIF* = 0x00000004
|
||||||
IMG_INIT_WEBP* = 0x00000008
|
IMG_INIT_WEBP* = 0x00000008
|
||||||
|
|
||||||
proc IMG_Init*(flags: cint): int {.cdecl, importc: "IMG_Init",
|
proc imgInit*(flags: cint): int {.cdecl, importc: "IMG_Init",
|
||||||
dynlib: ImageLibName.}
|
dynlib: ImageLibName.}
|
||||||
proc IMG_Quit*() {.cdecl, importc: "IMG_Quit",
|
proc imgQuit*() {.cdecl, importc: "IMG_Quit",
|
||||||
dynlib: ImageLibName.}
|
dynlib: ImageLibName.}
|
||||||
proc IMG_LoadTyped_RW*(src: PRWops, freesrc: cint, theType: cstring): PSurface{.
|
proc imgLoadTypedRW*(src: PRWops, freesrc: cint, theType: cstring): PSurface{.
|
||||||
cdecl, importc: "IMG_LoadTyped_RW", dynlib: ImageLibName.}
|
cdecl, importc: "IMG_LoadTyped_RW", dynlib: ImageLibName.}
|
||||||
# Convenience functions
|
# Convenience functions
|
||||||
proc IMG_Load*(theFile: cstring): PSurface{.cdecl, importc: "IMG_Load",
|
proc imgLoad*(theFile: cstring): PSurface{.cdecl, importc: "IMG_Load",
|
||||||
dynlib: ImageLibName.}
|
dynlib: ImageLibName.}
|
||||||
proc IMG_Load_RW*(src: PRWops, freesrc: cint): PSurface{.cdecl,
|
proc imgLoadRW*(src: PRWops, freesrc: cint): PSurface{.cdecl,
|
||||||
importc: "IMG_Load_RW", dynlib: ImageLibName.}
|
importc: "IMG_Load_RW", dynlib: ImageLibName.}
|
||||||
# Invert the alpha of a surface for use with OpenGL
|
# Invert the alpha of a surface for use with OpenGL
|
||||||
# This function is now a no-op, and only provided for backwards compatibility.
|
# This function is now a no-op, and only provided for backwards compatibility.
|
||||||
proc IMG_InvertAlpha*(theOn: cint): cint{.cdecl, importc: "IMG_InvertAlpha",
|
proc imgInvertAlpha*(theOn: cint): cint{.cdecl, importc: "IMG_InvertAlpha",
|
||||||
dynlib: ImageLibName.}
|
dynlib: ImageLibName.}
|
||||||
# Functions to detect a file type, given a seekable source
|
# Functions to detect a file type, given a seekable source
|
||||||
proc IMG_isBMP*(src: PRWops): cint{.cdecl, importc: "IMG_isBMP",
|
proc imgIsBMP*(src: PRWops): cint{.cdecl, importc: "IMG_isBMP",
|
||||||
dynlib: ImageLibName.}
|
dynlib: ImageLibName.}
|
||||||
proc IMG_isGIF*(src: PRWops): cint{.cdecl, importc: "IMG_isGIF",
|
proc imgIsGIF*(src: PRWops): cint{.cdecl, importc: "IMG_isGIF",
|
||||||
dynlib: ImageLibName.}
|
dynlib: ImageLibName.}
|
||||||
proc IMG_isJPG*(src: PRWops): cint{.cdecl, importc: "IMG_isJPG",
|
proc imgIsJPG*(src: PRWops): cint{.cdecl, importc: "IMG_isJPG",
|
||||||
dynlib: ImageLibName.}
|
dynlib: ImageLibName.}
|
||||||
proc IMG_isLBM*(src: PRWops): cint{.cdecl, importc: "IMG_isLBM",
|
proc imgIsLBM*(src: PRWops): cint{.cdecl, importc: "IMG_isLBM",
|
||||||
dynlib: ImageLibName.}
|
dynlib: ImageLibName.}
|
||||||
proc IMG_isPCX*(src: PRWops): cint{.cdecl, importc: "IMG_isPCX",
|
proc imgIsPCX*(src: PRWops): cint{.cdecl, importc: "IMG_isPCX",
|
||||||
dynlib: ImageLibName.}
|
dynlib: ImageLibName.}
|
||||||
proc IMG_isPNG*(src: PRWops): cint{.cdecl, importc: "IMG_isPNG",
|
proc imgIsPNG*(src: PRWops): cint{.cdecl, importc: "IMG_isPNG",
|
||||||
dynlib: ImageLibName.}
|
dynlib: ImageLibName.}
|
||||||
proc IMG_isPNM*(src: PRWops): cint{.cdecl, importc: "IMG_isPNM",
|
proc imgIsPNM*(src: PRWops): cint{.cdecl, importc: "IMG_isPNM",
|
||||||
dynlib: ImageLibName.}
|
dynlib: ImageLibName.}
|
||||||
proc IMG_isTIF*(src: PRWops): cint{.cdecl, importc: "IMG_isTIF",
|
proc imgIsTIF*(src: PRWops): cint{.cdecl, importc: "IMG_isTIF",
|
||||||
dynlib: ImageLibName.}
|
dynlib: ImageLibName.}
|
||||||
proc IMG_isXCF*(src: PRWops): cint{.cdecl, importc: "IMG_isXCF",
|
proc imgIsXCF*(src: PRWops): cint{.cdecl, importc: "IMG_isXCF",
|
||||||
dynlib: ImageLibName.}
|
dynlib: ImageLibName.}
|
||||||
proc IMG_isXPM*(src: PRWops): cint{.cdecl, importc: "IMG_isXPM",
|
proc imgIsXPM*(src: PRWops): cint{.cdecl, importc: "IMG_isXPM",
|
||||||
dynlib: ImageLibName.}
|
dynlib: ImageLibName.}
|
||||||
proc IMG_isXV*(src: PRWops): cint{.cdecl, importc: "IMG_isXV",
|
proc imgIsXV*(src: PRWops): cint{.cdecl, importc: "IMG_isXV",
|
||||||
dynlib: ImageLibName.}
|
dynlib: ImageLibName.}
|
||||||
# Individual loading functions
|
# Individual loading functions
|
||||||
proc IMG_LoadBMP_RW*(src: PRWops): PSurface{.cdecl, importc: "IMG_LoadBMP_RW",
|
proc imgLoadBMP_RW*(src: PRWops): PSurface{.cdecl, importc: "IMG_LoadBMP_RW",
|
||||||
dynlib: ImageLibName.}
|
dynlib: ImageLibName.}
|
||||||
proc IMG_LoadGIF_RW*(src: PRWops): PSurface{.cdecl, importc: "IMG_LoadGIF_RW",
|
proc imgLoadGIF_RW*(src: PRWops): PSurface{.cdecl, importc: "IMG_LoadGIF_RW",
|
||||||
dynlib: ImageLibName.}
|
dynlib: ImageLibName.}
|
||||||
proc IMG_LoadJPG_RW*(src: PRWops): PSurface{.cdecl, importc: "IMG_LoadJPG_RW",
|
proc imgLoadJPG_RW*(src: PRWops): PSurface{.cdecl, importc: "IMG_LoadJPG_RW",
|
||||||
dynlib: ImageLibName.}
|
dynlib: ImageLibName.}
|
||||||
proc IMG_LoadLBM_RW*(src: PRWops): PSurface{.cdecl, importc: "IMG_LoadLBM_RW",
|
proc imgLoadLBM_RW*(src: PRWops): PSurface{.cdecl, importc: "IMG_LoadLBM_RW",
|
||||||
dynlib: ImageLibName.}
|
dynlib: ImageLibName.}
|
||||||
proc IMG_LoadPCX_RW*(src: PRWops): PSurface{.cdecl, importc: "IMG_LoadPCX_RW",
|
proc imgLoadPCX_RW*(src: PRWops): PSurface{.cdecl, importc: "IMG_LoadPCX_RW",
|
||||||
dynlib: ImageLibName.}
|
dynlib: ImageLibName.}
|
||||||
proc IMG_LoadPNM_RW*(src: PRWops): PSurface{.cdecl, importc: "IMG_LoadPNM_RW",
|
proc imgLoadPNM_RW*(src: PRWops): PSurface{.cdecl, importc: "IMG_LoadPNM_RW",
|
||||||
dynlib: ImageLibName.}
|
dynlib: ImageLibName.}
|
||||||
proc IMG_LoadPNG_RW*(src: PRWops): PSurface{.cdecl, importc: "IMG_LoadPNG_RW",
|
proc imgLoadPNG_RW*(src: PRWops): PSurface{.cdecl, importc: "IMG_LoadPNG_RW",
|
||||||
dynlib: ImageLibName.}
|
dynlib: ImageLibName.}
|
||||||
proc IMG_LoadTGA_RW*(src: PRWops): PSurface{.cdecl, importc: "IMG_LoadTGA_RW",
|
proc imgLoadTGA_RW*(src: PRWops): PSurface{.cdecl, importc: "IMG_LoadTGA_RW",
|
||||||
dynlib: ImageLibName.}
|
dynlib: ImageLibName.}
|
||||||
proc IMG_LoadTIF_RW*(src: PRWops): PSurface{.cdecl, importc: "IMG_LoadTIF_RW",
|
proc imgLoadTIF_RW*(src: PRWops): PSurface{.cdecl, importc: "IMG_LoadTIF_RW",
|
||||||
dynlib: ImageLibName.}
|
dynlib: ImageLibName.}
|
||||||
proc IMG_LoadXCF_RW*(src: PRWops): PSurface{.cdecl, importc: "IMG_LoadXCF_RW",
|
proc imgLoadXCF_RW*(src: PRWops): PSurface{.cdecl, importc: "IMG_LoadXCF_RW",
|
||||||
dynlib: ImageLibName.}
|
dynlib: ImageLibName.}
|
||||||
proc IMG_LoadXPM_RW*(src: PRWops): PSurface{.cdecl, importc: "IMG_LoadXPM_RW",
|
proc imgLoadXPM_RW*(src: PRWops): PSurface{.cdecl, importc: "IMG_LoadXPM_RW",
|
||||||
dynlib: ImageLibName.}
|
dynlib: ImageLibName.}
|
||||||
proc IMG_LoadXV_RW*(src: PRWops): PSurface{.cdecl, importc: "IMG_LoadXV_RW",
|
proc imgLoadXV_RW*(src: PRWops): PSurface{.cdecl, importc: "IMG_LoadXV_RW",
|
||||||
dynlib: ImageLibName.}
|
dynlib: ImageLibName.}
|
||||||
proc IMG_ReadXPMFromArray*(xpm: cstringArray): PSurface{.cdecl,
|
proc imgReadXPMFromArray*(xpm: cstringArray): PSurface{.cdecl,
|
||||||
importc: "IMG_ReadXPMFromArray", dynlib: ImageLibName.}
|
importc: "IMG_ReadXPMFromArray", dynlib: ImageLibName.}
|
||||||
|
|
||||||
proc IMAGE_VERSION(X: var TVersion) =
|
proc imageVersion(x: var Tversion) =
|
||||||
X.major = IMAGE_MAJOR_VERSION
|
x.major = IMAGE_MAJOR_VERSION
|
||||||
X.minor = IMAGE_MINOR_VERSION
|
x.minor = IMAGE_MINOR_VERSION
|
||||||
X.patch = IMAGE_PATCHLEVEL
|
x.patch = IMAGE_PATCHLEVEL
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -196,7 +196,7 @@ type #music_cmd.h types
|
||||||
|
|
||||||
PWAVStream* = ptr TWAVStream
|
PWAVStream* = ptr TWAVStream
|
||||||
TWAVStream*{.final.} = object #playmidi.h types
|
TWAVStream*{.final.} = object #playmidi.h types
|
||||||
wavefp*: Pointer
|
wavefp*: pointer
|
||||||
start*: int32
|
start*: int32
|
||||||
stop*: int32
|
stop*: int32
|
||||||
cvt*: TAudioCVT
|
cvt*: TAudioCVT
|
||||||
|
|
@ -223,8 +223,8 @@ type #music_cmd.h types
|
||||||
volume*: int32 #vf: OggVorbis_File;
|
volume*: int32 #vf: OggVorbis_File;
|
||||||
section*: int32
|
section*: int32
|
||||||
cvt*: TAudioCVT
|
cvt*: TAudioCVT
|
||||||
len_available*: int32
|
lenAvailable*: int32
|
||||||
snd_available*: pointer
|
sndAvailable*: pointer
|
||||||
|
|
||||||
TErrorEnum* = enum
|
TErrorEnum* = enum
|
||||||
MMERR_OPENING_FILE, MMERR_OUT_OF_MEMORY, MMERR_DYNAMIC_LINKING,
|
MMERR_OPENING_FILE, MMERR_OUT_OF_MEMORY, MMERR_DYNAMIC_LINKING,
|
||||||
|
|
@ -255,7 +255,7 @@ type #music_cmd.h types
|
||||||
TChunk*{.final.} = object
|
TChunk*{.final.} = object
|
||||||
allocated*: cint
|
allocated*: cint
|
||||||
abuf*: pointer
|
abuf*: pointer
|
||||||
alen*: Uint32
|
alen*: uint32
|
||||||
volume*: byte # Per-sample volume, 0-128
|
volume*: byte # Per-sample volume, 0-128
|
||||||
|
|
||||||
TFading* = enum
|
TFading* = enum
|
||||||
|
|
@ -272,18 +272,18 @@ type #music_cmd.h types
|
||||||
# fade_steps : integer;
|
# fade_steps : integer;
|
||||||
# error : integer;
|
# error : integer;
|
||||||
|
|
||||||
TMixFunction* = proc (udata, stream: pointer, length: cint): Pointer{.
|
TMixFunction* = proc (udata, stream: pointer, length: cint): pointer{.
|
||||||
cdecl.} # This macro can be used to fill a version structure with the compile-time
|
cdecl.} # This macro can be used to fill a version structure with the compile-time
|
||||||
# version of the SDL_mixer library.
|
# version of the SDL_mixer library.
|
||||||
|
|
||||||
proc VERSION*(X: var sdl.TVersion)
|
proc version*(x: var sdl.Tversion)
|
||||||
# This function gets the version of the dynamically linked SDL_mixer library.
|
# This function gets the version of the dynamically linked SDL_mixer library.
|
||||||
# It should NOT be used to fill a version structure, instead you should use the
|
# It should NOT be used to fill a version structure, instead you should use the
|
||||||
# SDL_MIXER_VERSION() macro.
|
# SDL_MIXER_VERSION() macro.
|
||||||
proc Linked_Version*(): sdl.Pversion{.cdecl, importc: "Mix_Linked_Version",
|
proc linkedVersion*(): sdl.Pversion{.cdecl, importc: "Mix_Linked_Version",
|
||||||
dynlib: MixerLibName.}
|
dynlib: MixerLibName.}
|
||||||
# Open the mixer with a certain audio format
|
# Open the mixer with a certain audio format
|
||||||
proc OpenAudio*(frequency: cint, format: Uint16, channels: cint,
|
proc openAudio*(frequency: cint, format: uint16, channels: cint,
|
||||||
chunksize: cint): cint{.cdecl, importc: "Mix_OpenAudio",
|
chunksize: cint): cint{.cdecl, importc: "Mix_OpenAudio",
|
||||||
dynlib: MixerLibName.}
|
dynlib: MixerLibName.}
|
||||||
# Dynamically change the number of channels managed by the mixer.
|
# Dynamically change the number of channels managed by the mixer.
|
||||||
|
|
@ -291,194 +291,194 @@ proc OpenAudio*(frequency: cint, format: Uint16, channels: cint,
|
||||||
# stopped.
|
# stopped.
|
||||||
# This function returns the new number of allocated channels.
|
# This function returns the new number of allocated channels.
|
||||||
#
|
#
|
||||||
proc AllocateChannels*(numchannels: cint): cint{.cdecl,
|
proc allocateChannels*(numchannels: cint): cint{.cdecl,
|
||||||
importc: "Mix_AllocateChannels", dynlib: MixerLibName.}
|
importc: "Mix_AllocateChannels", dynlib: MixerLibName.}
|
||||||
# Find out what the actual audio device parameters are.
|
# Find out what the actual audio device parameters are.
|
||||||
# This function returns 1 if the audio has been opened, 0 otherwise.
|
# This function returns 1 if the audio has been opened, 0 otherwise.
|
||||||
#
|
#
|
||||||
proc QuerySpec*(frequency: var cint, format: var Uint16, channels: var cint): cint{.
|
proc querySpec*(frequency: var cint, format: var uint16, channels: var cint): cint{.
|
||||||
cdecl, importc: "Mix_QuerySpec", dynlib: MixerLibName.}
|
cdecl, importc: "Mix_QuerySpec", dynlib: MixerLibName.}
|
||||||
# Load a wave file or a music (.mod .s3m .it .xm) file
|
# Load a wave file or a music (.mod .s3m .it .xm) file
|
||||||
proc LoadWAV_RW*(src: PRWops, freesrc: cint): PChunk{.cdecl,
|
proc loadWAV_RW*(src: PRWops, freesrc: cint): PChunk{.cdecl,
|
||||||
importc: "Mix_LoadWAV_RW", dynlib: MixerLibName.}
|
importc: "Mix_LoadWAV_RW", dynlib: MixerLibName.}
|
||||||
proc LoadWAV*(filename: cstring): PChunk
|
proc loadWAV*(filename: cstring): PChunk
|
||||||
proc LoadMUS*(filename: cstring): PMusic{.cdecl, importc: "Mix_LoadMUS",
|
proc loadMUS*(filename: cstring): PMusic{.cdecl, importc: "Mix_LoadMUS",
|
||||||
dynlib: MixerLibName.}
|
dynlib: MixerLibName.}
|
||||||
# Load a wave file of the mixer format from a memory buffer
|
# Load a wave file of the mixer format from a memory buffer
|
||||||
proc QuickLoad_WAV*(mem: pointer): PChunk{.cdecl,
|
proc quickLoadWAV*(mem: pointer): PChunk{.cdecl,
|
||||||
importc: "Mix_QuickLoad_WAV", dynlib: MixerLibName.}
|
importc: "Mix_QuickLoad_WAV", dynlib: MixerLibName.}
|
||||||
# Free an audio chunk previously loaded
|
# Free an audio chunk previously loaded
|
||||||
proc FreeChunk*(chunk: PChunk){.cdecl, importc: "Mix_FreeChunk",
|
proc freeChunk*(chunk: PChunk){.cdecl, importc: "Mix_FreeChunk",
|
||||||
dynlib: MixerLibName.}
|
dynlib: MixerLibName.}
|
||||||
proc FreeMusic*(music: PMusic){.cdecl, importc: "Mix_FreeMusic",
|
proc freeMusic*(music: PMusic){.cdecl, importc: "Mix_FreeMusic",
|
||||||
dynlib: MixerLibName.}
|
dynlib: MixerLibName.}
|
||||||
# Find out the music format of a mixer music, or the currently playing
|
# Find out the music format of a mixer music, or the currently playing
|
||||||
# music, if 'music' is NULL.
|
# music, if 'music' is NULL.
|
||||||
proc GetMusicType*(music: PMusic): TMusicType{.cdecl,
|
proc getMusicType*(music: PMusic): TMusicType{.cdecl,
|
||||||
importc: "Mix_GetMusicType", dynlib: MixerLibName.}
|
importc: "Mix_GetMusicType", dynlib: MixerLibName.}
|
||||||
# Set a function that is called after all mixing is performed.
|
# Set a function that is called after all mixing is performed.
|
||||||
# This can be used to provide real-time visual display of the audio stream
|
# This can be used to provide real-time visual display of the audio stream
|
||||||
# or add a custom mixer filter for the stream data.
|
# or add a custom mixer filter for the stream data.
|
||||||
#
|
#
|
||||||
proc SetPostMix*(mix_func: TMixFunction, arg: Pointer){.cdecl,
|
proc setPostMix*(mixFunc: TMixFunction, arg: pointer){.cdecl,
|
||||||
importc: "Mix_SetPostMix", dynlib: MixerLibName.}
|
importc: "Mix_SetPostMix", dynlib: MixerLibName.}
|
||||||
# Add your own music player or additional mixer function.
|
# Add your own music player or additional mixer function.
|
||||||
# If 'mix_func' is NULL, the default music player is re-enabled.
|
# If 'mix_func' is NULL, the default music player is re-enabled.
|
||||||
#
|
#
|
||||||
proc HookMusic*(mix_func: TMixFunction, arg: Pointer){.cdecl,
|
proc hookMusic*(mixFunc: TMixFunction, arg: pointer){.cdecl,
|
||||||
importc: "Mix_HookMusic", dynlib: MixerLibName.}
|
importc: "Mix_HookMusic", dynlib: MixerLibName.}
|
||||||
# Add your own callback when the music has finished playing.
|
# Add your own callback when the music has finished playing.
|
||||||
#
|
#
|
||||||
proc HookMusicFinished*(music_finished: Pointer){.cdecl,
|
proc hookMusicFinished*(musicFinished: pointer){.cdecl,
|
||||||
importc: "Mix_HookMusicFinished", dynlib: MixerLibName.}
|
importc: "Mix_HookMusicFinished", dynlib: MixerLibName.}
|
||||||
# Get a pointer to the user data for the current music hook
|
# Get a pointer to the user data for the current music hook
|
||||||
proc GetMusicHookData*(): Pointer{.cdecl, importc: "Mix_GetMusicHookData",
|
proc getMusicHookData*(): pointer{.cdecl, importc: "Mix_GetMusicHookData",
|
||||||
dynlib: MixerLibName.}
|
dynlib: MixerLibName.}
|
||||||
#* Add your own callback when a channel has finished playing. NULL
|
#* Add your own callback when a channel has finished playing. NULL
|
||||||
# * to disable callback.*
|
# * to disable callback.*
|
||||||
type
|
type
|
||||||
TChannel_finished* = proc (channel: cint){.cdecl.}
|
TChannelFinished* = proc (channel: cint){.cdecl.}
|
||||||
|
|
||||||
proc ChannelFinished*(channel_finished: TChannel_finished){.cdecl,
|
proc channelFinished*(channelFinished: TChannelFinished){.cdecl,
|
||||||
importc: "Mix_ChannelFinished", dynlib: MixerLibName.}
|
importc: "Mix_ChannelFinished", dynlib: MixerLibName.}
|
||||||
const
|
const
|
||||||
CHANNEL_POST* = - 2
|
CHANNEL_POST* = - 2
|
||||||
|
|
||||||
type
|
type
|
||||||
TEffectFunc* = proc (chan: cint, stream: Pointer, length: cint,
|
TEffectFunc* = proc (chan: cint, stream: pointer, length: cint,
|
||||||
udata: Pointer): Pointer{.cdecl.}
|
udata: pointer): pointer{.cdecl.}
|
||||||
TEffectDone* = proc (chan: cint, udata: Pointer): Pointer{.cdecl.}
|
TEffectDone* = proc (chan: cint, udata: pointer): pointer{.cdecl.}
|
||||||
proc RegisterEffect*(chan: cint, f: TEffectFunc, d: TEffectDone,
|
proc registerEffect*(chan: cint, f: TEffectFunc, d: TEffectDone,
|
||||||
arg: Pointer): cint{.cdecl,
|
arg: pointer): cint{.cdecl,
|
||||||
importc: "Mix_RegisterEffect", dynlib: MixerLibName.}
|
importc: "Mix_RegisterEffect", dynlib: MixerLibName.}
|
||||||
|
|
||||||
proc UnregisterEffect*(channel: cint, f: TEffectFunc): cint{.cdecl,
|
proc unregisterEffect*(channel: cint, f: TEffectFunc): cint{.cdecl,
|
||||||
importc: "Mix_UnregisterEffect", dynlib: MixerLibName.}
|
importc: "Mix_UnregisterEffect", dynlib: MixerLibName.}
|
||||||
|
|
||||||
proc UnregisterAllEffects*(channel: cint): cint{.cdecl,
|
proc unregisterAllEffects*(channel: cint): cint{.cdecl,
|
||||||
importc: "Mix_UnregisterAllEffects", dynlib: MixerLibName.}
|
importc: "Mix_UnregisterAllEffects", dynlib: MixerLibName.}
|
||||||
const
|
const
|
||||||
EFFECTSMAXSPEED* = "MIX_EFFECTSMAXSPEED"
|
EFFECTSMAXSPEED* = "MIX_EFFECTSMAXSPEED"
|
||||||
|
|
||||||
proc SetPanning*(channel: cint, left: byte, right: byte): cint{.cdecl,
|
proc setPanning*(channel: cint, left: byte, right: byte): cint{.cdecl,
|
||||||
importc: "Mix_SetPanning", dynlib: MixerLibName.}
|
importc: "Mix_SetPanning", dynlib: MixerLibName.}
|
||||||
|
|
||||||
proc SetPosition*(channel: cint, angle: int16, distance: byte): cint{.cdecl,
|
proc setPosition*(channel: cint, angle: int16, distance: byte): cint{.cdecl,
|
||||||
importc: "Mix_SetPosition", dynlib: MixerLibName.}
|
importc: "Mix_SetPosition", dynlib: MixerLibName.}
|
||||||
|
|
||||||
proc SetDistance*(channel: cint, distance: byte): cint{.cdecl,
|
proc setDistance*(channel: cint, distance: byte): cint{.cdecl,
|
||||||
importc: "Mix_SetDistance", dynlib: MixerLibName.}
|
importc: "Mix_SetDistance", dynlib: MixerLibName.}
|
||||||
|
|
||||||
proc SetReverseStereo*(channel: cint, flip: cint): cint{.cdecl,
|
proc setReverseStereo*(channel: cint, flip: cint): cint{.cdecl,
|
||||||
importc: "Mix_SetReverseStereo", dynlib: MixerLibName.}
|
importc: "Mix_SetReverseStereo", dynlib: MixerLibName.}
|
||||||
|
|
||||||
proc ReserveChannels*(num: cint): cint{.cdecl, importc: "Mix_ReserveChannels",
|
proc reserveChannels*(num: cint): cint{.cdecl, importc: "Mix_ReserveChannels",
|
||||||
dynlib: MixerLibName.}
|
dynlib: MixerLibName.}
|
||||||
|
|
||||||
proc GroupChannel*(which: cint, tag: cint): cint{.cdecl,
|
proc groupChannel*(which: cint, tag: cint): cint{.cdecl,
|
||||||
importc: "Mix_GroupChannel", dynlib: MixerLibName.}
|
importc: "Mix_GroupChannel", dynlib: MixerLibName.}
|
||||||
proc GroupChannels*(`from`: cint, `to`: cint, tag: cint): cint{.cdecl,
|
proc groupChannels*(`from`: cint, `to`: cint, tag: cint): cint{.cdecl,
|
||||||
importc: "Mix_GroupChannels", dynlib: MixerLibName.}
|
importc: "Mix_GroupChannels", dynlib: MixerLibName.}
|
||||||
proc GroupAvailable*(tag: cint): cint{.cdecl, importc: "Mix_GroupAvailable",
|
proc groupAvailable*(tag: cint): cint{.cdecl, importc: "Mix_GroupAvailable",
|
||||||
dynlib: MixerLibName.}
|
dynlib: MixerLibName.}
|
||||||
proc GroupCount*(tag: cint): cint{.cdecl, importc: "Mix_GroupCount",
|
proc groupCount*(tag: cint): cint{.cdecl, importc: "Mix_GroupCount",
|
||||||
dynlib: MixerLibName.}
|
dynlib: MixerLibName.}
|
||||||
proc GroupOldest*(tag: cint): cint{.cdecl, importc: "Mix_GroupOldest",
|
proc groupOldest*(tag: cint): cint{.cdecl, importc: "Mix_GroupOldest",
|
||||||
dynlib: MixerLibName.}
|
dynlib: MixerLibName.}
|
||||||
proc GroupNewer*(tag: cint): cint{.cdecl, importc: "Mix_GroupNewer",
|
proc groupNewer*(tag: cint): cint{.cdecl, importc: "Mix_GroupNewer",
|
||||||
dynlib: MixerLibName.}
|
dynlib: MixerLibName.}
|
||||||
proc PlayChannelTimed*(channel: cint, chunk: PChunk, loops: cint,
|
proc playChannelTimed*(channel: cint, chunk: PChunk, loops: cint,
|
||||||
ticks: cint): cint{.cdecl,
|
ticks: cint): cint{.cdecl,
|
||||||
importc: "Mix_PlayChannelTimed", dynlib: MixerLibName.}
|
importc: "Mix_PlayChannelTimed", dynlib: MixerLibName.}
|
||||||
proc PlayChannel*(channel: cint, chunk: PChunk, loops: cint): cint
|
proc playChannel*(channel: cint, chunk: PChunk, loops: cint): cint
|
||||||
proc PlayMusic*(music: PMusic, loops: cint): cint{.cdecl,
|
proc playMusic*(music: PMusic, loops: cint): cint{.cdecl,
|
||||||
importc: "Mix_PlayMusic", dynlib: MixerLibName.}
|
importc: "Mix_PlayMusic", dynlib: MixerLibName.}
|
||||||
proc FadeInMusic*(music: PMusic, loops: cint, ms: cint): cint{.cdecl,
|
proc fadeInMusic*(music: PMusic, loops: cint, ms: cint): cint{.cdecl,
|
||||||
importc: "Mix_FadeInMusic", dynlib: MixerLibName.}
|
importc: "Mix_FadeInMusic", dynlib: MixerLibName.}
|
||||||
proc FadeInChannelTimed*(channel: cint, chunk: PChunk, loops: cint,
|
proc fadeInChannelTimed*(channel: cint, chunk: PChunk, loops: cint,
|
||||||
ms: cint, ticks: cint): cint{.cdecl,
|
ms: cint, ticks: cint): cint{.cdecl,
|
||||||
importc: "Mix_FadeInChannelTimed", dynlib: MixerLibName.}
|
importc: "Mix_FadeInChannelTimed", dynlib: MixerLibName.}
|
||||||
proc FadeInChannel*(channel: cint, chunk: PChunk, loops: cint, ms: cint): cint
|
proc fadeInChannel*(channel: cint, chunk: PChunk, loops: cint, ms: cint): cint
|
||||||
|
|
||||||
proc Volume*(channel: cint, volume: cint): cint{.cdecl, importc: "Mix_Volume",
|
proc volume*(channel: cint, volume: cint): cint{.cdecl, importc: "Mix_Volume",
|
||||||
dynlib: MixerLibName.}
|
dynlib: MixerLibName.}
|
||||||
proc VolumeChunk*(chunk: PChunk, volume: cint): cint{.cdecl,
|
proc volumeChunk*(chunk: PChunk, volume: cint): cint{.cdecl,
|
||||||
importc: "Mix_VolumeChunk", dynlib: MixerLibName.}
|
importc: "Mix_VolumeChunk", dynlib: MixerLibName.}
|
||||||
proc VolumeMusic*(volume: cint): cint{.cdecl, importc: "Mix_VolumeMusic",
|
proc volumeMusic*(volume: cint): cint{.cdecl, importc: "Mix_VolumeMusic",
|
||||||
dynlib: MixerLibName.}
|
dynlib: MixerLibName.}
|
||||||
|
|
||||||
proc HaltChannel*(channel: cint): cint{.cdecl, importc: "Mix_HaltChannel",
|
proc haltChannel*(channel: cint): cint{.cdecl, importc: "Mix_HaltChannel",
|
||||||
dynlib: MixerLibName.}
|
dynlib: MixerLibName.}
|
||||||
proc HaltGroup*(tag: cint): cint{.cdecl, importc: "Mix_HaltGroup",
|
proc haltGroup*(tag: cint): cint{.cdecl, importc: "Mix_HaltGroup",
|
||||||
dynlib: MixerLibName.}
|
dynlib: MixerLibName.}
|
||||||
proc HaltMusic*(): cint{.cdecl, importc: "Mix_HaltMusic",
|
proc haltMusic*(): cint{.cdecl, importc: "Mix_HaltMusic",
|
||||||
dynlib: MixerLibName.}
|
dynlib: MixerLibName.}
|
||||||
# Change the expiration delay for a particular channel.
|
# Change the expiration delay for a particular channel.
|
||||||
# The sample will stop playing after the 'ticks' milliseconds have elapsed,
|
# The sample will stop playing after the 'ticks' milliseconds have elapsed,
|
||||||
# or remove the expiration if 'ticks' is -1
|
# or remove the expiration if 'ticks' is -1
|
||||||
#
|
#
|
||||||
proc ExpireChannel*(channel: cint, ticks: cint): cint{.cdecl,
|
proc expireChannel*(channel: cint, ticks: cint): cint{.cdecl,
|
||||||
importc: "Mix_ExpireChannel", dynlib: MixerLibName.}
|
importc: "Mix_ExpireChannel", dynlib: MixerLibName.}
|
||||||
# Halt a channel, fading it out progressively till it's silent
|
# Halt a channel, fading it out progressively till it's silent
|
||||||
# The ms parameter indicates the number of milliseconds the fading
|
# The ms parameter indicates the number of milliseconds the fading
|
||||||
# will take.
|
# will take.
|
||||||
#
|
#
|
||||||
proc FadeOutChannel*(which: cint, ms: cint): cint{.cdecl,
|
proc fadeOutChannel*(which: cint, ms: cint): cint{.cdecl,
|
||||||
importc: "Mix_FadeOutChannel", dynlib: MixerLibName.}
|
importc: "Mix_FadeOutChannel", dynlib: MixerLibName.}
|
||||||
proc FadeOutGroup*(tag: cint, ms: cint): cint{.cdecl,
|
proc fadeOutGroup*(tag: cint, ms: cint): cint{.cdecl,
|
||||||
importc: "Mix_FadeOutGroup", dynlib: MixerLibName.}
|
importc: "Mix_FadeOutGroup", dynlib: MixerLibName.}
|
||||||
proc FadeOutMusic*(ms: cint): cint{.cdecl, importc: "Mix_FadeOutMusic",
|
proc fadeOutMusic*(ms: cint): cint{.cdecl, importc: "Mix_FadeOutMusic",
|
||||||
dynlib: MixerLibName.}
|
dynlib: MixerLibName.}
|
||||||
# Query the fading status of a channel
|
# Query the fading status of a channel
|
||||||
proc FadingMusic*(): TFading{.cdecl, importc: "Mix_FadingMusic",
|
proc fadingMusic*(): TFading{.cdecl, importc: "Mix_FadingMusic",
|
||||||
dynlib: MixerLibName.}
|
dynlib: MixerLibName.}
|
||||||
proc FadingChannel*(which: cint): TFading{.cdecl,
|
proc fadingChannel*(which: cint): TFading{.cdecl,
|
||||||
importc: "Mix_FadingChannel", dynlib: MixerLibName.}
|
importc: "Mix_FadingChannel", dynlib: MixerLibName.}
|
||||||
|
|
||||||
proc Pause*(channel: cint){.cdecl, importc: "Mix_Pause", dynlib: MixerLibName.}
|
proc pause*(channel: cint){.cdecl, importc: "Mix_Pause", dynlib: MixerLibName.}
|
||||||
proc Resume*(channel: cint){.cdecl, importc: "Mix_Resume",
|
proc resume*(channel: cint){.cdecl, importc: "Mix_Resume",
|
||||||
dynlib: MixerLibName.}
|
dynlib: MixerLibName.}
|
||||||
proc Paused*(channel: cint): cint{.cdecl, importc: "Mix_Paused",
|
proc paused*(channel: cint): cint{.cdecl, importc: "Mix_Paused",
|
||||||
dynlib: MixerLibName.}
|
dynlib: MixerLibName.}
|
||||||
|
|
||||||
proc PauseMusic*(){.cdecl, importc: "Mix_PauseMusic", dynlib: MixerLibName.}
|
proc pauseMusic*(){.cdecl, importc: "Mix_PauseMusic", dynlib: MixerLibName.}
|
||||||
proc ResumeMusic*(){.cdecl, importc: "Mix_ResumeMusic", dynlib: MixerLibName.}
|
proc resumeMusic*(){.cdecl, importc: "Mix_ResumeMusic", dynlib: MixerLibName.}
|
||||||
proc RewindMusic*(){.cdecl, importc: "Mix_RewindMusic", dynlib: MixerLibName.}
|
proc rewindMusic*(){.cdecl, importc: "Mix_RewindMusic", dynlib: MixerLibName.}
|
||||||
proc PausedMusic*(): cint{.cdecl, importc: "Mix_PausedMusic",
|
proc pausedMusic*(): cint{.cdecl, importc: "Mix_PausedMusic",
|
||||||
dynlib: MixerLibName.}
|
dynlib: MixerLibName.}
|
||||||
|
|
||||||
proc SetMusicPosition*(position: float64): cint{.cdecl,
|
proc setMusicPosition*(position: float64): cint{.cdecl,
|
||||||
importc: "Mix_SetMusicPosition", dynlib: MixerLibName.}
|
importc: "Mix_SetMusicPosition", dynlib: MixerLibName.}
|
||||||
|
|
||||||
proc Playing*(channel: cint): cint{.cdecl, importc: "Mix_Playing",
|
proc playing*(channel: cint): cint{.cdecl, importc: "Mix_Playing",
|
||||||
dynlib: MixerLibName.}
|
dynlib: MixerLibName.}
|
||||||
proc PlayingMusic*(): cint{.cdecl, importc: "Mix_PlayingMusic",
|
proc playingMusic*(): cint{.cdecl, importc: "Mix_PlayingMusic",
|
||||||
dynlib: MixerLibName.}
|
dynlib: MixerLibName.}
|
||||||
|
|
||||||
proc SetMusicCMD*(command: cstring): cint{.cdecl, importc: "Mix_SetMusicCMD",
|
proc setMusicCMD*(command: cstring): cint{.cdecl, importc: "Mix_SetMusicCMD",
|
||||||
dynlib: MixerLibName.}
|
dynlib: MixerLibName.}
|
||||||
|
|
||||||
proc SetSynchroValue*(value: cint): cint{.cdecl,
|
proc setSynchroValue*(value: cint): cint{.cdecl,
|
||||||
importc: "Mix_SetSynchroValue", dynlib: MixerLibName.}
|
importc: "Mix_SetSynchroValue", dynlib: MixerLibName.}
|
||||||
proc GetSynchroValue*(): cint{.cdecl, importc: "Mix_GetSynchroValue",
|
proc getSynchroValue*(): cint{.cdecl, importc: "Mix_GetSynchroValue",
|
||||||
dynlib: MixerLibName.}
|
dynlib: MixerLibName.}
|
||||||
|
|
||||||
proc GetChunk*(channel: cint): PChunk{.cdecl, importc: "Mix_GetChunk",
|
proc getChunk*(channel: cint): PChunk{.cdecl, importc: "Mix_GetChunk",
|
||||||
dynlib: MixerLibName.}
|
dynlib: MixerLibName.}
|
||||||
|
|
||||||
proc CloseAudio*(){.cdecl, importc: "Mix_CloseAudio", dynlib: MixerLibName.}
|
proc closeAudio*(){.cdecl, importc: "Mix_CloseAudio", dynlib: MixerLibName.}
|
||||||
|
|
||||||
proc VERSION(X: var sdl.Tversion) =
|
proc version(x: var sdl.Tversion) =
|
||||||
X.major = MAJOR_VERSION
|
x.major = MAJOR_VERSION
|
||||||
X.minor = MINOR_VERSION
|
x.minor = MINOR_VERSION
|
||||||
X.patch = PATCHLEVEL
|
x.patch = PATCHLEVEL
|
||||||
|
|
||||||
proc LoadWAV(filename: cstring): PChunk =
|
proc loadWAV(filename: cstring): PChunk =
|
||||||
result = LoadWAV_RW(RWFromFile(filename, "rb"), 1)
|
result = loadWAV_RW(rWFromFile(filename, "rb"), 1)
|
||||||
|
|
||||||
proc PlayChannel(channel: cint, chunk: PChunk, loops: cint): cint =
|
proc playChannel(channel: cint, chunk: PChunk, loops: cint): cint =
|
||||||
result = PlayChannelTimed(channel, chunk, loops, - 1)
|
result = playChannelTimed(channel, chunk, loops, - 1)
|
||||||
|
|
||||||
proc FadeInChannel(channel: cint, chunk: PChunk, loops: cint, ms: cint): cint =
|
proc fadeInChannel(channel: cint, chunk: PChunk, loops: cint, ms: cint): cint =
|
||||||
result = FadeInChannelTimed(channel, chunk, loops, ms, - 1)
|
result = fadeInChannelTimed(channel, chunk, loops, ms, - 1)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ type #music_cmd.h types
|
||||||
|
|
||||||
PWAVStream* = ptr TWAVStream
|
PWAVStream* = ptr TWAVStream
|
||||||
TWAVStream*{.final.} = object #playmidi.h types
|
TWAVStream*{.final.} = object #playmidi.h types
|
||||||
wavefp*: Pointer
|
wavefp*: pointer
|
||||||
start*: int32
|
start*: int32
|
||||||
stop*: int32
|
stop*: int32
|
||||||
cvt*: TAudioCVT
|
cvt*: TAudioCVT
|
||||||
|
|
@ -75,8 +75,8 @@ type #music_cmd.h types
|
||||||
volume*: cint #vf: OggVorbis_File;
|
volume*: cint #vf: OggVorbis_File;
|
||||||
section*: cint
|
section*: cint
|
||||||
cvt*: TAudioCVT
|
cvt*: TAudioCVT
|
||||||
len_available*: cint
|
lenAvailable*: cint
|
||||||
snd_available*: pointer
|
sndAvailable*: pointer
|
||||||
|
|
||||||
TErrorEnum* = enum
|
TErrorEnum* = enum
|
||||||
MMERR_OPENING_FILE, MMERR_OUT_OF_MEMORY, MMERR_DYNAMIC_LINKING,
|
MMERR_OPENING_FILE, MMERR_OUT_OF_MEMORY, MMERR_DYNAMIC_LINKING,
|
||||||
|
|
@ -107,7 +107,7 @@ type #music_cmd.h types
|
||||||
TChunk*{.final.} = object
|
TChunk*{.final.} = object
|
||||||
allocated*: cint
|
allocated*: cint
|
||||||
abuf*: pointer
|
abuf*: pointer
|
||||||
alen*: Uint32
|
alen*: uint32
|
||||||
volume*: byte # Per-sample volume, 0-128
|
volume*: byte # Per-sample volume, 0-128
|
||||||
|
|
||||||
TFading* = enum
|
TFading* = enum
|
||||||
|
|
@ -118,18 +118,18 @@ type #music_cmd.h types
|
||||||
TMusic*{.final.} = object
|
TMusic*{.final.} = object
|
||||||
typ*: TMusicType
|
typ*: TMusicType
|
||||||
|
|
||||||
TMixFunction* = proc (udata, stream: pointer, length: cint): Pointer{.
|
TMixFunction* = proc (udata, stream: pointer, length: cint): pointer{.
|
||||||
cdecl.} # This macro can be used to fill a version structure with the compile-time
|
cdecl.} # This macro can be used to fill a version structure with the compile-time
|
||||||
# version of the SDL_mixer library.
|
# version of the SDL_mixer library.
|
||||||
|
|
||||||
proc VERSION*(X: var sdl.TVersion)
|
proc version*(x: var sdl.Tversion)
|
||||||
# This function gets the version of the dynamically linked SDL_mixer library.
|
# This function gets the version of the dynamically linked SDL_mixer library.
|
||||||
# It should NOT be used to fill a version structure, instead you should use the
|
# It should NOT be used to fill a version structure, instead you should use the
|
||||||
# SDL_MIXER_VERSION() macro.
|
# SDL_MIXER_VERSION() macro.
|
||||||
proc Linked_Version*(): sdl.Pversion{.cdecl, importc: "Mix_Linked_Version",
|
proc linkedVersion*(): sdl.Pversion{.cdecl, importc: "Mix_Linked_Version",
|
||||||
dynlib: MixerLibName.}
|
dynlib: MixerLibName.}
|
||||||
# Open the mixer with a certain audio format
|
# Open the mixer with a certain audio format
|
||||||
proc OpenAudio*(frequency: cint, format: Uint16, channels: cint,
|
proc openAudio*(frequency: cint, format: uint16, channels: cint,
|
||||||
chunksize: cint): cint{.cdecl, importc: "Mix_OpenAudio",
|
chunksize: cint): cint{.cdecl, importc: "Mix_OpenAudio",
|
||||||
dynlib: MixerLibName.}
|
dynlib: MixerLibName.}
|
||||||
# Dynamically change the number of channels managed by the mixer.
|
# Dynamically change the number of channels managed by the mixer.
|
||||||
|
|
@ -137,170 +137,170 @@ proc OpenAudio*(frequency: cint, format: Uint16, channels: cint,
|
||||||
# stopped.
|
# stopped.
|
||||||
# This function returns the new number of allocated channels.
|
# This function returns the new number of allocated channels.
|
||||||
#
|
#
|
||||||
proc AllocateChannels*(numchannels: cint): cint{.cdecl,
|
proc allocateChannels*(numchannels: cint): cint{.cdecl,
|
||||||
importc: "Mix_AllocateChannels", dynlib: MixerLibName.}
|
importc: "Mix_AllocateChannels", dynlib: MixerLibName.}
|
||||||
# Find out what the actual audio device parameters are.
|
# Find out what the actual audio device parameters are.
|
||||||
# This function returns 1 if the audio has been opened, 0 otherwise.
|
# This function returns 1 if the audio has been opened, 0 otherwise.
|
||||||
#
|
#
|
||||||
proc QuerySpec*(frequency: var cint, format: var Uint16, channels: var cint): cint{.
|
proc querySpec*(frequency: var cint, format: var uint16, channels: var cint): cint{.
|
||||||
cdecl, importc: "Mix_QuerySpec", dynlib: MixerLibName.}
|
cdecl, importc: "Mix_QuerySpec", dynlib: MixerLibName.}
|
||||||
# Load a wave file or a music (.mod .s3m .it .xm) file
|
# Load a wave file or a music (.mod .s3m .it .xm) file
|
||||||
proc LoadWAV_RW*(src: PRWops, freesrc: cint): PChunk{.cdecl,
|
proc LoadWAV_RW*(src: PRWops, freesrc: cint): PChunk{.cdecl,
|
||||||
importc: "Mix_LoadWAV_RW", dynlib: MixerLibName.}
|
importc: "Mix_LoadWAV_RW", dynlib: MixerLibName.}
|
||||||
proc LoadWAV*(filename: cstring): PChunk
|
proc loadWAV*(filename: cstring): PChunk
|
||||||
proc LoadMUS*(filename: cstring): PMusic{.cdecl, importc: "Mix_LoadMUS",
|
proc loadMUS*(filename: cstring): PMusic{.cdecl, importc: "Mix_LoadMUS",
|
||||||
dynlib: MixerLibName.}
|
dynlib: MixerLibName.}
|
||||||
# Load a wave file of the mixer format from a memory buffer
|
# Load a wave file of the mixer format from a memory buffer
|
||||||
proc QuickLoad_WAV*(mem: pointer): PChunk{.cdecl,
|
proc quickLoadWAV*(mem: pointer): PChunk{.cdecl,
|
||||||
importc: "Mix_QuickLoad_WAV", dynlib: MixerLibName.}
|
importc: "Mix_QuickLoad_WAV", dynlib: MixerLibName.}
|
||||||
# Free an audio chunk previously loaded
|
# Free an audio chunk previously loaded
|
||||||
proc FreeChunk*(chunk: PChunk){.cdecl, importc: "Mix_FreeChunk",
|
proc freeChunk*(chunk: PChunk){.cdecl, importc: "Mix_FreeChunk",
|
||||||
dynlib: MixerLibName.}
|
dynlib: MixerLibName.}
|
||||||
proc FreeMusic*(music: PMusic){.cdecl, importc: "Mix_FreeMusic",
|
proc freeMusic*(music: PMusic){.cdecl, importc: "Mix_FreeMusic",
|
||||||
dynlib: MixerLibName.}
|
dynlib: MixerLibName.}
|
||||||
# Find out the music format of a mixer music, or the currently playing
|
# Find out the music format of a mixer music, or the currently playing
|
||||||
# music, if 'music' is NULL.
|
# music, if 'music' is NULL.
|
||||||
proc GetMusicType*(music: PMusic): TMusicType{.cdecl,
|
proc getMusicType*(music: PMusic): TMusicType{.cdecl,
|
||||||
importc: "Mix_GetMusicType", dynlib: MixerLibName.}
|
importc: "Mix_GetMusicType", dynlib: MixerLibName.}
|
||||||
# Set a function that is called after all mixing is performed.
|
# Set a function that is called after all mixing is performed.
|
||||||
# This can be used to provide real-time visual display of the audio stream
|
# This can be used to provide real-time visual display of the audio stream
|
||||||
# or add a custom mixer filter for the stream data.
|
# or add a custom mixer filter for the stream data.
|
||||||
#
|
#
|
||||||
proc SetPostMix*(mixfunc: TMixFunction, arg: Pointer){.cdecl,
|
proc setPostMix*(mixfunc: TMixFunction, arg: pointer){.cdecl,
|
||||||
importc: "Mix_SetPostMix", dynlib: MixerLibName.}
|
importc: "Mix_SetPostMix", dynlib: MixerLibName.}
|
||||||
# Add your own music player or additional mixer function.
|
# Add your own music player or additional mixer function.
|
||||||
# If 'mix_func' is NULL, the default music player is re-enabled.
|
# If 'mix_func' is NULL, the default music player is re-enabled.
|
||||||
#
|
#
|
||||||
proc HookMusic*(mix_func: TMixFunction, arg: Pointer){.cdecl,
|
proc hookMusic*(mixFunc: TMixFunction, arg: pointer){.cdecl,
|
||||||
importc: "Mix_HookMusic", dynlib: MixerLibName.}
|
importc: "Mix_HookMusic", dynlib: MixerLibName.}
|
||||||
# Add your own callback when the music has finished playing.
|
# Add your own callback when the music has finished playing.
|
||||||
#
|
#
|
||||||
proc HookMusicFinished*(music_finished: Pointer){.cdecl,
|
proc hookMusicFinished*(musicFinished: pointer){.cdecl,
|
||||||
importc: "Mix_HookMusicFinished", dynlib: MixerLibName.}
|
importc: "Mix_HookMusicFinished", dynlib: MixerLibName.}
|
||||||
# Get a pointer to the user data for the current music hook
|
# Get a pointer to the user data for the current music hook
|
||||||
proc GetMusicHookData*(): Pointer{.cdecl, importc: "Mix_GetMusicHookData",
|
proc getMusicHookData*(): pointer{.cdecl, importc: "Mix_GetMusicHookData",
|
||||||
dynlib: MixerLibName.}
|
dynlib: MixerLibName.}
|
||||||
#* Add your own callback when a channel has finished playing. NULL
|
#* Add your own callback when a channel has finished playing. NULL
|
||||||
# * to disable callback.*
|
# * to disable callback.*
|
||||||
type
|
type
|
||||||
TChannel_finished* = proc (channel: cint){.cdecl.}
|
TChannelFinished* = proc (channel: cint){.cdecl.}
|
||||||
|
|
||||||
proc ChannelFinished*(channel_finished: TChannel_finished){.cdecl,
|
proc channelFinished*(channelFinished: TChannelFinished){.cdecl,
|
||||||
importc: "Mix_ChannelFinished", dynlib: MixerLibName.}
|
importc: "Mix_ChannelFinished", dynlib: MixerLibName.}
|
||||||
const
|
const
|
||||||
CHANNEL_POST* = - 2
|
CHANNEL_POST* = - 2
|
||||||
|
|
||||||
type
|
type
|
||||||
TEffectFunc* = proc (chan: cint, stream: Pointer, length: cint,
|
TEffectFunc* = proc (chan: cint, stream: pointer, length: cint,
|
||||||
udata: Pointer): Pointer{.cdecl.}
|
udata: pointer): pointer{.cdecl.}
|
||||||
TEffectDone* = proc (chan: cint, udata: Pointer): Pointer{.cdecl.}
|
TEffectDone* = proc (chan: cint, udata: pointer): pointer{.cdecl.}
|
||||||
|
|
||||||
proc RegisterEffect*(chan: cint, f: TEffectFunc, d: TEffectDone,
|
proc registerEffect*(chan: cint, f: TEffectFunc, d: TEffectDone,
|
||||||
arg: Pointer): cint{.cdecl,
|
arg: pointer): cint{.cdecl,
|
||||||
importc: "Mix_RegisterEffect", dynlib: MixerLibName.}
|
importc: "Mix_RegisterEffect", dynlib: MixerLibName.}
|
||||||
|
|
||||||
proc UnregisterEffect*(channel: cint, f: TEffectFunc): cint{.cdecl,
|
proc unregisterEffect*(channel: cint, f: TEffectFunc): cint{.cdecl,
|
||||||
importc: "Mix_UnregisterEffect", dynlib: MixerLibName.}
|
importc: "Mix_UnregisterEffect", dynlib: MixerLibName.}
|
||||||
|
|
||||||
proc UnregisterAllEffects*(channel: cint): cint{.cdecl,
|
proc unregisterAllEffects*(channel: cint): cint{.cdecl,
|
||||||
importc: "Mix_UnregisterAllEffects", dynlib: MixerLibName.}
|
importc: "Mix_UnregisterAllEffects", dynlib: MixerLibName.}
|
||||||
|
|
||||||
const
|
const
|
||||||
EFFECTSMAXSPEED* = "MIX_EFFECTSMAXSPEED"
|
EFFECTSMAXSPEED* = "MIX_EFFECTSMAXSPEED"
|
||||||
|
|
||||||
proc SetPanning*(channel: cint, left: byte, right: byte): cint{.cdecl,
|
proc setPanning*(channel: cint, left: byte, right: byte): cint{.cdecl,
|
||||||
importc: "Mix_SetPanning", dynlib: MixerLibName.}
|
importc: "Mix_SetPanning", dynlib: MixerLibName.}
|
||||||
|
|
||||||
proc SetPosition*(channel: cint, angle: int16, distance: byte): cint{.cdecl,
|
proc setPosition*(channel: cint, angle: int16, distance: byte): cint{.cdecl,
|
||||||
importc: "Mix_SetPosition", dynlib: MixerLibName.}
|
importc: "Mix_SetPosition", dynlib: MixerLibName.}
|
||||||
|
|
||||||
proc SetDistance*(channel: cint, distance: byte): cint{.cdecl,
|
proc setDistance*(channel: cint, distance: byte): cint{.cdecl,
|
||||||
importc: "Mix_SetDistance", dynlib: MixerLibName.}
|
importc: "Mix_SetDistance", dynlib: MixerLibName.}
|
||||||
|
|
||||||
proc SetReverseStereo*(channel: cint, flip: cint): cint{.cdecl,
|
proc setReverseStereo*(channel: cint, flip: cint): cint{.cdecl,
|
||||||
importc: "Mix_SetReverseStereo", dynlib: MixerLibName.}
|
importc: "Mix_SetReverseStereo", dynlib: MixerLibName.}
|
||||||
|
|
||||||
proc ReserveChannels*(num: cint): cint{.cdecl, importc: "Mix_ReserveChannels",
|
proc reserveChannels*(num: cint): cint{.cdecl, importc: "Mix_ReserveChannels",
|
||||||
dynlib: MixerLibName.}
|
dynlib: MixerLibName.}
|
||||||
|
|
||||||
proc GroupChannel*(which: cint, tag: cint): cint{.cdecl,
|
proc groupChannel*(which: cint, tag: cint): cint{.cdecl,
|
||||||
importc: "Mix_GroupChannel", dynlib: MixerLibName.}
|
importc: "Mix_GroupChannel", dynlib: MixerLibName.}
|
||||||
# Assign several consecutive channels to a group
|
# Assign several consecutive channels to a group
|
||||||
proc GroupChannels*(`from`: cint, `to`: cint, tag: cint): cint{.cdecl,
|
proc groupChannels*(`from`: cint, `to`: cint, tag: cint): cint{.cdecl,
|
||||||
importc: "Mix_GroupChannels", dynlib: MixerLibName.}
|
importc: "Mix_GroupChannels", dynlib: MixerLibName.}
|
||||||
# Finds the first available channel in a group of channels
|
# Finds the first available channel in a group of channels
|
||||||
proc GroupAvailable*(tag: cint): cint{.cdecl, importc: "Mix_GroupAvailable",
|
proc groupAvailable*(tag: cint): cint{.cdecl, importc: "Mix_GroupAvailable",
|
||||||
dynlib: MixerLibName.}
|
dynlib: MixerLibName.}
|
||||||
# Returns the number of channels in a group. This is also a subtle
|
# Returns the number of channels in a group. This is also a subtle
|
||||||
# way to get the total number of channels when 'tag' is -1
|
# way to get the total number of channels when 'tag' is -1
|
||||||
#
|
#
|
||||||
proc GroupCount*(tag: cint): cint{.cdecl, importc: "Mix_GroupCount",
|
proc groupCount*(tag: cint): cint{.cdecl, importc: "Mix_GroupCount",
|
||||||
dynlib: MixerLibName.}
|
dynlib: MixerLibName.}
|
||||||
# Finds the "oldest" sample playing in a group of channels
|
# Finds the "oldest" sample playing in a group of channels
|
||||||
proc GroupOldest*(tag: cint): cint{.cdecl, importc: "Mix_GroupOldest",
|
proc groupOldest*(tag: cint): cint{.cdecl, importc: "Mix_GroupOldest",
|
||||||
dynlib: MixerLibName.}
|
dynlib: MixerLibName.}
|
||||||
# Finds the "most recent" (i.e. last) sample playing in a group of channels
|
# Finds the "most recent" (i.e. last) sample playing in a group of channels
|
||||||
proc GroupNewer*(tag: cint): cint{.cdecl, importc: "Mix_GroupNewer",
|
proc groupNewer*(tag: cint): cint{.cdecl, importc: "Mix_GroupNewer",
|
||||||
dynlib: MixerLibName.}
|
dynlib: MixerLibName.}
|
||||||
# The same as above, but the sound is played at most 'ticks' milliseconds
|
# The same as above, but the sound is played at most 'ticks' milliseconds
|
||||||
proc PlayChannelTimed*(channel: cint, chunk: PChunk, loops: cint,
|
proc playChannelTimed*(channel: cint, chunk: PChunk, loops: cint,
|
||||||
ticks: cint): cint{.cdecl,
|
ticks: cint): cint{.cdecl,
|
||||||
importc: "Mix_PlayChannelTimed", dynlib: MixerLibName.}
|
importc: "Mix_PlayChannelTimed", dynlib: MixerLibName.}
|
||||||
|
|
||||||
proc PlayChannel*(channel: cint, chunk: PChunk, loops: cint): cint
|
proc playChannel*(channel: cint, chunk: PChunk, loops: cint): cint
|
||||||
proc PlayMusic*(music: PMusic, loops: cint): cint{.cdecl,
|
proc playMusic*(music: PMusic, loops: cint): cint{.cdecl,
|
||||||
importc: "Mix_PlayMusic", dynlib: MixerLibName.}
|
importc: "Mix_PlayMusic", dynlib: MixerLibName.}
|
||||||
# Fade in music or a channel over "ms" milliseconds, same semantics as the "Play" functions
|
# Fade in music or a channel over "ms" milliseconds, same semantics as the "Play" functions
|
||||||
proc FadeInMusic*(music: PMusic, loops: cint, ms: cint): cint{.cdecl,
|
proc fadeInMusic*(music: PMusic, loops: cint, ms: cint): cint{.cdecl,
|
||||||
importc: "Mix_FadeInMusic", dynlib: MixerLibName.}
|
importc: "Mix_FadeInMusic", dynlib: MixerLibName.}
|
||||||
proc FadeInChannelTimed*(channel: cint, chunk: PChunk, loops: cint,
|
proc fadeInChannelTimed*(channel: cint, chunk: PChunk, loops: cint,
|
||||||
ms: cint, ticks: cint): cint{.cdecl,
|
ms: cint, ticks: cint): cint{.cdecl,
|
||||||
importc: "Mix_FadeInChannelTimed", dynlib: MixerLibName.}
|
importc: "Mix_FadeInChannelTimed", dynlib: MixerLibName.}
|
||||||
proc FadeInChannel*(channel: cint, chunk: PChunk, loops: cint, ms: cint): cint
|
proc fadeInChannel*(channel: cint, chunk: PChunk, loops: cint, ms: cint): cint
|
||||||
# Set the volume in the range of 0-128 of a specific channel or chunk.
|
# Set the volume in the range of 0-128 of a specific channel or chunk.
|
||||||
# If the specified channel is -1, set volume for all channels.
|
# If the specified channel is -1, set volume for all channels.
|
||||||
# Returns the original volume.
|
# Returns the original volume.
|
||||||
# If the specified volume is -1, just return the current volume.
|
# If the specified volume is -1, just return the current volume.
|
||||||
#
|
#
|
||||||
proc Volume*(channel: cint, volume: cint): cint{.cdecl, importc: "Mix_Volume",
|
proc volume*(channel: cint, volume: cint): cint{.cdecl, importc: "Mix_Volume",
|
||||||
dynlib: MixerLibName.}
|
dynlib: MixerLibName.}
|
||||||
proc VolumeChunk*(chunk: PChunk, volume: cint): cint{.cdecl,
|
proc volumeChunk*(chunk: PChunk, volume: cint): cint{.cdecl,
|
||||||
importc: "Mix_VolumeChunk", dynlib: MixerLibName.}
|
importc: "Mix_VolumeChunk", dynlib: MixerLibName.}
|
||||||
proc VolumeMusic*(volume: cint): cint{.cdecl, importc: "Mix_VolumeMusic",
|
proc volumeMusic*(volume: cint): cint{.cdecl, importc: "Mix_VolumeMusic",
|
||||||
dynlib: MixerLibName.}
|
dynlib: MixerLibName.}
|
||||||
# Halt playing of a particular channel
|
# Halt playing of a particular channel
|
||||||
proc HaltChannel*(channel: cint): cint{.cdecl, importc: "Mix_HaltChannel",
|
proc haltChannel*(channel: cint): cint{.cdecl, importc: "Mix_HaltChannel",
|
||||||
dynlib: MixerLibName.}
|
dynlib: MixerLibName.}
|
||||||
proc HaltGroup*(tag: cint): cint{.cdecl, importc: "Mix_HaltGroup",
|
proc haltGroup*(tag: cint): cint{.cdecl, importc: "Mix_HaltGroup",
|
||||||
dynlib: MixerLibName.}
|
dynlib: MixerLibName.}
|
||||||
proc HaltMusic*(): cint{.cdecl, importc: "Mix_HaltMusic",
|
proc haltMusic*(): cint{.cdecl, importc: "Mix_HaltMusic",
|
||||||
dynlib: MixerLibName.}
|
dynlib: MixerLibName.}
|
||||||
|
|
||||||
proc ExpireChannel*(channel: cint, ticks: cint): cint{.cdecl,
|
proc expireChannel*(channel: cint, ticks: cint): cint{.cdecl,
|
||||||
importc: "Mix_ExpireChannel", dynlib: MixerLibName.}
|
importc: "Mix_ExpireChannel", dynlib: MixerLibName.}
|
||||||
|
|
||||||
proc FadeOutChannel*(which: cint, ms: cint): cint{.cdecl,
|
proc fadeOutChannel*(which: cint, ms: cint): cint{.cdecl,
|
||||||
importc: "Mix_FadeOutChannel", dynlib: MixerLibName.}
|
importc: "Mix_FadeOutChannel", dynlib: MixerLibName.}
|
||||||
proc FadeOutGroup*(tag: cint, ms: cint): cint{.cdecl,
|
proc fadeOutGroup*(tag: cint, ms: cint): cint{.cdecl,
|
||||||
importc: "Mix_FadeOutGroup", dynlib: MixerLibName.}
|
importc: "Mix_FadeOutGroup", dynlib: MixerLibName.}
|
||||||
proc FadeOutMusic*(ms: cint): cint{.cdecl, importc: "Mix_FadeOutMusic",
|
proc fadeOutMusic*(ms: cint): cint{.cdecl, importc: "Mix_FadeOutMusic",
|
||||||
dynlib: MixerLibName.}
|
dynlib: MixerLibName.}
|
||||||
# Query the fading status of a channel
|
# Query the fading status of a channel
|
||||||
proc FadingMusic*(): TFading{.cdecl, importc: "Mix_FadingMusic",
|
proc fadingMusic*(): TFading{.cdecl, importc: "Mix_FadingMusic",
|
||||||
dynlib: MixerLibName.}
|
dynlib: MixerLibName.}
|
||||||
proc FadingChannel*(which: cint): TFading{.cdecl,
|
proc fadingChannel*(which: cint): TFading{.cdecl,
|
||||||
importc: "Mix_FadingChannel", dynlib: MixerLibName.}
|
importc: "Mix_FadingChannel", dynlib: MixerLibName.}
|
||||||
# Pause/Resume a particular channel
|
# Pause/Resume a particular channel
|
||||||
proc Pause*(channel: cint){.cdecl, importc: "Mix_Pause", dynlib: MixerLibName.}
|
proc pause*(channel: cint){.cdecl, importc: "Mix_Pause", dynlib: MixerLibName.}
|
||||||
proc Resume*(channel: cint){.cdecl, importc: "Mix_Resume",
|
proc resume*(channel: cint){.cdecl, importc: "Mix_Resume",
|
||||||
dynlib: MixerLibName.}
|
dynlib: MixerLibName.}
|
||||||
proc Paused*(channel: cint): cint{.cdecl, importc: "Mix_Paused",
|
proc paused*(channel: cint): cint{.cdecl, importc: "Mix_Paused",
|
||||||
dynlib: MixerLibName.}
|
dynlib: MixerLibName.}
|
||||||
# Pause/Resume the music stream
|
# Pause/Resume the music stream
|
||||||
proc PauseMusic*(){.cdecl, importc: "Mix_PauseMusic", dynlib: MixerLibName.}
|
proc pauseMusic*(){.cdecl, importc: "Mix_PauseMusic", dynlib: MixerLibName.}
|
||||||
proc ResumeMusic*(){.cdecl, importc: "Mix_ResumeMusic", dynlib: MixerLibName.}
|
proc resumeMusic*(){.cdecl, importc: "Mix_ResumeMusic", dynlib: MixerLibName.}
|
||||||
proc RewindMusic*(){.cdecl, importc: "Mix_RewindMusic", dynlib: MixerLibName.}
|
proc rewindMusic*(){.cdecl, importc: "Mix_RewindMusic", dynlib: MixerLibName.}
|
||||||
proc PausedMusic*(): cint{.cdecl, importc: "Mix_PausedMusic",
|
proc pausedMusic*(): cint{.cdecl, importc: "Mix_PausedMusic",
|
||||||
dynlib: MixerLibName.}
|
dynlib: MixerLibName.}
|
||||||
# Set the current position in the music stream.
|
# Set the current position in the music stream.
|
||||||
# This returns 0 if successful, or -1 if it failed or isn't implemented.
|
# This returns 0 if successful, or -1 if it failed or isn't implemented.
|
||||||
|
|
@ -308,44 +308,44 @@ proc PausedMusic*(): cint{.cdecl, importc: "Mix_PausedMusic",
|
||||||
# order number) and for OGG music (set position in seconds), at the
|
# order number) and for OGG music (set position in seconds), at the
|
||||||
# moment.
|
# moment.
|
||||||
#
|
#
|
||||||
proc SetMusicPosition*(position: float64): cint{.cdecl,
|
proc setMusicPosition*(position: float64): cint{.cdecl,
|
||||||
importc: "Mix_SetMusicPosition", dynlib: MixerLibName.}
|
importc: "Mix_SetMusicPosition", dynlib: MixerLibName.}
|
||||||
# Check the status of a specific channel.
|
# Check the status of a specific channel.
|
||||||
# If the specified channel is -1, check all channels.
|
# If the specified channel is -1, check all channels.
|
||||||
#
|
#
|
||||||
proc Playing*(channel: cint): cint{.cdecl, importc: "Mix_Playing",
|
proc playing*(channel: cint): cint{.cdecl, importc: "Mix_Playing",
|
||||||
dynlib: MixerLibName.}
|
dynlib: MixerLibName.}
|
||||||
proc PlayingMusic*(): cint{.cdecl, importc: "Mix_PlayingMusic",
|
proc playingMusic*(): cint{.cdecl, importc: "Mix_PlayingMusic",
|
||||||
dynlib: MixerLibName.}
|
dynlib: MixerLibName.}
|
||||||
# Stop music and set external music playback command
|
# Stop music and set external music playback command
|
||||||
proc SetMusicCMD*(command: cstring): cint{.cdecl, importc: "Mix_SetMusicCMD",
|
proc setMusicCMD*(command: cstring): cint{.cdecl, importc: "Mix_SetMusicCMD",
|
||||||
dynlib: MixerLibName.}
|
dynlib: MixerLibName.}
|
||||||
# Synchro value is set by MikMod from modules while playing
|
# Synchro value is set by MikMod from modules while playing
|
||||||
proc SetSynchroValue*(value: cint): cint{.cdecl,
|
proc setSynchroValue*(value: cint): cint{.cdecl,
|
||||||
importc: "Mix_SetSynchroValue", dynlib: MixerLibName.}
|
importc: "Mix_SetSynchroValue", dynlib: MixerLibName.}
|
||||||
proc GetSynchroValue*(): cint{.cdecl, importc: "Mix_GetSynchroValue",
|
proc getSynchroValue*(): cint{.cdecl, importc: "Mix_GetSynchroValue",
|
||||||
dynlib: MixerLibName.}
|
dynlib: MixerLibName.}
|
||||||
#
|
#
|
||||||
# Get the Mix_Chunk currently associated with a mixer channel
|
# Get the Mix_Chunk currently associated with a mixer channel
|
||||||
# Returns nil if it's an invalid channel, or there's no chunk associated.
|
# Returns nil if it's an invalid channel, or there's no chunk associated.
|
||||||
#
|
#
|
||||||
proc GetChunk*(channel: cint): PChunk{.cdecl, importc: "Mix_GetChunk",
|
proc getChunk*(channel: cint): PChunk{.cdecl, importc: "Mix_GetChunk",
|
||||||
dynlib: MixerLibName.}
|
dynlib: MixerLibName.}
|
||||||
# Close the mixer, halting all playing audio
|
# Close the mixer, halting all playing audio
|
||||||
proc CloseAudio*(){.cdecl, importc: "Mix_CloseAudio", dynlib: MixerLibName.}
|
proc closeAudio*(){.cdecl, importc: "Mix_CloseAudio", dynlib: MixerLibName.}
|
||||||
# We'll use SDL for reporting errors
|
# We'll use SDL for reporting errors
|
||||||
|
|
||||||
proc VERSION(X: var Tversion) =
|
proc version(x: var Tversion) =
|
||||||
X.major = MAJOR_VERSION
|
x.major = MAJOR_VERSION
|
||||||
X.minor = MINOR_VERSION
|
x.minor = MINOR_VERSION
|
||||||
X.patch = PATCHLEVEL
|
x.patch = PATCHLEVEL
|
||||||
|
|
||||||
proc LoadWAV(filename: cstring): PChunk =
|
proc loadWAV(filename: cstring): PChunk =
|
||||||
result = LoadWAV_RW(RWFromFile(filename, "rb"), 1)
|
result = LoadWAV_RW(rWFromFile(filename, "rb"), 1)
|
||||||
|
|
||||||
proc PlayChannel(channel: cint, chunk: PChunk, loops: cint): cint =
|
proc playChannel(channel: cint, chunk: PChunk, loops: cint): cint =
|
||||||
result = PlayChannelTimed(channel, chunk, loops, - 1)
|
result = playChannelTimed(channel, chunk, loops, - 1)
|
||||||
|
|
||||||
proc FadeInChannel(channel: cint, chunk: PChunk, loops: cint, ms: cint): cint =
|
proc fadeInChannel(channel: cint, chunk: PChunk, loops: cint, ms: cint): cint =
|
||||||
result = FadeInChannelTimed(channel, chunk, loops, ms, - 1)
|
result = fadeInChannelTimed(channel, chunk, loops, ms, - 1)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -145,15 +145,15 @@ type # SDL_net.h types
|
||||||
#***********************************************************************
|
#***********************************************************************
|
||||||
PIPAddress* = ptr TIPAddress
|
PIPAddress* = ptr TIPAddress
|
||||||
TIPAddress*{.final.} = object #* TCP network API
|
TIPAddress*{.final.} = object #* TCP network API
|
||||||
host*: Uint32 # 32-bit IPv4 host address */
|
host*: uint32 # 32-bit IPv4 host address */
|
||||||
port*: Uint16 # 16-bit protocol port */
|
port*: uint16 # 16-bit protocol port */
|
||||||
|
|
||||||
PTCPSocket* = ptr TTCPSocket
|
PTCPSocket* = ptr TTCPSocket
|
||||||
TTCPSocket*{.final.} = object # UDP network API
|
TTCPSocket*{.final.} = object # UDP network API
|
||||||
ready*: int
|
ready*: int
|
||||||
channel*: int
|
channel*: int
|
||||||
remoteAddress*: TIPaddress
|
remoteAddress*: TIPAddress
|
||||||
localAddress*: TIPaddress
|
localAddress*: TIPAddress
|
||||||
sflag*: int
|
sflag*: int
|
||||||
|
|
||||||
PUDP_Channel* = ptr TUDP_Channel
|
PUDP_Channel* = ptr TUDP_Channel
|
||||||
|
|
@ -196,27 +196,27 @@ type # SDL_net.h types
|
||||||
ready*: int
|
ready*: int
|
||||||
|
|
||||||
|
|
||||||
proc VERSION*(X: var Tversion)
|
proc version*(x: var Tversion)
|
||||||
#* Initialize/Cleanup the network API
|
#* Initialize/Cleanup the network API
|
||||||
# SDL must be initialized before calls to functions in this library,
|
# SDL must be initialized before calls to functions in this library,
|
||||||
# because this library uses utility functions from the SDL library.
|
# because this library uses utility functions from the SDL library.
|
||||||
#*
|
#*
|
||||||
proc Init*(): int{.cdecl, importc: "SDLNet_Init", dynlib: NetLibName.}
|
proc init*(): int{.cdecl, importc: "SDLNet_Init", dynlib: NetLibName.}
|
||||||
proc Quit*(){.cdecl, importc: "SDLNet_Quit", dynlib: NetLibName.}
|
proc quit*(){.cdecl, importc: "SDLNet_Quit", dynlib: NetLibName.}
|
||||||
#* Resolve a host name and port to an IP address in network form.
|
#* Resolve a host name and port to an IP address in network form.
|
||||||
# If the function succeeds, it will return 0.
|
# If the function succeeds, it will return 0.
|
||||||
# If the host couldn't be resolved, the host portion of the returned
|
# If the host couldn't be resolved, the host portion of the returned
|
||||||
# address will be INADDR_NONE, and the function will return -1.
|
# address will be INADDR_NONE, and the function will return -1.
|
||||||
# If 'host' is NULL, the resolved host will be set to INADDR_ANY.
|
# If 'host' is NULL, the resolved host will be set to INADDR_ANY.
|
||||||
# *
|
# *
|
||||||
proc ResolveHost*(address: var TIPaddress, host: cstring, port: Uint16): int{.
|
proc resolveHost*(address: var TIPAddress, host: cstring, port: uint16): int{.
|
||||||
cdecl, importc: "SDLNet_ResolveHost", dynlib: NetLibName.}
|
cdecl, importc: "SDLNet_ResolveHost", dynlib: NetLibName.}
|
||||||
#* Resolve an ip address to a host name in canonical form.
|
#* Resolve an ip address to a host name in canonical form.
|
||||||
# If the ip couldn't be resolved, this function returns NULL,
|
# If the ip couldn't be resolved, this function returns NULL,
|
||||||
# otherwise a pointer to a static buffer containing the hostname
|
# otherwise a pointer to a static buffer containing the hostname
|
||||||
# is returned. Note that this function is not thread-safe.
|
# is returned. Note that this function is not thread-safe.
|
||||||
#*
|
#*
|
||||||
proc ResolveIP*(ip: var TIPaddress): cstring{.cdecl,
|
proc resolveIP*(ip: var TIPAddress): cstring{.cdecl,
|
||||||
importc: "SDLNet_ResolveIP", dynlib: NetLibName.}
|
importc: "SDLNet_ResolveIP", dynlib: NetLibName.}
|
||||||
#***********************************************************************
|
#***********************************************************************
|
||||||
#* TCP network API *
|
#* TCP network API *
|
||||||
|
|
@ -229,24 +229,24 @@ proc ResolveIP*(ip: var TIPaddress): cstring{.cdecl,
|
||||||
# in the correct form).
|
# in the correct form).
|
||||||
# The newly created socket is returned, or NULL if there was an error.
|
# The newly created socket is returned, or NULL if there was an error.
|
||||||
#*
|
#*
|
||||||
proc TCP_Open*(ip: var TIPaddress): PTCPSocket{.cdecl,
|
proc tcpOpen*(ip: var TIPAddress): PTCPSocket{.cdecl,
|
||||||
importc: "SDLNet_TCP_Open", dynlib: NetLibName.}
|
importc: "SDLNet_TCP_Open", dynlib: NetLibName.}
|
||||||
#* Accept an incoming connection on the given server socket.
|
#* Accept an incoming connection on the given server socket.
|
||||||
# The newly created socket is returned, or NULL if there was an error.
|
# The newly created socket is returned, or NULL if there was an error.
|
||||||
#*
|
#*
|
||||||
proc TCP_Accept*(server: PTCPsocket): PTCPSocket{.cdecl,
|
proc tcpAccept*(server: PTCPSocket): PTCPSocket{.cdecl,
|
||||||
importc: "SDLNet_TCP_Accept", dynlib: NetLibName.}
|
importc: "SDLNet_TCP_Accept", dynlib: NetLibName.}
|
||||||
#* Get the IP address of the remote system associated with the socket.
|
#* Get the IP address of the remote system associated with the socket.
|
||||||
# If the socket is a server socket, this function returns NULL.
|
# If the socket is a server socket, this function returns NULL.
|
||||||
#*
|
#*
|
||||||
proc TCP_GetPeerAddress*(sock: PTCPsocket): PIPAddress{.cdecl,
|
proc tcpGetPeerAddress*(sock: PTCPSocket): PIPAddress{.cdecl,
|
||||||
importc: "SDLNet_TCP_GetPeerAddress", dynlib: NetLibName.}
|
importc: "SDLNet_TCP_GetPeerAddress", dynlib: NetLibName.}
|
||||||
#* Send 'len' bytes of 'data' over the non-server socket 'sock'
|
#* Send 'len' bytes of 'data' over the non-server socket 'sock'
|
||||||
# This function returns the actual amount of data sent. If the return value
|
# This function returns the actual amount of data sent. If the return value
|
||||||
# is less than the amount of data sent, then either the remote connection was
|
# is less than the amount of data sent, then either the remote connection was
|
||||||
# closed, or an unknown socket error occurred.
|
# closed, or an unknown socket error occurred.
|
||||||
#*
|
#*
|
||||||
proc TCP_Send*(sock: PTCPsocket, data: Pointer, length: int): int{.cdecl,
|
proc tcpSend*(sock: PTCPSocket, data: pointer, length: int): int{.cdecl,
|
||||||
importc: "SDLNet_TCP_Send", dynlib: NetLibName.}
|
importc: "SDLNet_TCP_Send", dynlib: NetLibName.}
|
||||||
#* Receive up to 'maxlen' bytes of data over the non-server socket 'sock',
|
#* Receive up to 'maxlen' bytes of data over the non-server socket 'sock',
|
||||||
# and store them in the buffer pointed to by 'data'.
|
# and store them in the buffer pointed to by 'data'.
|
||||||
|
|
@ -254,10 +254,10 @@ proc TCP_Send*(sock: PTCPsocket, data: Pointer, length: int): int{.cdecl,
|
||||||
# value is less than or equal to zero, then either the remote connection was
|
# value is less than or equal to zero, then either the remote connection was
|
||||||
# closed, or an unknown socket error occurred.
|
# closed, or an unknown socket error occurred.
|
||||||
#*
|
#*
|
||||||
proc TCP_Recv*(sock: PTCPsocket, data: Pointer, maxlen: int): int{.cdecl,
|
proc tcpRecv*(sock: PTCPSocket, data: pointer, maxlen: int): int{.cdecl,
|
||||||
importc: "SDLNet_TCP_Recv", dynlib: NetLibName.}
|
importc: "SDLNet_TCP_Recv", dynlib: NetLibName.}
|
||||||
#* Close a TCP network socket *
|
#* Close a TCP network socket *
|
||||||
proc TCP_Close*(sock: PTCPsocket){.cdecl, importc: "SDLNet_TCP_Close",
|
proc tcpClose*(sock: PTCPSocket){.cdecl, importc: "SDLNet_TCP_Close",
|
||||||
dynlib: NetLibName.}
|
dynlib: NetLibName.}
|
||||||
#***********************************************************************
|
#***********************************************************************
|
||||||
#* UDP network API *
|
#* UDP network API *
|
||||||
|
|
@ -265,26 +265,26 @@ proc TCP_Close*(sock: PTCPsocket){.cdecl, importc: "SDLNet_TCP_Close",
|
||||||
#* Allocate/resize/free a single UDP packet 'size' bytes long.
|
#* Allocate/resize/free a single UDP packet 'size' bytes long.
|
||||||
# The new packet is returned, or NULL if the function ran out of memory.
|
# The new packet is returned, or NULL if the function ran out of memory.
|
||||||
# *
|
# *
|
||||||
proc AllocPacket*(size: int): PUDPpacket{.cdecl,
|
proc allocPacket*(size: int): PUDPpacket{.cdecl,
|
||||||
importc: "SDLNet_AllocPacket", dynlib: NetLibName.}
|
importc: "SDLNet_AllocPacket", dynlib: NetLibName.}
|
||||||
proc ResizePacket*(packet: PUDPpacket, newsize: int): int{.cdecl,
|
proc resizePacket*(packet: PUDPpacket, newsize: int): int{.cdecl,
|
||||||
importc: "SDLNet_ResizePacket", dynlib: NetLibName.}
|
importc: "SDLNet_ResizePacket", dynlib: NetLibName.}
|
||||||
proc FreePacket*(packet: PUDPpacket){.cdecl, importc: "SDLNet_FreePacket",
|
proc freePacket*(packet: PUDPpacket){.cdecl, importc: "SDLNet_FreePacket",
|
||||||
dynlib: NetLibName.}
|
dynlib: NetLibName.}
|
||||||
#* Allocate/Free a UDP packet vector (array of packets) of 'howmany' packets,
|
#* Allocate/Free a UDP packet vector (array of packets) of 'howmany' packets,
|
||||||
# each 'size' bytes long.
|
# each 'size' bytes long.
|
||||||
# A pointer to the first packet in the array is returned, or NULL if the
|
# A pointer to the first packet in the array is returned, or NULL if the
|
||||||
# function ran out of memory.
|
# function ran out of memory.
|
||||||
# *
|
# *
|
||||||
proc AllocPacketV*(howmany: int, size: int): PUDPpacket{.cdecl,
|
proc allocPacketV*(howmany: int, size: int): PUDPpacket{.cdecl,
|
||||||
importc: "SDLNet_AllocPacketV", dynlib: NetLibName.}
|
importc: "SDLNet_AllocPacketV", dynlib: NetLibName.}
|
||||||
proc FreePacketV*(packetV: PUDPpacket){.cdecl,
|
proc freePacketV*(packetV: PUDPpacket){.cdecl,
|
||||||
importc: "SDLNet_FreePacketV", dynlib: NetLibName.}
|
importc: "SDLNet_FreePacketV", dynlib: NetLibName.}
|
||||||
#* Open a UDP network socket
|
#* Open a UDP network socket
|
||||||
# If 'port' is non-zero, the UDP socket is bound to a local port.
|
# If 'port' is non-zero, the UDP socket is bound to a local port.
|
||||||
# This allows other systems to send to this socket via a known port.
|
# This allows other systems to send to this socket via a known port.
|
||||||
#*
|
#*
|
||||||
proc UDP_Open*(port: Uint16): PUDPsocket{.cdecl, importc: "SDLNet_UDP_Open",
|
proc udpOpen*(port: uint16): PUDPSocket{.cdecl, importc: "SDLNet_UDP_Open",
|
||||||
dynlib: NetLibName.}
|
dynlib: NetLibName.}
|
||||||
#* Bind the address 'address' to the requested channel on the UDP socket.
|
#* Bind the address 'address' to the requested channel on the UDP socket.
|
||||||
# If the channel is -1, then the first unbound channel will be bound with
|
# If the channel is -1, then the first unbound channel will be bound with
|
||||||
|
|
@ -295,10 +295,10 @@ proc UDP_Open*(port: Uint16): PUDPsocket{.cdecl, importc: "SDLNet_UDP_Open",
|
||||||
# address, to which all outbound packets on the channel are sent.
|
# address, to which all outbound packets on the channel are sent.
|
||||||
# This function returns the channel which was bound, or -1 on error.
|
# This function returns the channel which was bound, or -1 on error.
|
||||||
#*
|
#*
|
||||||
proc UDP_Bind*(sock: PUDPsocket, channel: int, address: var TIPaddress): int{.
|
proc udpBind*(sock: PUDPSocket, channel: int, address: var TIPAddress): int{.
|
||||||
cdecl, importc: "SDLNet_UDP_Bind", dynlib: NetLibName.}
|
cdecl, importc: "SDLNet_UDP_Bind", dynlib: NetLibName.}
|
||||||
#* Unbind all addresses from the given channel *
|
#* Unbind all addresses from the given channel *
|
||||||
proc UDP_Unbind*(sock: PUDPsocket, channel: int){.cdecl,
|
proc udpUnbind*(sock: PUDPSocket, channel: int){.cdecl,
|
||||||
importc: "SDLNet_UDP_Unbind", dynlib: NetLibName.}
|
importc: "SDLNet_UDP_Unbind", dynlib: NetLibName.}
|
||||||
#* Get the primary IP address of the remote system associated with the
|
#* Get the primary IP address of the remote system associated with the
|
||||||
# socket and channel. If the channel is -1, then the primary IP port
|
# socket and channel. If the channel is -1, then the primary IP port
|
||||||
|
|
@ -306,7 +306,7 @@ proc UDP_Unbind*(sock: PUDPsocket, channel: int){.cdecl,
|
||||||
# opened with a specific port.
|
# opened with a specific port.
|
||||||
# If the channel is not bound and not -1, this function returns NULL.
|
# If the channel is not bound and not -1, this function returns NULL.
|
||||||
# *
|
# *
|
||||||
proc UDP_GetPeerAddress*(sock: PUDPsocket, channel: int): PIPAddress{.cdecl,
|
proc udpGetPeerAddress*(sock: PUDPSocket, channel: int): PIPAddress{.cdecl,
|
||||||
importc: "SDLNet_UDP_GetPeerAddress", dynlib: NetLibName.}
|
importc: "SDLNet_UDP_GetPeerAddress", dynlib: NetLibName.}
|
||||||
#* Send a vector of packets to the the channels specified within the packet.
|
#* Send a vector of packets to the the channels specified within the packet.
|
||||||
# If the channel specified in the packet is -1, the packet will be sent to
|
# If the channel specified in the packet is -1, the packet will be sent to
|
||||||
|
|
@ -315,7 +315,7 @@ proc UDP_GetPeerAddress*(sock: PUDPsocket, channel: int): PIPAddress{.cdecl,
|
||||||
# been sent, -1 if the packet send failed.
|
# been sent, -1 if the packet send failed.
|
||||||
# This function returns the number of packets sent.
|
# This function returns the number of packets sent.
|
||||||
#*
|
#*
|
||||||
proc UDP_SendV*(sock: PUDPsocket, packets: PPUDPpacket, npackets: int): int{.
|
proc udpSendV*(sock: PUDPSocket, packets: PPUDPpacket, npackets: int): int{.
|
||||||
cdecl, importc: "SDLNet_UDP_SendV", dynlib: NetLibName.}
|
cdecl, importc: "SDLNet_UDP_SendV", dynlib: NetLibName.}
|
||||||
#* Send a single packet to the specified channel.
|
#* Send a single packet to the specified channel.
|
||||||
# If the channel specified in the packet is -1, the packet will be sent to
|
# If the channel specified in the packet is -1, the packet will be sent to
|
||||||
|
|
@ -324,7 +324,7 @@ proc UDP_SendV*(sock: PUDPsocket, packets: PPUDPpacket, npackets: int): int{.
|
||||||
# been sent.
|
# been sent.
|
||||||
# This function returns 1 if the packet was sent, or 0 on error.
|
# This function returns 1 if the packet was sent, or 0 on error.
|
||||||
#*
|
#*
|
||||||
proc UDP_Send*(sock: PUDPsocket, channel: int, packet: PUDPpacket): int{.
|
proc udpSend*(sock: PUDPSocket, channel: int, packet: PUDPpacket): int{.
|
||||||
cdecl, importc: "SDLNet_UDP_Send", dynlib: NetLibName.}
|
cdecl, importc: "SDLNet_UDP_Send", dynlib: NetLibName.}
|
||||||
#* Receive a vector of pending packets from the UDP socket.
|
#* Receive a vector of pending packets from the UDP socket.
|
||||||
# The returned packets contain the source address and the channel they arrived
|
# The returned packets contain the source address and the channel they arrived
|
||||||
|
|
@ -336,7 +336,7 @@ proc UDP_Send*(sock: PUDPsocket, channel: int, packet: PUDPpacket): int{.
|
||||||
# This function returns the number of packets read from the network, or -1
|
# This function returns the number of packets read from the network, or -1
|
||||||
# on error. This function does not block, so can return 0 packets pending.
|
# on error. This function does not block, so can return 0 packets pending.
|
||||||
#*
|
#*
|
||||||
proc UDP_RecvV*(sock: PUDPsocket, packets: PPUDPpacket): int{.cdecl,
|
proc udpRecvV*(sock: PUDPSocket, packets: PPUDPpacket): int{.cdecl,
|
||||||
importc: "SDLNet_UDP_RecvV", dynlib: NetLibName.}
|
importc: "SDLNet_UDP_RecvV", dynlib: NetLibName.}
|
||||||
#* Receive a single packet from the UDP socket.
|
#* Receive a single packet from the UDP socket.
|
||||||
# The returned packet contains the source address and the channel it arrived
|
# The returned packet contains the source address and the channel it arrived
|
||||||
|
|
@ -348,10 +348,10 @@ proc UDP_RecvV*(sock: PUDPsocket, packets: PPUDPpacket): int{.cdecl,
|
||||||
# This function returns the number of packets read from the network, or -1
|
# This function returns the number of packets read from the network, or -1
|
||||||
# on error. This function does not block, so can return 0 packets pending.
|
# on error. This function does not block, so can return 0 packets pending.
|
||||||
#*
|
#*
|
||||||
proc UDP_Recv*(sock: PUDPsocket, packet: PUDPpacket): int{.cdecl,
|
proc udpRecv*(sock: PUDPSocket, packet: PUDPpacket): int{.cdecl,
|
||||||
importc: "SDLNet_UDP_Recv", dynlib: NetLibName.}
|
importc: "SDLNet_UDP_Recv", dynlib: NetLibName.}
|
||||||
#* Close a UDP network socket *
|
#* Close a UDP network socket *
|
||||||
proc UDP_Close*(sock: PUDPsocket){.cdecl, importc: "SDLNet_UDP_Close",
|
proc udpClose*(sock: PUDPSocket){.cdecl, importc: "SDLNet_UDP_Close",
|
||||||
dynlib: NetLibName.}
|
dynlib: NetLibName.}
|
||||||
#***********************************************************************
|
#***********************************************************************
|
||||||
#* Hooks for checking sockets for available data *
|
#* Hooks for checking sockets for available data *
|
||||||
|
|
@ -360,19 +360,19 @@ proc UDP_Close*(sock: PUDPsocket){.cdecl, importc: "SDLNet_UDP_Close",
|
||||||
# This returns a socket set for up to 'maxsockets' sockets, or NULL if
|
# This returns a socket set for up to 'maxsockets' sockets, or NULL if
|
||||||
# the function ran out of memory.
|
# the function ran out of memory.
|
||||||
# *
|
# *
|
||||||
proc AllocSocketSet*(maxsockets: int): PSocketSet{.cdecl,
|
proc allocSocketSet*(maxsockets: int): PSocketSet{.cdecl,
|
||||||
importc: "SDLNet_AllocSocketSet", dynlib: NetLibName.}
|
importc: "SDLNet_AllocSocketSet", dynlib: NetLibName.}
|
||||||
#* Add a socket to a set of sockets to be checked for available data *
|
#* Add a socket to a set of sockets to be checked for available data *
|
||||||
proc AddSocket*(theSet: PSocketSet, sock: PGenericSocket): int{.
|
proc addSocket*(theSet: PSocketSet, sock: PGenericSocket): int{.
|
||||||
cdecl, importc: "SDLNet_AddSocket", dynlib: NetLibName.}
|
cdecl, importc: "SDLNet_AddSocket", dynlib: NetLibName.}
|
||||||
proc TCP_AddSocket*(theSet: PSocketSet, sock: PTCPSocket): int
|
proc tcpAddSocket*(theSet: PSocketSet, sock: PTCPSocket): int
|
||||||
proc UDP_AddSocket*(theSet: PSocketSet, sock: PUDPSocket): int
|
proc udpAddSocket*(theSet: PSocketSet, sock: PUDPSocket): int
|
||||||
#* Remove a socket from a set of sockets to be checked for available data *
|
#* Remove a socket from a set of sockets to be checked for available data *
|
||||||
proc DelSocket*(theSet: PSocketSet, sock: PGenericSocket): int{.
|
proc delSocket*(theSet: PSocketSet, sock: PGenericSocket): int{.
|
||||||
cdecl, importc: "SDLNet_DelSocket", dynlib: NetLibName.}
|
cdecl, importc: "SDLNet_DelSocket", dynlib: NetLibName.}
|
||||||
proc TCP_DelSocket*(theSet: PSocketSet, sock: PTCPSocket): int
|
proc tcpDelSocket*(theSet: PSocketSet, sock: PTCPSocket): int
|
||||||
# SDLNet_DelSocket(set, (SDLNet_GenericSocket)sock)
|
# SDLNet_DelSocket(set, (SDLNet_GenericSocket)sock)
|
||||||
proc UDP_DelSocket*(theSet: PSocketSet, sock: PUDPSocket): int
|
proc udpDelSocket*(theSet: PSocketSet, sock: PUDPSocket): int
|
||||||
#SDLNet_DelSocket(set, (SDLNet_GenericSocket)sock)
|
#SDLNet_DelSocket(set, (SDLNet_GenericSocket)sock)
|
||||||
#* This function checks to see if data is available for reading on the
|
#* This function checks to see if data is available for reading on the
|
||||||
# given set of sockets. If 'timeout' is 0, it performs a quick poll,
|
# given set of sockets. If 'timeout' is 0, it performs a quick poll,
|
||||||
|
|
@ -381,47 +381,46 @@ proc UDP_DelSocket*(theSet: PSocketSet, sock: PUDPSocket): int
|
||||||
# first. This function returns the number of sockets ready for reading,
|
# first. This function returns the number of sockets ready for reading,
|
||||||
# or -1 if there was an error with the select() system call.
|
# or -1 if there was an error with the select() system call.
|
||||||
#*
|
#*
|
||||||
proc CheckSockets*(theSet: PSocketSet, timeout: int32): int{.cdecl,
|
proc checkSockets*(theSet: PSocketSet, timeout: int32): int{.cdecl,
|
||||||
importc: "SDLNet_CheckSockets", dynlib: NetLibName.}
|
importc: "SDLNet_CheckSockets", dynlib: NetLibName.}
|
||||||
#* After calling SDLNet_CheckSockets(), you can use this function on a
|
#* After calling SDLNet_CheckSockets(), you can use this function on a
|
||||||
# socket that was in the socket set, to find out if data is available
|
# socket that was in the socket set, to find out if data is available
|
||||||
# for reading.
|
# for reading.
|
||||||
#*
|
#*
|
||||||
proc SocketReady*(sock: PGenericSocket): bool
|
proc socketReady*(sock: PGenericSocket): bool
|
||||||
#* Free a set of sockets allocated by SDL_NetAllocSocketSet() *
|
#* Free a set of sockets allocated by SDL_NetAllocSocketSet() *
|
||||||
proc FreeSocketSet*(theSet: PSocketSet){.cdecl,
|
proc freeSocketSet*(theSet: PSocketSet){.cdecl,
|
||||||
importc: "SDLNet_FreeSocketSet", dynlib: NetLibName.}
|
importc: "SDLNet_FreeSocketSet", dynlib: NetLibName.}
|
||||||
#***********************************************************************
|
#***********************************************************************
|
||||||
#* Platform-independent data conversion functions *
|
#* Platform-independent data conversion functions *
|
||||||
#***********************************************************************
|
#***********************************************************************
|
||||||
#* Write a 16/32 bit value to network packet buffer *
|
#* Write a 16/32 bit value to network packet buffer *
|
||||||
proc Write16*(value: Uint16, area: Pointer){.cdecl,
|
proc write16*(value: uint16, area: pointer){.cdecl,
|
||||||
importc: "SDLNet_Write16", dynlib: NetLibName.}
|
importc: "SDLNet_Write16", dynlib: NetLibName.}
|
||||||
proc Write32*(value: Uint32, area: Pointer){.cdecl,
|
proc write32*(value: uint32, area: pointer){.cdecl,
|
||||||
importc: "SDLNet_Write32", dynlib: NetLibName.}
|
importc: "SDLNet_Write32", dynlib: NetLibName.}
|
||||||
#* Read a 16/32 bit value from network packet buffer *
|
#* Read a 16/32 bit value from network packet buffer *
|
||||||
proc Read16*(area: Pointer): Uint16{.cdecl, importc: "SDLNet_Read16",
|
proc read16*(area: pointer): uint16{.cdecl, importc: "SDLNet_Read16",
|
||||||
dynlib: NetLibName.}
|
dynlib: NetLibName.}
|
||||||
proc Read32*(area: Pointer): Uint32{.cdecl, importc: "SDLNet_Read32",
|
proc read32*(area: pointer): uint32{.cdecl, importc: "SDLNet_Read32",
|
||||||
dynlib: NetLibName.}
|
dynlib: NetLibName.}
|
||||||
|
|
||||||
proc VERSION(X: var Tversion) =
|
proc version(x: var Tversion) =
|
||||||
X.major = MAJOR_VERSION
|
x.major = MAJOR_VERSION
|
||||||
X.minor = MINOR_VERSION
|
x.minor = MINOR_VERSION
|
||||||
X.patch = PATCHLEVEL
|
x.patch = PATCHLEVEL
|
||||||
|
|
||||||
proc TCP_AddSocket(theSet: PSocketSet, sock: PTCPSocket): int =
|
proc tcpAddSocket(theSet: PSocketSet, sock: PTCPSocket): int =
|
||||||
result = AddSocket(theSet, cast[PGenericSocket](sock))
|
result = addSocket(theSet, cast[PGenericSocket](sock))
|
||||||
|
|
||||||
proc UDP_AddSocket(theSet: PSocketSet, sock: PUDPSocket): int =
|
proc udpAddSocket(theSet: PSocketSet, sock: PUDPSocket): int =
|
||||||
result = AddSocket(theSet, cast[PGenericSocket](sock))
|
result = addSocket(theSet, cast[PGenericSocket](sock))
|
||||||
|
|
||||||
proc TCP_DelSocket(theSet: PSocketSet, sock: PTCPSocket): int =
|
proc tcpDelSocket(theSet: PSocketSet, sock: PTCPSocket): int =
|
||||||
result = DelSocket(theSet, cast[PGenericSocket](sock))
|
result = delSocket(theSet, cast[PGenericSocket](sock))
|
||||||
|
|
||||||
proc UDP_DelSocket(theSet: PSocketSet, sock: PUDPSocket): int =
|
proc udpDelSocket(theSet: PSocketSet, sock: PUDPSocket): int =
|
||||||
result = DelSocket(theSet, cast[PGenericSocket](sock))
|
result = delSocket(theSet, cast[PGenericSocket](sock))
|
||||||
|
|
||||||
proc SocketReady(sock: PGenericSocket): bool =
|
|
||||||
result = ((sock != nil) and (sock.ready == 1))
|
|
||||||
|
|
||||||
|
proc socketReady(sock: PGenericSocket): bool =
|
||||||
|
result = sock != nil and sock.ready == 1
|
||||||
|
|
|
||||||
|
|
@ -177,78 +177,78 @@ const
|
||||||
UNICODE_BOM_SWAPPED* = 0x0000FFFE
|
UNICODE_BOM_SWAPPED* = 0x0000FFFE
|
||||||
|
|
||||||
type
|
type
|
||||||
PFont* = ptr Tfont
|
PFont* = ptr TFont
|
||||||
TFont{.final.} = object
|
TFont = object
|
||||||
|
|
||||||
|
|
||||||
# This macro can be used to fill a version structure with the compile-time
|
# This macro can be used to fill a version structure with the compile-time
|
||||||
# version of the SDL_ttf library.
|
# version of the SDL_ttf library.
|
||||||
|
|
||||||
proc Linked_Version*(): sdl.Pversion{.cdecl, importc: "TTF_Linked_Version",
|
proc linkedVersion*(): sdl.Pversion{.cdecl, importc: "TTF_Linked_Version",
|
||||||
dynlib: ttfLibName.}
|
dynlib: ttfLibName.}
|
||||||
# This function tells the library whether UNICODE text is generally
|
# This function tells the library whether UNICODE text is generally
|
||||||
# byteswapped. A UNICODE BOM character in a string will override
|
# byteswapped. A UNICODE BOM character in a string will override
|
||||||
# this setting for the remainder of that string.
|
# this setting for the remainder of that string.
|
||||||
#
|
#
|
||||||
proc ByteSwappedUNICODE*(swapped: cint){.cdecl,
|
proc byteSwappedUNICODE*(swapped: cint){.cdecl,
|
||||||
importc: "TTF_ByteSwappedUNICODE", dynlib: ttfLibName.}
|
importc: "TTF_ByteSwappedUNICODE", dynlib: ttfLibName.}
|
||||||
#returns 0 on succes, -1 if error occurs
|
#returns 0 on succes, -1 if error occurs
|
||||||
proc Init*(): cint{.cdecl, importc: "TTF_Init", dynlib: ttfLibName.}
|
proc init*(): cint{.cdecl, importc: "TTF_Init", dynlib: ttfLibName.}
|
||||||
#
|
#
|
||||||
# Open a font file and create a font of the specified point size.
|
# Open a font file and create a font of the specified point size.
|
||||||
# Some .fon fonts will have several sizes embedded in the file, so the
|
# Some .fon fonts will have several sizes embedded in the file, so the
|
||||||
# point size becomes the index of choosing which size. If the value
|
# point size becomes the index of choosing which size. If the value
|
||||||
# is too high, the last indexed size will be the default.
|
# is too high, the last indexed size will be the default.
|
||||||
#
|
#
|
||||||
proc OpenFont*(filename: cstring, ptsize: cint): PFont{.cdecl,
|
proc openFont*(filename: cstring, ptsize: cint): PFont{.cdecl,
|
||||||
importc: "TTF_OpenFont", dynlib: ttfLibName.}
|
importc: "TTF_OpenFont", dynlib: ttfLibName.}
|
||||||
proc OpenFontIndex*(filename: cstring, ptsize: cint, index: int32): PFont{.
|
proc openFontIndex*(filename: cstring, ptsize: cint, index: int32): PFont{.
|
||||||
cdecl, importc: "TTF_OpenFontIndex", dynlib: ttfLibName.}
|
cdecl, importc: "TTF_OpenFontIndex", dynlib: ttfLibName.}
|
||||||
proc OpenFontRW*(src: PRWops, freesrc: cint, ptsize: cint): PFont{.cdecl,
|
proc openFontRW*(src: PRWops, freesrc: cint, ptsize: cint): PFont{.cdecl,
|
||||||
importc: "TTF_OpenFontRW", dynlib: ttfLibName.}
|
importc: "TTF_OpenFontRW", dynlib: ttfLibName.}
|
||||||
proc OpenFontIndexRW*(src: PRWops, freesrc: cint, ptsize: cint, index: int32): PFont{.
|
proc openFontIndexRW*(src: PRWops, freesrc: cint, ptsize: cint, index: int32): PFont{.
|
||||||
cdecl, importc: "TTF_OpenFontIndexRW", dynlib: ttfLibName.}
|
cdecl, importc: "TTF_OpenFontIndexRW", dynlib: ttfLibName.}
|
||||||
proc GetFontStyle*(font: PFont): cint{.cdecl,
|
proc getFontStyle*(font: PFont): cint{.cdecl,
|
||||||
importc: "TTF_GetFontStyle", dynlib: ttfLibName.}
|
importc: "TTF_GetFontStyle", dynlib: ttfLibName.}
|
||||||
proc SetFontStyle*(font: PFont, style: cint){.cdecl,
|
proc setFontStyle*(font: PFont, style: cint){.cdecl,
|
||||||
importc: "TTF_SetFontStyle", dynlib: ttfLibName.}
|
importc: "TTF_SetFontStyle", dynlib: ttfLibName.}
|
||||||
# Get the total height of the font - usually equal to point size
|
# Get the total height of the font - usually equal to point size
|
||||||
proc FontHeight*(font: PFont): cint{.cdecl, importc: "TTF_FontHeight",
|
proc fontHeight*(font: PFont): cint{.cdecl, importc: "TTF_FontHeight",
|
||||||
dynlib: ttfLibName.}
|
dynlib: ttfLibName.}
|
||||||
# Get the offset from the baseline to the top of the font
|
# Get the offset from the baseline to the top of the font
|
||||||
# This is a positive value, relative to the baseline.
|
# This is a positive value, relative to the baseline.
|
||||||
#
|
#
|
||||||
proc FontAscent*(font: PFont): cint{.cdecl, importc: "TTF_FontAscent",
|
proc fontAscent*(font: PFont): cint{.cdecl, importc: "TTF_FontAscent",
|
||||||
dynlib: ttfLibName.}
|
dynlib: ttfLibName.}
|
||||||
# Get the offset from the baseline to the bottom of the font
|
# Get the offset from the baseline to the bottom of the font
|
||||||
# This is a negative value, relative to the baseline.
|
# This is a negative value, relative to the baseline.
|
||||||
#
|
#
|
||||||
proc FontDescent*(font: PFont): cint{.cdecl, importc: "TTF_FontDescent",
|
proc fontDescent*(font: PFont): cint{.cdecl, importc: "TTF_FontDescent",
|
||||||
dynlib: ttfLibName.}
|
dynlib: ttfLibName.}
|
||||||
# Get the recommended spacing between lines of text for this font
|
# Get the recommended spacing between lines of text for this font
|
||||||
proc FontLineSkip*(font: PFont): cint{.cdecl,
|
proc fontLineSkip*(font: PFont): cint{.cdecl,
|
||||||
importc: "TTF_FontLineSkip", dynlib: ttfLibName.}
|
importc: "TTF_FontLineSkip", dynlib: ttfLibName.}
|
||||||
# Get the number of faces of the font
|
# Get the number of faces of the font
|
||||||
proc FontFaces*(font: PFont): int32{.cdecl, importc: "TTF_FontFaces",
|
proc fontFaces*(font: PFont): int32{.cdecl, importc: "TTF_FontFaces",
|
||||||
dynlib: ttfLibName.}
|
dynlib: ttfLibName.}
|
||||||
# Get the font face attributes, if any
|
# Get the font face attributes, if any
|
||||||
proc FontFaceIsFixedWidth*(font: PFont): cint{.cdecl,
|
proc fontFaceIsFixedWidth*(font: PFont): cint{.cdecl,
|
||||||
importc: "TTF_FontFaceIsFixedWidth", dynlib: ttfLibName.}
|
importc: "TTF_FontFaceIsFixedWidth", dynlib: ttfLibName.}
|
||||||
proc FontFaceFamilyName*(font: PFont): cstring{.cdecl,
|
proc fontFaceFamilyName*(font: PFont): cstring{.cdecl,
|
||||||
importc: "TTF_FontFaceFamilyName", dynlib: ttfLibName.}
|
importc: "TTF_FontFaceFamilyName", dynlib: ttfLibName.}
|
||||||
proc FontFaceStyleName*(font: PFont): cstring{.cdecl,
|
proc fontFaceStyleName*(font: PFont): cstring{.cdecl,
|
||||||
importc: "TTF_FontFaceStyleName", dynlib: ttfLibName.}
|
importc: "TTF_FontFaceStyleName", dynlib: ttfLibName.}
|
||||||
# Get the metrics (dimensions) of a glyph
|
# Get the metrics (dimensions) of a glyph
|
||||||
proc GlyphMetrics*(font: PFont, ch: Uint16, minx: var cint,
|
proc glyphMetrics*(font: PFont, ch: uint16, minx: var cint,
|
||||||
maxx: var cint, miny: var cint, maxy: var cint,
|
maxx: var cint, miny: var cint, maxy: var cint,
|
||||||
advance: var cint): cint{.cdecl,
|
advance: var cint): cint{.cdecl,
|
||||||
importc: "TTF_GlyphMetrics", dynlib: ttfLibName.}
|
importc: "TTF_GlyphMetrics", dynlib: ttfLibName.}
|
||||||
# Get the dimensions of a rendered string of text
|
# Get the dimensions of a rendered string of text
|
||||||
proc SizeText*(font: PFont, text: cstring, w: var cint, y: var cint): cint{.
|
proc sizeText*(font: PFont, text: cstring, w: var cint, y: var cint): cint{.
|
||||||
cdecl, importc: "TTF_SizeText", dynlib: ttfLibName.}
|
cdecl, importc: "TTF_SizeText", dynlib: ttfLibName.}
|
||||||
proc SizeUTF8*(font: PFont, text: cstring, w: var cint, y: var cint): cint{.
|
proc sizeUTF8*(font: PFont, text: cstring, w: var cint, y: var cint): cint{.
|
||||||
cdecl, importc: "TTF_SizeUTF8", dynlib: ttfLibName.}
|
cdecl, importc: "TTF_SizeUTF8", dynlib: ttfLibName.}
|
||||||
proc SizeUNICODE*(font: PFont, text: PUint16, w: var cint, y: var cint): cint{.
|
proc sizeUNICODE*(font: PFont, text: PUInt16, w: var cint, y: var cint): cint{.
|
||||||
cdecl, importc: "TTF_SizeUNICODE", dynlib: ttfLibName.}
|
cdecl, importc: "TTF_SizeUNICODE", dynlib: ttfLibName.}
|
||||||
# Create an 8-bit palettized surface and render the given text at
|
# Create an 8-bit palettized surface and render the given text at
|
||||||
# fast quality with the given font and color. The 0 pixel is the
|
# fast quality with the given font and color. The 0 pixel is the
|
||||||
|
|
@ -256,9 +256,9 @@ proc SizeUNICODE*(font: PFont, text: PUint16, w: var cint, y: var cint): cint{.
|
||||||
# to the text color.
|
# to the text color.
|
||||||
# This function returns the new surface, or NULL if there was an error.
|
# This function returns the new surface, or NULL if there was an error.
|
||||||
#
|
#
|
||||||
proc RenderUTF8_Solid*(font: PFont, text: cstring, fg: TColor): PSurface{.
|
proc renderUTF8Solid*(font: PFont, text: cstring, fg: TColor): PSurface{.
|
||||||
cdecl, importc: "TTF_RenderUTF8_Solid", dynlib: ttfLibName.}
|
cdecl, importc: "TTF_RenderUTF8_Solid", dynlib: ttfLibName.}
|
||||||
proc RenderUNICODE_Solid*(font: PFont, text: PUint16, fg: TColor): PSurface{.
|
proc renderUNICODE_Solid*(font: PFont, text: PUInt16, fg: TColor): PSurface{.
|
||||||
cdecl, importc: "TTF_RenderUNICODE_Solid", dynlib: ttfLibName.}
|
cdecl, importc: "TTF_RenderUNICODE_Solid", dynlib: ttfLibName.}
|
||||||
#
|
#
|
||||||
#Create an 8-bit palettized surface and render the given glyph at
|
#Create an 8-bit palettized surface and render the given glyph at
|
||||||
|
|
@ -268,20 +268,20 @@ proc RenderUNICODE_Solid*(font: PFont, text: PUint16, fg: TColor): PSurface{.
|
||||||
# centering in the X direction, and aligned normally in the Y direction.
|
# centering in the X direction, and aligned normally in the Y direction.
|
||||||
# This function returns the new surface, or NULL if there was an error.
|
# This function returns the new surface, or NULL if there was an error.
|
||||||
#
|
#
|
||||||
proc RenderGlyph_Solid*(font: PFont, ch: Uint16, fg: TColor): PSurface{.
|
proc renderGlyphSolid*(font: PFont, ch: uint16, fg: TColor): PSurface{.
|
||||||
cdecl, importc: "TTF_RenderGlyph_Solid", dynlib: ttfLibName.}
|
cdecl, importc: "TTF_RenderGlyph_Solid", dynlib: ttfLibName.}
|
||||||
# Create an 8-bit palettized surface and render the given text at
|
# Create an 8-bit palettized surface and render the given text at
|
||||||
# high quality with the given font and colors. The 0 pixel is background,
|
# high quality with the given font and colors. The 0 pixel is background,
|
||||||
# while other pixels have varying degrees of the foreground color.
|
# while other pixels have varying degrees of the foreground color.
|
||||||
# This function returns the new surface, or NULL if there was an error.
|
# This function returns the new surface, or NULL if there was an error.
|
||||||
#
|
#
|
||||||
proc RenderText_Shaded*(font: PFont, text: cstring, fg: TColor,
|
proc renderTextShaded*(font: PFont, text: cstring, fg: TColor,
|
||||||
bg: TColor): PSurface{.cdecl,
|
bg: TColor): PSurface{.cdecl,
|
||||||
importc: "TTF_RenderText_Shaded", dynlib: ttfLibName.}
|
importc: "TTF_RenderText_Shaded", dynlib: ttfLibName.}
|
||||||
proc RenderUTF8_Shaded*(font: PFont, text: cstring, fg: TColor,
|
proc renderUTF8Shaded*(font: PFont, text: cstring, fg: TColor,
|
||||||
bg: TColor): PSurface{.cdecl,
|
bg: TColor): PSurface{.cdecl,
|
||||||
importc: "TTF_RenderUTF8_Shaded", dynlib: ttfLibName.}
|
importc: "TTF_RenderUTF8_Shaded", dynlib: ttfLibName.}
|
||||||
proc RenderUNICODE_Shaded*(font: PFont, text: PUint16, fg: TColor,
|
proc renderUNICODE_Shaded*(font: PFont, text: PUInt16, fg: TColor,
|
||||||
bg: TColor): PSurface{.cdecl,
|
bg: TColor): PSurface{.cdecl,
|
||||||
importc: "TTF_RenderUNICODE_Shaded", dynlib: ttfLibName.}
|
importc: "TTF_RenderUNICODE_Shaded", dynlib: ttfLibName.}
|
||||||
# Create an 8-bit palettized surface and render the given glyph at
|
# Create an 8-bit palettized surface and render the given glyph at
|
||||||
|
|
@ -291,17 +291,17 @@ proc RenderUNICODE_Shaded*(font: PFont, text: PUint16, fg: TColor,
|
||||||
# direction, and aligned normally in the Y direction.
|
# direction, and aligned normally in the Y direction.
|
||||||
# This function returns the new surface, or NULL if there was an error.
|
# This function returns the new surface, or NULL if there was an error.
|
||||||
#
|
#
|
||||||
proc RenderGlyph_Shaded*(font: PFont, ch: Uint16, fg: TColor, bg: TColor): PSurface{.
|
proc renderGlyphShaded*(font: PFont, ch: uint16, fg: TColor, bg: TColor): PSurface{.
|
||||||
cdecl, importc: "TTF_RenderGlyph_Shaded", dynlib: ttfLibName.}
|
cdecl, importc: "TTF_RenderGlyph_Shaded", dynlib: ttfLibName.}
|
||||||
# Create a 32-bit ARGB surface and render the given text at high quality,
|
# Create a 32-bit ARGB surface and render the given text at high quality,
|
||||||
# using alpha blending to dither the font with the given color.
|
# using alpha blending to dither the font with the given color.
|
||||||
# This function returns the new surface, or NULL if there was an error.
|
# This function returns the new surface, or NULL if there was an error.
|
||||||
#
|
#
|
||||||
proc RenderText_Blended*(font: PFont, text: cstring, fg: TColor): PSurface{.
|
proc renderTextBlended*(font: PFont, text: cstring, fg: TColor): PSurface{.
|
||||||
cdecl, importc: "TTF_RenderText_Blended", dynlib: ttfLibName.}
|
cdecl, importc: "TTF_RenderText_Blended", dynlib: ttfLibName.}
|
||||||
proc RenderUTF8_Blended*(font: PFont, text: cstring, fg: TColor): PSurface{.
|
proc renderUTF8Blended*(font: PFont, text: cstring, fg: TColor): PSurface{.
|
||||||
cdecl, importc: "TTF_RenderUTF8_Blended", dynlib: ttfLibName.}
|
cdecl, importc: "TTF_RenderUTF8_Blended", dynlib: ttfLibName.}
|
||||||
proc RenderUNICODE_Blended*(font: PFont, text: PUint16, fg: TColor): PSurface{.
|
proc RenderUNICODE_Blended*(font: PFont, text: PUInt16, fg: TColor): PSurface{.
|
||||||
cdecl, importc: "TTF_RenderUNICODE_Blended", dynlib: ttfLibName.}
|
cdecl, importc: "TTF_RenderUNICODE_Blended", dynlib: ttfLibName.}
|
||||||
# Create a 32-bit ARGB surface and render the given glyph at high quality,
|
# Create a 32-bit ARGB surface and render the given glyph at high quality,
|
||||||
# using alpha blending to dither the font with the given color.
|
# using alpha blending to dither the font with the given color.
|
||||||
|
|
@ -309,7 +309,7 @@ proc RenderUNICODE_Blended*(font: PFont, text: PUint16, fg: TColor): PSurface{.
|
||||||
# direction, and aligned normally in the Y direction.
|
# direction, and aligned normally in the Y direction.
|
||||||
# This function returns the new surface, or NULL if there was an error.
|
# This function returns the new surface, or NULL if there was an error.
|
||||||
#
|
#
|
||||||
proc RenderGlyph_Blended*(font: PFont, ch: Uint16, fg: TColor): PSurface{.
|
proc renderGlyphBlended*(font: PFont, ch: uint16, fg: TColor): PSurface{.
|
||||||
cdecl, importc: "TTF_RenderGlyph_Blended", dynlib: ttfLibName.}
|
cdecl, importc: "TTF_RenderGlyph_Blended", dynlib: ttfLibName.}
|
||||||
# For compatibility with previous versions, here are the old functions
|
# For compatibility with previous versions, here are the old functions
|
||||||
# #define TTF_RenderText(font, text, fg, bg)
|
# #define TTF_RenderText(font, text, fg, bg)
|
||||||
|
|
@ -319,19 +319,19 @@ proc RenderGlyph_Blended*(font: PFont, ch: Uint16, fg: TColor): PSurface{.
|
||||||
# #define TTF_RenderUNICODE(font, text, fg, bg)
|
# #define TTF_RenderUNICODE(font, text, fg, bg)
|
||||||
# TTF_RenderUNICODE_Shaded(font, text, fg, bg)
|
# TTF_RenderUNICODE_Shaded(font, text, fg, bg)
|
||||||
# Close an opened font file
|
# Close an opened font file
|
||||||
proc CloseFont*(font: PFont){.cdecl, importc: "TTF_CloseFont",
|
proc closeFont*(font: PFont){.cdecl, importc: "TTF_CloseFont",
|
||||||
dynlib: ttfLibName.}
|
dynlib: ttfLibName.}
|
||||||
# De-initialize TTF engine
|
# De-initialize TTF engine
|
||||||
proc Quit*(){.cdecl, importc: "TTF_Quit", dynlib: ttfLibName.}
|
proc quit*(){.cdecl, importc: "TTF_Quit", dynlib: ttfLibName.}
|
||||||
# Check if the TTF engine is initialized
|
# Check if the TTF engine is initialized
|
||||||
proc WasInit*(): cint{.cdecl, importc: "TTF_WasInit", dynlib: ttfLibName.}
|
proc wasInit*(): cint{.cdecl, importc: "TTF_WasInit", dynlib: ttfLibName.}
|
||||||
|
|
||||||
|
|
||||||
proc VERSION*(X: var sdl.Tversion) =
|
proc version*(x: var sdl.Tversion) =
|
||||||
X.major = MAJOR_VERSION
|
x.major = MAJOR_VERSION
|
||||||
X.minor = MINOR_VERSION
|
x.minor = MINOR_VERSION
|
||||||
X.patch = PATCHLEVEL
|
x.patch = PATCHLEVEL
|
||||||
|
|
||||||
|
|
||||||
proc RenderText_Solid*(font: PFont, text: cstring, fg: TColor): PSurface{.
|
proc renderTextSolid*(font: PFont, text: cstring, fg: TColor): PSurface{.
|
||||||
cdecl, importc: "TTF_RenderText_Solid", dynlib: ttfLibName.}
|
cdecl, importc: "TTF_RenderText_Solid", dynlib: ttfLibName.}
|
||||||
|
|
|
||||||
|
|
@ -143,29 +143,29 @@ const
|
||||||
|
|
||||||
type
|
type
|
||||||
TFilterInfo*{.final.} = object
|
TFilterInfo*{.final.} = object
|
||||||
yuv_mb_square_error*: PUint16
|
yuvMbSquareError*: PUInt16
|
||||||
yuv_pixel_square_error*: PUint16
|
yuvPixelSquareError*: PUInt16
|
||||||
|
|
||||||
PFilterInfo* = ptr TFilterInfo # MPEG filter definition
|
PFilterInfo* = ptr TFilterInfo # MPEG filter definition
|
||||||
PFilter* = ptr TFilter # Callback functions for the filter
|
PFilter* = ptr TFilter # Callback functions for the filter
|
||||||
TFilterCallback* = proc (dest, source: POverlay, region: PRect,
|
TFilterCallback* = proc (dest, source: POverlay, region: PRect,
|
||||||
filter_info: PFilterInfo, data: Pointer): Pointer{.
|
filterInfo: PFilterInfo, data: pointer): pointer{.
|
||||||
cdecl.}
|
cdecl.}
|
||||||
TFilterDestroy* = proc (Filter: PFilter): Pointer{.cdecl.} # The filter definition itself
|
TFilterDestroy* = proc (filter: PFilter): pointer{.cdecl.} # The filter definition itself
|
||||||
TFilter*{.final.} = object # The null filter (default). It simply copies the source rectangle to the video overlay.
|
TFilter*{.final.} = object # The null filter (default). It simply copies the source rectangle to the video overlay.
|
||||||
flags*: Uint32
|
flags*: uint32
|
||||||
data*: Pointer
|
data*: pointer
|
||||||
callback*: TFilterCallback
|
callback*: TFilterCallback
|
||||||
destroy*: TFilterDestroy
|
destroy*: TFilterDestroy
|
||||||
|
|
||||||
|
|
||||||
proc filter_null*(): PFilter{.cdecl, importc: "SMPEGfilter_null",
|
proc filterNull*(): PFilter{.cdecl, importc: "SMPEGfilter_null",
|
||||||
dynlib: SmpegLibName.}
|
dynlib: SmpegLibName.}
|
||||||
# The bilinear filter. A basic low-pass filter that will produce a smoother image.
|
# The bilinear filter. A basic low-pass filter that will produce a smoother image.
|
||||||
proc filter_bilinear*(): PFilter{.cdecl,
|
proc filterBilinear*(): PFilter{.cdecl,
|
||||||
importc: "SMPEGfilter_bilinear", dynlib: SmpegLibName.}
|
importc: "SMPEGfilter_bilinear", dynlib: SmpegLibName.}
|
||||||
# The deblocking filter. It filters block borders and non-intra coded blocks to reduce blockiness
|
# The deblocking filter. It filters block borders and non-intra coded blocks to reduce blockiness
|
||||||
proc filter_deblocking*(): PFilter{.cdecl,
|
proc filterDeblocking*(): PFilter{.cdecl,
|
||||||
importc: "SMPEGfilter_deblocking", dynlib: SmpegLibName.}
|
importc: "SMPEGfilter_deblocking", dynlib: SmpegLibName.}
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# SMPEG.h
|
# SMPEG.h
|
||||||
|
|
@ -176,27 +176,27 @@ const
|
||||||
PATCHLEVEL* = 2
|
PATCHLEVEL* = 2
|
||||||
|
|
||||||
type
|
type
|
||||||
TVersion*{.final.} = object
|
TVersion* = object
|
||||||
major*: byte
|
major*: byte
|
||||||
minor*: byte
|
minor*: byte
|
||||||
patch*: byte
|
patch*: byte
|
||||||
|
|
||||||
Pversion* = ptr Tversion # This is the actual SMPEG object
|
Pversion* = ptr TVersion # This is the actual SMPEG object
|
||||||
TSMPEG*{.final.} = object
|
TSMPEG* = object
|
||||||
PSMPEG* = ptr TSMPEG # Used to get information about the SMPEG object
|
PSMPEG* = ptr TSMPEG # Used to get information about the SMPEG object
|
||||||
TInfo*{.final.} = object
|
TInfo* = object
|
||||||
has_audio*: int32
|
hasAudio*: int32
|
||||||
has_video*: int32
|
hasVideo*: int32
|
||||||
width*: int32
|
width*: int32
|
||||||
height*: int32
|
height*: int32
|
||||||
current_frame*: int32
|
currentFrame*: int32
|
||||||
current_fps*: float64
|
currentFps*: float64
|
||||||
audio_string*: array[0..79, char]
|
audioString*: array[0..79, char]
|
||||||
audio_current_frame*: int32
|
audioCurrentFrame*: int32
|
||||||
current_offset*: UInt32
|
currentOffset*: uint32
|
||||||
total_size*: UInt32
|
totalSize*: uint32
|
||||||
current_time*: float64
|
currentTime*: float64
|
||||||
total_time*: float64
|
totalTime*: float64
|
||||||
|
|
||||||
PInfo* = ptr TInfo # Possible MPEG status codes
|
PInfo* = ptr TInfo # Possible MPEG status codes
|
||||||
|
|
||||||
|
|
@ -208,7 +208,7 @@ const
|
||||||
type
|
type
|
||||||
Tstatus* = int32
|
Tstatus* = int32
|
||||||
Pstatus* = ptr int32 # Matches the declaration of SDL_UpdateRect()
|
Pstatus* = ptr int32 # Matches the declaration of SDL_UpdateRect()
|
||||||
TDisplayCallback* = proc (dst: PSurface, x, y: int, w, h: int): Pointer{.
|
TDisplayCallback* = proc (dst: PSurface, x, y: int, w, h: int): pointer{.
|
||||||
cdecl.} # Create a new SMPEG object from an MPEG file.
|
cdecl.} # Create a new SMPEG object from an MPEG file.
|
||||||
# On return, if 'info' is not NULL, it will be filled with information
|
# On return, if 'info' is not NULL, it will be filled with information
|
||||||
# about the MPEG object.
|
# about the MPEG object.
|
||||||
|
|
@ -218,15 +218,15 @@ type
|
||||||
# subsystem. If not, you will have to use the playaudio() function below
|
# subsystem. If not, you will have to use the playaudio() function below
|
||||||
# to extract the decoded data.
|
# to extract the decoded data.
|
||||||
|
|
||||||
proc SMPEG_new*(theFile: cstring, info: PInfo, audio: int): PSMPEG{.cdecl,
|
proc new*(theFile: cstring, info: PInfo, audio: int): PSMPEG{.cdecl,
|
||||||
importc: "SMPEG_new", dynlib: SmpegLibName.}
|
importc: "SMPEG_new", dynlib: SmpegLibName.}
|
||||||
# The same as above for a file descriptor
|
# The same as above for a file descriptor
|
||||||
proc new_descr*(theFile: int, info: PInfo, audio: int): PSMPEG{.
|
proc newDescr*(theFile: int, info: PInfo, audio: int): PSMPEG{.
|
||||||
cdecl, importc: "SMPEG_new_descr", dynlib: SmpegLibName.}
|
cdecl, importc: "SMPEG_new_descr", dynlib: SmpegLibName.}
|
||||||
# The same as above but for a raw chunk of data. SMPEG makes a copy of the
|
# The same as above but for a raw chunk of data. SMPEG makes a copy of the
|
||||||
# data, so the application is free to delete after a successful call to this
|
# data, so the application is free to delete after a successful call to this
|
||||||
# function.
|
# function.
|
||||||
proc new_data*(data: Pointer, size: int, info: PInfo, audio: int): PSMPEG{.
|
proc newData*(data: pointer, size: int, info: PInfo, audio: int): PSMPEG{.
|
||||||
cdecl, importc: "SMPEG_new_data", dynlib: SmpegLibName.}
|
cdecl, importc: "SMPEG_new_data", dynlib: SmpegLibName.}
|
||||||
# Get current information about an SMPEG object
|
# Get current information about an SMPEG object
|
||||||
proc getinfo*(mpeg: PSMPEG, info: PInfo){.cdecl,
|
proc getinfo*(mpeg: PSMPEG, info: PInfo){.cdecl,
|
||||||
|
|
@ -247,13 +247,13 @@ proc status*(mpeg: PSMPEG): Tstatus{.cdecl, importc: "SMPEG_status",
|
||||||
dynlib: SmpegLibName.}
|
dynlib: SmpegLibName.}
|
||||||
# status
|
# status
|
||||||
# Set the audio volume of an MPEG stream, in the range 0-100
|
# Set the audio volume of an MPEG stream, in the range 0-100
|
||||||
proc setvolume*(mpeg: PSMPEG, volume: int){.cdecl,
|
proc setVolume*(mpeg: PSMPEG, volume: int){.cdecl,
|
||||||
importc: "SMPEG_setvolume", dynlib: SmpegLibName.}
|
importc: "SMPEG_setvolume", dynlib: SmpegLibName.}
|
||||||
# Set the destination surface for MPEG video playback
|
# Set the destination surface for MPEG video playback
|
||||||
# 'surfLock' is a mutex used to synchronize access to 'dst', and can be NULL.
|
# 'surfLock' is a mutex used to synchronize access to 'dst', and can be NULL.
|
||||||
# 'callback' is a function called when an area of 'dst' needs to be updated.
|
# 'callback' is a function called when an area of 'dst' needs to be updated.
|
||||||
# If 'callback' is NULL, the default function (SDL_UpdateRect) will be used.
|
# If 'callback' is NULL, the default function (SDL_UpdateRect) will be used.
|
||||||
proc setdisplay*(mpeg: PSMPEG, dst: PSurface, surfLock: Pmutex,
|
proc setDisplay*(mpeg: PSMPEG, dst: PSurface, surfLock: PMutex,
|
||||||
callback: TDisplayCallback){.cdecl,
|
callback: TDisplayCallback){.cdecl,
|
||||||
importc: "SMPEG_setdisplay", dynlib: SmpegLibName.}
|
importc: "SMPEG_setdisplay", dynlib: SmpegLibName.}
|
||||||
# Set or clear looping play on an SMPEG object
|
# Set or clear looping play on an SMPEG object
|
||||||
|
|
@ -264,12 +264,12 @@ proc scaleXY*(mpeg: PSMPEG, width, height: int){.cdecl,
|
||||||
importc: "SMPEG_scaleXY", dynlib: SmpegLibName.}
|
importc: "SMPEG_scaleXY", dynlib: SmpegLibName.}
|
||||||
proc scale*(mpeg: PSMPEG, scale: int){.cdecl, importc: "SMPEG_scale",
|
proc scale*(mpeg: PSMPEG, scale: int){.cdecl, importc: "SMPEG_scale",
|
||||||
dynlib: SmpegLibName.}
|
dynlib: SmpegLibName.}
|
||||||
proc Double*(mpeg: PSMPEG, doubleit: bool)
|
proc double*(mpeg: PSMPEG, doubleit: bool)
|
||||||
# Move the video display area within the destination surface
|
# Move the video display area within the destination surface
|
||||||
proc move*(mpeg: PSMPEG, x, y: int){.cdecl, importc: "SMPEG_move",
|
proc move*(mpeg: PSMPEG, x, y: int){.cdecl, importc: "SMPEG_move",
|
||||||
dynlib: SmpegLibName.}
|
dynlib: SmpegLibName.}
|
||||||
# Set the region of the video to be shown
|
# Set the region of the video to be shown
|
||||||
proc setdisplayregion*(mpeg: PSMPEG, x, y, w, h: int){.cdecl,
|
proc setDisplayRegion*(mpeg: PSMPEG, x, y, w, h: int){.cdecl,
|
||||||
importc: "SMPEG_setdisplayregion", dynlib: SmpegLibName.}
|
importc: "SMPEG_setdisplayregion", dynlib: SmpegLibName.}
|
||||||
# Play an SMPEG object
|
# Play an SMPEG object
|
||||||
proc play*(mpeg: PSMPEG){.cdecl, importc: "SMPEG_play",
|
proc play*(mpeg: PSMPEG){.cdecl, importc: "SMPEG_play",
|
||||||
|
|
@ -312,7 +312,7 @@ proc error*(mpeg: PSMPEG): cstring{.cdecl, importc: "SMPEG_error",
|
||||||
proc playAudio*(mpeg: PSMPEG, stream: pointer, length: int): int{.cdecl,
|
proc playAudio*(mpeg: PSMPEG, stream: pointer, length: int): int{.cdecl,
|
||||||
importc: "SMPEG_playAudio", dynlib: SmpegLibName.}
|
importc: "SMPEG_playAudio", dynlib: SmpegLibName.}
|
||||||
# Wrapper for playAudio() that can be passed to SDL and SDL_mixer
|
# Wrapper for playAudio() that can be passed to SDL and SDL_mixer
|
||||||
proc playAudioSDL*(mpeg: Pointer, stream: pointer, length: int){.cdecl,
|
proc playAudioSDL*(mpeg: pointer, stream: pointer, length: int){.cdecl,
|
||||||
importc: "SMPEG_playAudioSDL", dynlib: SmpegLibName.}
|
importc: "SMPEG_playAudioSDL", dynlib: SmpegLibName.}
|
||||||
# Get the best SDL audio spec for the audio stream
|
# Get the best SDL audio spec for the audio stream
|
||||||
proc wantedSpec*(mpeg: PSMPEG, wanted: PAudioSpec): int{.cdecl,
|
proc wantedSpec*(mpeg: PSMPEG, wanted: PAudioSpec): int{.cdecl,
|
||||||
|
|
@ -322,14 +322,11 @@ proc actualSpec*(mpeg: PSMPEG, spec: PAudioSpec){.cdecl,
|
||||||
importc: "SMPEG_actualSpec", dynlib: SmpegLibName.}
|
importc: "SMPEG_actualSpec", dynlib: SmpegLibName.}
|
||||||
# This macro can be used to fill a version structure with the compile-time
|
# This macro can be used to fill a version structure with the compile-time
|
||||||
# version of the SDL library.
|
# version of the SDL library.
|
||||||
proc GETVERSION*(X: var Tversion)
|
proc getversion*(x: var TVersion) =
|
||||||
# implementation
|
x.major = MAJOR_VERSION
|
||||||
|
x.minor = MINOR_VERSION
|
||||||
|
x.patch = PATCHLEVEL
|
||||||
|
|
||||||
proc double(mpeg: PSMPEG, doubleit: bool) =
|
proc double(mpeg: PSMPEG, doubleit: bool) =
|
||||||
if doubleit: scale(mpeg, 2)
|
if doubleit: scale(mpeg, 2)
|
||||||
else: scale(mpeg, 1)
|
else: scale(mpeg, 1)
|
||||||
|
|
||||||
proc GETVERSION(X: var Tversion) =
|
|
||||||
X.major = MAJOR_VERSION
|
|
||||||
X.minor = MINOR_VERSION
|
|
||||||
X.patch = PATCHLEVEL
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue