I think I may be missing something in how the canvas works and hope someone can explain where I'm going wrong
Import mojo2
Const VWIDTH:Int = 320
Const VHEIGHT:Int =240
Class MyApp Extends App
Field canvas:Canvas
Method OnCreate()
canvas=New Canvas()
canvas.SetProjection2d(0, VWIDTH, 0, VHEIGHT)
End
Method OnRender()
canvas.Clear()
canvas.SetColor(1, 0, 1)
For Local w:Int = 0 Until VWIDTH
canvas.DrawLine(w, 0, w, VHEIGHT)
Next
canvas.Flush()
End
End
Function Main()
New MyApp()
End
What I would expect this code to do would draw in each strip of the canvas in magenta, what actually happens changes depending on the target
 (this image is scaled a bit, click for the full size image)
in html5 is blends the black and magenta colors together to form a muddy color and on glfw it displays every other line as magenta. It seems like it is only filling in every other line in the render method.
This is only a problem when using SetProjection2D so seems to be me misunderstanding how it works in some way. Any help would be greatly appreciated
|