void PainterOGL2::drawTextureCoords(CoordsBuffer& coordsBuffer, const TexturePtr& texture) { if(texture && texture->isEmpty()) return; setDrawProgram(m_shaderProgram ? m_shaderProgram : m_drawTexturedProgram.get()); setTexture(texture); drawCoords(coordsBuffer); }
void PainterOGL2::drawBoundingRect(const Rect& dest, int innerLineWidth) { if(dest.isEmpty() || innerLineWidth == 0) return; setDrawProgram(m_shaderProgram ? m_shaderProgram : m_drawSolidColorProgram.get()); m_coordsBuffer.clear(); m_coordsBuffer.addBoudingRect(dest, innerLineWidth); drawCoords(m_coordsBuffer); }
void PainterOGL2::drawFilledTriangle(const Point& a, const Point& b, const Point& c) { if(a == b || a == c || b == c) return; setDrawProgram(m_shaderProgram ? m_shaderProgram : m_drawSolidColorProgram.get()); m_coordsBuffer.clear(); m_coordsBuffer.addTriangle(a, b, c); drawCoords(m_coordsBuffer); }
void PainterOGL2::drawFilledRect(const Rect& dest) { if(dest.isEmpty()) return; setDrawProgram(m_shaderProgram ? m_shaderProgram : m_drawSolidColorProgram.get()); m_coordsBuffer.clear(); m_coordsBuffer.addRect(dest); drawCoords(m_coordsBuffer); }
void PainterOGL2::drawRepeatedTexturedRect(const Rect& dest, const TexturePtr& texture, const Rect& src) { if(dest.isEmpty() || src.isEmpty() || texture->isEmpty()) return; setDrawProgram(m_shaderProgram ? m_shaderProgram : m_drawTexturedProgram.get()); setTexture(texture); m_coordsBuffer.clear(); m_coordsBuffer.addRepeatedRects(dest, src); drawCoords(m_coordsBuffer); }
void PainterOGL2::drawUpsideDownTexturedRect(const Rect& dest, const TexturePtr& texture, const Rect& src) { if(dest.isEmpty() || src.isEmpty() || texture->isEmpty()) return; setDrawProgram(m_shaderProgram ? m_shaderProgram : m_drawTexturedProgram.get()); setTexture(texture); m_coordsBuffer.clear(); m_coordsBuffer.addUpsideDownQuad(dest, src); drawCoords(m_coordsBuffer, TriangleStrip); }
void PainterOGL2::drawFillCoords(CoordsBuffer& coordsBuffer) { setDrawProgram(m_shaderProgram ? m_shaderProgram : m_drawSolidColorProgram.get()); setTexture(nullptr); drawCoords(coordsBuffer); }