Must I use DrawPoly to draw a non-filled rect?

BlitzMax Forums/BlitzMax Beginners Area/Must I use DrawPoly to draw a non-filled rect?

Russell(Posted 2006) [#1]
I miss the solid = true flag at the end of Rect (Now DrawRect).

Is there something I missed in the docs?

Thanks
Russell


tonyg(Posted 2006) [#2]
Nope, no fill flag although many people have created a simple function to do the same with lines.


ImaginaryHuman(Posted 2006) [#3]
Just draw 4 lines.

or...In OpenGL ... this might not be entirely accurate...untested

glBegin(GL_LINES)
    glvertex2i(x+1,y)
    glvertex2i(x+width-1,y) 'first line
    glvertex2i(x+width-1,y+1)
    glvertex2i(x+width-1,y+height-2) 'second line
    glvertex2i(x+1,y+height-2)
    glvertex2i(x+width-1,y+height-1) 'third line
    glvertex2i(x,y)
    glvertex2i(x,y+height-1) 'fourth line
glEnd()



SillyPutty(Posted 2006) [#4]
better yet, use Indiepaths Poly Module.


Wiebo(Posted 2006) [#5]
Shouldn't this be a defult feature? I mean, a NON solid rect, is it that obscure that Mark didn't think of it? come on


tonyg(Posted 2006) [#6]
I think Mark is busy (rightly or wrongly) on other things.
The response to this query
As it appears in the Wiki can we assume there will NEVER be an unfilled
option and we should use the polygon mode workaround?


produced this response...

If there's a demand for something (and esp. if it's easy!) it'll probably get done eventually. This one's easy so look out for it soon.


over a year ago.


Russell(Posted 2006) [#7]
Sorry, but that response doesn't hold water, since this feature was already available in the other Blitz products (even going back to Blitz 2D, I believe). Of course there was/is a demand for it! <shakes head> I can use DrawPoly, of course, but saying True or False as a parameter of DrawRect sure would be easier...

Russell


tonyg(Posted 2006) [#8]
I posted it purely because it *doesn't* hold water. I'm glad the irony wasn't lost in written form :)


(tu) ENAY(Posted 2006) [#9]
Wow! So much fuss over 4 LINES!


tonyg(Posted 2006) [#10]
Enay, and if the topic was unfilled DrawOval?


ImaginaryHuman(Posted 2006) [#11]
I think unfilled rect and unfilled oval should've been in the original Max2D, they are pretty standard fare and very simple to do. It's because they're so simple to do, that 4 lines of code IS indeed not much to fuss over, which is why they should've been included.

I uploaded an unfilled oval routine to the code archives under BlitzMax Graphics routines. The only thing it doesn't do is rotate well.

Any even basic graphics library should have Plot, DrawRect, DrawOval, DrawUnfilledRect, DrawUnfilledOval, Point (read the pixel color) and Cls.