Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/view2d_draw.cc
| Show First 20 Lines • Show All 196 Lines • ▼ Show 20 Lines | if (U.pixelsize > 1.0f) { | ||||
| immBindBuiltinProgram(GPU_SHADER_3D_POLYLINE_UNIFORM_COLOR); | immBindBuiltinProgram(GPU_SHADER_3D_POLYLINE_UNIFORM_COLOR); | ||||
| immUniform2fv("viewportSize", &viewport[2]); | immUniform2fv("viewportSize", &viewport[2]); | ||||
| /* -1.0f offset here is because the line is too fat due to the builtin anti-aliasing. | /* -1.0f offset here is because the line is too fat due to the builtin anti-aliasing. | ||||
| * TODO: make a variant or a uniform to toggle it off. */ | * TODO: make a variant or a uniform to toggle it off. */ | ||||
| immUniform1f("lineWidth", U.pixelsize - 1.0f); | immUniform1f("lineWidth", U.pixelsize - 1.0f); | ||||
| } | } | ||||
| else { | else { | ||||
| immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); | immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); | ||||
| } | } | ||||
| immUniformColor3ubv(color); | immUniformColor3ubv(color); | ||||
| immBegin(GPU_PRIM_LINES, steps * 2); | immBegin(GPU_PRIM_LINES, steps * 2); | ||||
| if (direction == 'v') { | if (direction == 'v') { | ||||
| for (uint i = 0; i < steps; i++) { | for (uint i = 0; i < steps; i++) { | ||||
| const float xpos = first + i * lines->distance; | const float xpos = first + i * lines->distance; | ||||
| immVertex2f(pos, xpos, rect->ymin); | immVertex2f(pos, xpos, rect->ymin); | ||||
| ▲ Show 20 Lines • Show All 386 Lines • Show Last 20 Lines | |||||