void Canvas::DrawExactLine(int ax, int ay, int bx, int by) { pen.Bind(); const GLexact v[] = { ToGLexact(ax), ToGLexact(ay), ToGLexact(bx), ToGLexact(by), }; glVertexPointer(2, GL_EXACT, 0, v); glDrawArrays(GL_LINE_STRIP, 0, 2); pen.Unbind(); }
void Canvas::DrawExactLine(int ax, int ay, int bx, int by) { #ifdef USE_GLSL OpenGL::solid_shader->Use(); #endif pen.Bind(); const ExactRasterPoint v[] = { { ToGLexact(ax), ToGLexact(ay) }, { ToGLexact(bx), ToGLexact(by) }, }; const ScopeVertexPointer vp(v); glDrawArrays(GL_LINE_STRIP, 0, ARRAY_SIZE(v)); pen.Unbind(); }
constexpr ExactRasterPoint(RasterPoint p) :x(ToGLexact(p.x)), y(ToGLexact(p.y)) {}
constexpr ExactPixelPoint(PixelPoint p) :Point2D<GLexact>(ToGLexact(p.x), ToGLexact(p.y)) {}