DRW: Add DRW_STATE_WIRE_SMOOTH to draw smooth wires.
This is only useful if depth test/wire is disabled.
This commit is contained in:
@@ -272,6 +272,7 @@ typedef enum {
|
||||
DRW_STATE_CLIP_PLANES = (1 << 18),
|
||||
DRW_STATE_ADDITIVE_FULL = (1 << 19), /* Same as DRW_STATE_ADDITIVE but let alpha accumulate without premult. */
|
||||
DRW_STATE_BLEND_PREMUL = (1 << 20), /* Use that if color is already premult by alpha. */
|
||||
DRW_STATE_WIRE_SMOOTH = (1 << 21),
|
||||
|
||||
DRW_STATE_WRITE_STENCIL = (1 << 27),
|
||||
DRW_STATE_WRITE_STENCIL_SHADOW = (1 << 28),
|
||||
|
||||
@@ -162,12 +162,16 @@ void drw_state_set(DRWState state)
|
||||
|
||||
/* Wire Width */
|
||||
{
|
||||
if (CHANGED_ANY(DRW_STATE_WIRE)) {
|
||||
if ((state & DRW_STATE_WIRE) != 0) {
|
||||
if (CHANGED_ANY(DRW_STATE_WIRE | DRW_STATE_WIRE_SMOOTH)) {
|
||||
if ((state & DRW_STATE_WIRE_SMOOTH) != 0) {
|
||||
glLineWidth(2.0f);
|
||||
glEnable(GL_LINE_SMOOTH);
|
||||
}
|
||||
else if ((state & DRW_STATE_WIRE) != 0) {
|
||||
glLineWidth(1.0f);
|
||||
}
|
||||
else {
|
||||
/* do nothing */
|
||||
glDisable(GL_LINE_SMOOTH);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user