drawline fails... and rotation

Monkey Targets Forums/iOS/drawline fails... and rotation

Nixx(Posted 2011) [#1]
drawing straight vertical lines one after another across the screen comes up with gaps... and rotation doesnt seem to work with midhandle


Warpy(Posted 2011) [#2]
Can you post some code?


Nixx(Posted 2011) [#3]
Import mojo

Class testAPP Extends App
Global wave:Float
Global waveAmp:Float

Global waveHeight:Float[320]
Global offset:Float[2]

Method OnCreate()

SetUpdateRate 60
SetBlend 0

End

Method OnUpdate()



End

Method OnRender()

Cls(255, 255, 255)

wave += 1 Mod 180
waveAmp += 1 Mod 18

SetAlpha 1
SetColor(0, 255, 255)
For Local x:Int = 0 Until 320
waveHeight[x] = Cos(wave) * 10 + (Sin(x * 3) * Cos(waveAmp) * 8)
DrawLine x, waveHeight[x] + (offset[1] + 240), x, 480
Next

End
End

Global tApp:testAPP

Function Main()

tApp = New testAPP

End


the lines should break on iphone


Nixx(Posted 2011) [#4]
Using DrawRect at one pixel wide instead of a line works...


marksibly(Posted 2011) [#5]
Hi,

I am not getting any 'gaps' in lines on either the simulator or the iPad.

Anyone else?

Does it happen with the glfw target (which also uses OpenGL)? Other targets?

For this sort of use, I'd probably recommend using 1 pixel wide rects anyway, as lines may have 'differing' thickness on different targets.


dawlane(Posted 2011) [#6]
Every thing looks like it works here as well.