diff --git a/examples/realtime_glfw.nim b/examples/realtime_glfw.nim index 55740da..4a2d348 100644 --- a/examples/realtime_glfw.nim +++ b/examples/realtime_glfw.nim @@ -20,9 +20,9 @@ proc display() = linerGradient.gradientHandlePositions.add(vec2(0, 0)) linerGradient.gradientHandlePositions.add(vec2(0, 256)) linerGradient.gradientStops.add( - ColorStop(color: rgbx(0, 0, 0, 255), position: 0)) + ColorStop(color: color(0, 0, 0, 1), position: 0)) linerGradient.gradientStops.add( - ColorStop(color: rgbx(255, 255, 255, 255), position: 1)) + ColorStop(color: color(1, 1, 1, 1), position: 1)) ctx.fillStyle = linerGradient ctx.fillRect(0, 0, 256, 256) @@ -31,11 +31,14 @@ proc display() = radialGradient.gradientHandlePositions.add(vec2(256, 128)) radialGradient.gradientHandlePositions.add(vec2(128, 256)) radialGradient.gradientStops.add( - ColorStop(color: rgbx(255, 255, 255, 255), position: 0)) + ColorStop(color: color(1, 1, 1, 1), position: 0)) radialGradient.gradientStops.add( - ColorStop(color: rgbx(0, 0, 0, 255), position: 1)) + ColorStop(color: color(0, 0, 0, 1), position: 1)) ctx.fillStyle = radialGradient - ctx.fillCircle(vec2(128.0, 128.0 + sin(float(frameCount)/10.0) * 20), 76.8) + ctx.fillCircle(circle( + vec2(128.0, 128.0 + sin(float32(frameCount)/10.0) * 20), + 76.8 + )) # update texture with new pixels from surface var dataPtr = ctx.image.data[0].addr diff --git a/examples/realtime_glut.nim b/examples/realtime_glut.nim index 5289094..155f266 100644 --- a/examples/realtime_glut.nim +++ b/examples/realtime_glut.nim @@ -19,9 +19,9 @@ proc display() {.cdecl.} = linerGradient.gradientHandlePositions.add(vec2(0, 0)) linerGradient.gradientHandlePositions.add(vec2(0, 256)) linerGradient.gradientStops.add( - ColorStop(color: rgbx(0, 0, 0, 255), position: 0)) + ColorStop(color: color(0, 0, 0, 1), position: 0)) linerGradient.gradientStops.add( - ColorStop(color: rgbx(255, 255, 255, 255), position: 1)) + ColorStop(color: color(1, 1, 1, 1), position: 1)) ctx.fillStyle = linerGradient ctx.fillRect(0, 0, 256, 256) @@ -30,12 +30,14 @@ proc display() {.cdecl.} = radialGradient.gradientHandlePositions.add(vec2(256, 128)) radialGradient.gradientHandlePositions.add(vec2(128, 256)) radialGradient.gradientStops.add( - ColorStop(color: rgbx(255, 255, 255, 255), position: 0)) + ColorStop(color: color(1, 1, 1, 1), position: 0)) radialGradient.gradientStops.add( - ColorStop(color: rgbx(0, 0, 0, 255), position: 1)) + ColorStop(color: color(0, 0, 0, 1), position: 1)) ctx.fillStyle = radialGradient - ctx.fillCircle(vec2(128.0, 128.0 + sin(float(frameCount)/10.0) * 20), 76.8) - + ctx.fillCircle(circle( + vec2(128.0, 128.0 + sin(float32(frameCount)/10.0) * 20), + 76.8 + )) # update texture with new pixels from surface var dataPtr = ctx.image.data[0].addr glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, GLsizei w, GLsizei h, GL_RGBA, diff --git a/examples/realtime_sdl.nim b/examples/realtime_sdl.nim index b604c11..1a69b48 100644 --- a/examples/realtime_sdl.nim +++ b/examples/realtime_sdl.nim @@ -30,9 +30,9 @@ proc display() = linerGradient.gradientHandlePositions.add(vec2(0, 0)) linerGradient.gradientHandlePositions.add(vec2(0, 256)) linerGradient.gradientStops.add( - ColorStop(color: rgbx(0, 0, 0, 255), position: 0)) + ColorStop(color: pixie.color(0, 0, 0, 1), position: 0)) linerGradient.gradientStops.add( - ColorStop(color: rgbx(255, 255, 255, 255), position: 1)) + ColorStop(color: pixie.color(1, 1, 1, 1), position: 1)) ctx.fillStyle = linerGradient ctx.fillRect(0, 0, 256, 256) @@ -41,12 +41,14 @@ proc display() = radialGradient.gradientHandlePositions.add(vec2(256, 128)) radialGradient.gradientHandlePositions.add(vec2(128, 256)) radialGradient.gradientStops.add( - ColorStop(color: rgbx(255, 255, 255, 255), position: 0)) + ColorStop(color: pixie.color(1, 1, 1, 1), position: 0)) radialGradient.gradientStops.add( - ColorStop(color: rgbx(0, 0, 0, 255), position: 1)) + ColorStop(color: pixie.color(0, 0, 0, 1), position: 1)) ctx.fillStyle = radialGradient - ctx.fillCircle(vec2(128.0, 128.0 + sin(float(frameCount)/10.0) * 20), 76.8) - + ctx.fillCircle(circle( + vec2(128.0, 128.0 + sin(float32(frameCount)/10.0) * 20), + 76.8 + )) inc frameCount var dataPtr = ctx.image.data[0].addr diff --git a/examples/realtime_win32.nim b/examples/realtime_win32.nim index 68a147f..3010ed6 100644 --- a/examples/realtime_win32.nim +++ b/examples/realtime_win32.nim @@ -19,9 +19,9 @@ proc draw() = linerGradient.gradientHandlePositions.add(vec2(0, 0)) linerGradient.gradientHandlePositions.add(vec2(0, 256)) linerGradient.gradientStops.add( - ColorStop(color: rgbx(0, 0, 0, 255), position: 0)) + ColorStop(color: color(0, 0, 0, 1), position: 0)) linerGradient.gradientStops.add( - ColorStop(color: rgbx(255, 255, 255, 255), position: 1)) + ColorStop(color: color(1, 1, 1, 1), position: 1)) ctx.fillStyle = linerGradient ctx.fillRect(0, 0, 256, 256) @@ -30,11 +30,14 @@ proc draw() = radialGradient.gradientHandlePositions.add(vec2(256, 128)) radialGradient.gradientHandlePositions.add(vec2(128, 256)) radialGradient.gradientStops.add( - ColorStop(color: rgbx(255, 255, 255, 255), position: 0)) + ColorStop(color: color(1, 1, 1, 1), position: 0)) radialGradient.gradientStops.add( - ColorStop(color: rgbx(0, 0, 0, 255), position: 1)) + ColorStop(color: color(0, 0, 0, 1), position: 1)) ctx.fillStyle = radialGradient - ctx.fillCircle(vec2(128.0, 128.0 + sin(float(frameCount)/10.0) * 20), 76.8) + ctx.fillCircle(circle( + vec2(128.0, 128.0 + sin(float32(frameCount)/10.0) * 20), + 76.8 + )) inc frameCount diff --git a/examples/realtime_wnim.nim b/examples/realtime_wnim.nim index 681500a..52a92a6 100644 --- a/examples/realtime_wnim.nim +++ b/examples/realtime_wnim.nim @@ -10,7 +10,7 @@ var frameCount = 0 image = Image(w, h) app = App() - frame = Frame() + frame = Frame(title="wNim/Pixie") proc draw() = # draw shiny sphere on gradient background @@ -18,9 +18,9 @@ proc draw() = linerGradient.gradientHandlePositions.add(vec2(0, 0)) linerGradient.gradientHandlePositions.add(vec2(0, 256)) linerGradient.gradientStops.add( - ColorStop(color: rgbx(0, 0, 0, 255), position: 0)) + ColorStop(color: color(0, 0, 0, 1), position: 0)) linerGradient.gradientStops.add( - ColorStop(color: rgbx(255, 255, 255, 255), position: 1)) + ColorStop(color: color(1, 1, 1, 1), position: 1)) ctx.fillStyle = linerGradient ctx.fillRect(0, 0, 256, 256) @@ -29,12 +29,14 @@ proc draw() = radialGradient.gradientHandlePositions.add(vec2(256, 128)) radialGradient.gradientHandlePositions.add(vec2(128, 256)) radialGradient.gradientStops.add( - ColorStop(color: rgbx(255, 255, 255, 255), position: 0)) + ColorStop(color: color(1, 1, 1, 1), position: 0)) radialGradient.gradientStops.add( - ColorStop(color: rgbx(0, 0, 0, 255), position: 1)) + ColorStop(color: color(0, 0, 0, 1), position: 1)) ctx.fillStyle = radialGradient - ctx.fillCircle(vec2(128.0, 128.0 + sin(float(frameCount)/10.0) * 20), 76.8) - + ctx.fillCircle(circle( + vec2(128.0, 128.0 + sin(float32(frameCount)/10.0) * 20), + 76.8 + )) inc frameCount proc render() =