DrawRect without fill?

BlitzMax Forums/BlitzMax Beginners Area/DrawRect without fill?

Steve Elliott(Posted 2005) [#1]
We have DrawRect and DrawLine - but don't seem to have the flag for drawing an unfilled rectangle - or have I missed it?


ImaginaryHuman(Posted 2005) [#2]
I don't /think/ it's there yet. It should be simple enough to do. I think actually perhaps they intend that you use drawline for a series of lines to make a box.


Steve Elliott(Posted 2005) [#3]
Yes I've been drawing 4 lines - just thought there might be a rectangle flag - or Mark might add it seeing this post. ;)


altitudems(Posted 2005) [#4]
Just use one of these:
glPolygonMode(GL_BACK, GL_LINE)  'Draw outline only
glPolygonMode(GL_BACK, GL_POINT) 'Draw dotted outline
glPolygonMode(GL_BACK, GL_FILL)  'Draw filled
P.S. This will apply to all Draw commands.


Steve Elliott(Posted 2005) [#5]
Thanks - and I see you need GL_BACK (not GL_FRONT) to write to the backbuffer before flipping.


altitudems(Posted 2005) [#6]
Oops, missed that :)


ImaginaryHuman(Posted 2005) [#7]
glPolygonMode(GL_BACK, GL_LINE) ' outlined
DrawRect 10,10,10,10
glPolygonMode(GL_BACK, GL_FILL) ' solid filled (back to normal)


flying willy(Posted 2005) [#8]
Why isn't this in the help files for rect?


tonyg(Posted 2005) [#9]
Because it's a workaround not an official function.
It's mentioned in the wiki.


Steve Elliott(Posted 2005) [#10]
Does anybody else get a missing pixel in the top right corner of the rectangle?

I would be tempted to put this in the bug report section but it's not an official function.


altitudems(Posted 2005) [#11]
Does this maybe have something to do with the DrawRect command not drawing the last pixel? After the recent 1.03 update mark has added a "draw_last_pixel" flag to DrawLine.


Steve Elliott(Posted 2005) [#12]
I'm sure it is - I guess Mark needs to add another flag. ;-)


PGF(Posted 2005) [#13]
I tried the following but it didn't work.

glObscureDrawMode(GL_BACK, GL_DRAWEVERYSINGLEPIXELINARECTANGLEPLEASE)


Steve Elliott(Posted 2005) [#14]
LOL - not too much to ask is it? ;-)


z80jim(Posted 2005) [#15]
How to generate an unfilled circle? The glPolygonMode command doesn't seem to work for that.


Yan(Posted 2005) [#16]
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE)



RiK(Posted 2005) [#17]
Why isn't this in the help files for rect?


Sadly the docs are still the weakest link in the BMax chain...