GLBasic forum

Main forum => GLBasic - en => Topic started by: ampos on 2010-Oct-08

Title: Single pixel with polyvector?
Post by: ampos on 2010-Oct-08
How do I draw a single white pixel using polyvector?
Title: Re: Single pixel with polyvector?
Post by: Ian Price on 2010-Oct-08
Code (glbasic) Select


WHILE TRUE

FOR n=0 TO 100
polypixel(RND(480),RND(320))
NEXT

SHOWSCREEN

WEND

// Draw 1x1 pixel polyvector
FUNCTION polypixel: x,y

STARTPOLY 0
POLYVECTOR x,y,x,y
POLYVECTOR x+1,y,x+1,y
POLYVECTOR x+1,y+1,x+1,y+1
POLYVECTOR x,y+1,x,y+1
ENDPOLY

ENDFUNCTION
Title: Re: Single pixel with polyvector?
Post by: ampos on 2010-Oct-08
Thx, will try later
Title: Re: Single pixel with polyvector?
Post by: Minion on 2010-Oct-08
Quote from: Ian Price on 2010-Oct-08
Code (glbasic) Select


WHILE TRUE

FOR n=0 TO 100
polypixel(RND(480),RND(320))
NEXT

SHOWSCREEN

WEND

// Draw 1x1 pixel polyvector
FUNCTION polypixel: x,y

STARTPOLY 0
POLYVECTOR x,y,x,y
POLYVECTOR x+1,y,x+1,y
POLYVECTOR x+1,y+1,x+1,y+1
POLYVECTOR x,y+1,x,y+1
ENDPOLY

ENDFUNCTION


Not bad. But how do I go about rotating it ?
Title: Re: Single pixel with polyvector?
Post by: Ian Price on 2010-Oct-08
QuoteNot bad. But how do I go about rotating it ?

LOL.

You have to have a box to circle collision routine before you can rotate it Min ;) :P
Title: Re: Single pixel with polyvector?
Post by: Marmor on 2010-Oct-08
rotate is easy ! rotate your iphone  :whistle:
Title: Re: Single pixel with polyvector?
Post by: Ian Price on 2010-Oct-08
Have twenty beers - everything rotates then :P
Title: Re: Single pixel with polyvector?
Post by: Kitty Hello on 2010-Oct-08
uhm - WHY?
I mean, if you want a pixel, use SETPIXEL.
If you want FAST pixels, use MEM2SPR and set the pixels in a DIM array beforehand.
Title: Re: Single pixel with polyvector?
Post by: ampos on 2010-Oct-08
Yes, I was looking for FAST pixels, so my question. But I did found a quick enough system. Anyway, will check mem2spr.