Why are there waves in my rectangle?

BlitzMax Forums/BlitzMax Beginners Area/Why are there waves in my rectangle?

Apollonius(Posted 2007) [#1]
Graphical Glitches? Is there a way to fix the graphical waves thingy unsmooth movement... if you run my example and u move that rectangle ull see waves on the sides when moving randomly appearing... how do u fix this? In alot of engine this appears for some reason.

Graphics 800,600,0

Global GameExit:Int=False

Local P1:TPlayer=New TPlayer; P1.Create(10,10)
While Not GameExit=True
	If(KeyHit(KEY_ESCAPE))Or(AppTerminate())Then GameExit=True
	
	P1.Controles()
	P1.Drawing()
	Flip; Cls
Wend
End

Type TPlayer
	Field Health:Int, Mana:Int
	Field xpos:Int, ypos:Int
	Method Create( xstart:Int, ystart:Int)
		xpos=xstart
		ypos=ystart
	End Method
	Method Controles()
		If KeyDown(KEY_UP) 		Then ypos :- 3
		If KeyDown(KEY_DOWN) 	Then ypos :+ 3
		If KeyDown(KEY_LEFT) 	Then xpos :- 3
		If KeyDown(KEY_RIGHT) 	Then xpos :+ 3
	End Method
	Method Drawing()
		DrawRect xpos,ypos,70,120
	End Method
End Type




Perturbatio(Posted 2007) [#2]
Flip True?


Apollonius(Posted 2007) [#3]
uh?


Perturbatio(Posted 2007) [#4]
Flip 1 even


Canardian(Posted 2007) [#5]
I would do:

Delay(1)
Flip 0
Cls

Works must faster and gives more CPU cycles to other programs! Dunno what the drawbacks are...

With Blitz3D I would of course have done the mak's castle tweening setup, but BlitzMax doesn't support tweening.

I think syncing anything to the display adapter's refresh is a bad idea, since most people don't even have the possibility to use 200 Hz. And still there are programs and games which magically run faster when you put your refresh rate to 200 Hz...


Apollonius(Posted 2007) [#6]
what does flip 0,1,true(1) .. do exactly?


Canardian(Posted 2007) [#7]
From the BlitzMax Help:
Flip swap the front and back buffers of the current graphics objects.

If sync is 0, then the flip occurs as soon as possible. If sync is 1, then the flip occurs on the next vertical blank.

If sync is -1 and the current graphics object was created with the Graphics command, then flips will occur at the graphics object's refresh rate regardless of whether or not the graphics hardware supports such a refresh rate.

If sync is -1 and the current graphics object was NOT created with the Graphics command, then the flip will occur on the next vertical blank.



dmaz(Posted 2007) [#8]
Kaisuo, just in case you're not familiar with the help in the ide... put your cursor on "Flip" and then press "F1" twice. the first press updates the status bar of the ide and the second will show you the help.... it has a good description there.


Grey Alien(Posted 2007) [#9]
Use Flip 1 also do a syncmods because you are using windowed mode which has vertical tearing in Bmax V1.24 unless you do a syncmods because I asked for it to be fixed. Hope this info helps.


Apollonius(Posted 2007) [#10]
I know about F1 but nothing turned up for flip in BLIde for some reason.

What is a syncmods? How does that work?
(*looks in the help file*)


tonyg(Posted 2007) [#11]
In the Bmax IDE it is Program / Synchronise Modules. It is used to download the latest updates to individual Bmax modules.


Grey Alien(Posted 2007) [#12]
I 100% sure that's what you need to do to remove the issue. A Syncmods, and use Flip 1.


Apollonius(Posted 2007) [#13]
Damn yeah, I do not own BlitzMax at the moment. But I will soon enough. I had bought BlitzPlus to make 2D games a long time ago but I was lead to belive that it had everything I needed to do so which wasn't quite true. If I had known I would have waited for BlitzMax.

So basicly I'm using the Demo so I cannot sync the modules. I'm learning BlitzMax before buying it so I don't make the same mistake again. I will not be duped again Mark! RoaR! LoL
(kidding, it's not his fault if I was a newbie about engines back then)

Anyway I'm just glad I have access to BMax forums, because I really appreciate all the help I've been getting and as soon as I have the cash I'm joining in
(under a differente name probably) :)

Anyway now im just ranting lol.
Happy Friday the 13th Everybody! :D


tonyg(Posted 2007) [#14]
So basicly I'm using the Demo so I cannot sync the modules

Haven't you been posting Bmax code for about a year though?


Apollonius(Posted 2007) [#15]
nah, I dont think so but I lost track of how many times I had to re-install the demo.


tonyg(Posted 2007) [#16]
About a year I would say
and I thought the demos expired after 30 days.


Apollonius(Posted 2007) [#17]
Then yeah a year ago. But I stoped in the middle of that because I bought Nuclear Fusion(Beta DX9.. 3D Engine for c++) which I messed with it for quite awhile but now I'm waiting for version 3.05 of NF to restart 3D so I came back to BMax and I'm getting the hang of it unlike last time, last time I tried BMax i got frustrated with it.

Demo might expire after 30 days but that doesn't mean you can't just re-install the program amongst other things ;)

But since I'm getting the hang of it, I'm getting interested into buying it :)


ziggy(Posted 2007) [#18]
BLIde doesn't work with the BlitzMax demo

This sounds weird...