Testing polyvector on iphone

Previous topic - Next topic

Emil

Had some issues before with polyvector being slow on the iphone.

specifically I had this code to begin testing with.

Code (glbasic) Select
SETSCREEN 960, 640, FALSE
GLOBAL G_gameloop = TRUE
GLOBAL G_blocksize = 64
GLOBAL G_color

WHILE G_gameloop
FOR x = 0 TO 15
FOR y = 0 TO 10
G_color = RGB(200-(x*12),x*10+RND(50),y*17)
STARTPOLY 0
POLYVECTOR x*64, y*64,  0,  0, G_color
POLYVECTOR x*64, y*64+G_blocksize, 0, 64, G_color
POLYVECTOR x*64+G_blocksize, y*64+G_blocksize, 64, 64, G_color
POLYVECTOR x*64+G_blocksize,  y*64, 64,  0, G_color
ENDPOLY
NEXT
NEXT
SHOWSCREEN
WEND


Since I'm using a startpoly every increment of the loop things really go slow (I get 5 fps approximately).
I changed the code so that startpoly lies outside the loop and things went a little quicker. But the dealbreaker was when I changed the mode on startpoly to single triangles (instead of the standard 'fan') that it came back to full speed.

So now I use this code instead:
Code (glbasic) Select
SETSCREEN 960, 640, FALSE
GLOBAL G_gameloop = TRUE
GLOBAL G_blocksize = 64
GLOBAL G_color

WHILE G_gameloop
STARTPOLY 0, 1 // Using single triangles! <--------------------------
FOR x = 0 TO 15
FOR y = 0 TO 10
G_color = RGB(200-(x*12),x*10+RND(50),y*17)
POLYVECTOR x*64, y*64,  0,  0, G_color
POLYVECTOR x*64, y*64+G_blocksize, 0, 64, G_color
POLYVECTOR x*64+G_blocksize, y*64+G_blocksize, 64, 64, G_color

POLYVECTOR x*64+G_blocksize, y*64+G_blocksize, 64, 64, G_color
POLYVECTOR x*64+G_blocksize,  y*64, 64,  0, G_color
POLYVECTOR x*64, y*64,  0,  0, G_color
NEXT
NEXT
ENDPOLY
SHOWSCREEN
WEND


Just wanted to share!
If I find anything more useful with polyvectors and iphone I'll post it here!  :good:

spacefractal

#1
Colored polyvectors is slow on iOS as well alpha on those. It's a known issue. On iPad 3, those was much whose on iOS 6 than iOS 5.

Also you should use POLYNEWSTRIP rather doing a another STARTPOLY.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/