Drawing a non solid rect
BlitzMax Forums/BlitzMax Programming/Drawing a non solid rect
| ||
Is there a function that can draw a non solid rect like DrawRect used to do? If you use DrawRect now, there is no option to have it as either solid or non solid. Thanks |
| ||
No, but it's fairly easy to do it on your own. Or you can modify the DrawRect function. Like this one: Function DrawRectHollow(X!,Y!,W!,H!) glBegin(GL_LINE_LOOP) glVertex2d(X,Y) glVertex2d(X+W,Y) glVertex2d(X+W,Y+H) glVertex2d(X,Y+H) glEnd() End Function That will work with your standard GLMax2D stuff. Now let the people who say that using GL functions with Max2D is a bad idea harp on me. |
| ||
Yep - a flag for drawrect is required. |
| ||
Is this really a problem tho'? Don't take this the wrong way, but in 20+ years of programming, drawing a rectangle (solid or otherwise) has never really come up as a problem that one might have. Thus I respectfully inquire as to what kind of program you're writing where the ability to draw rectangles is such a significant matter. |
| ||
debugging collision rectangles in 2d, is what I did yesterday. ya see I have this chopper that rotates and has a collision rect so the fireworks can hit it and explode somewhat accurately... glpolygonmode(gl_back,gl_line) DrawRect x,y,sizex,sizey glpolygonmode(gl_back,gl_fill) I guess the point of drawrect is to be simple. having to put the glCommands defeats the purpose. |
| ||
what kind of program you're writing where the ability to draw rectangles is such a significant matter. My GUI uses 4 lines instead of 1 drawrect - it just needs a flag Mark, like the line flag that was added. Yes it's not a big deal and it can be worked around. But it's not a big deal for BR to incorporate it neatly into the 2d module officially either. |