| 158 | } |
| 159 | |
| 160 | void ShapeTestApp::draw() |
| 161 | { |
| 162 | gl::clear(); |
| 163 | |
| 164 | gl::pushModelMatrix(); |
| 165 | gl::setModelMatrix( mModelMatrix ); |
| 166 | |
| 167 | // Draw SDF texture if available. |
| 168 | if( mTexture ) { |
| 169 | gl::pushModelMatrix(); |
| 170 | gl::translate( mBounds.getUpperLeft() ); |
| 171 | |
| 172 | gl::color( 1, 1, 1 ); |
| 173 | gl::draw( mTexture ); |
| 174 | |
| 175 | gl::popModelMatrix(); |
| 176 | } |
| 177 | |
| 178 | drawDebugShape( mShape, 3.0f ); |
| 179 | |
| 180 | // Draw shape outlines. |
| 181 | gl::color( mIsInside ? Color( 0.4f, 0.8f, 0.0f ) : Color( 0.8f, 0.4f, 0.0f ) ); |
| 182 | gl::draw( mShape ); |
| 183 | |
| 184 | gl::popModelMatrix(); |
| 185 | |
| 186 | // Draw closest point on shape. |
| 187 | gl::color( 0, 0.5f, 0.5f ); |
| 188 | gl::drawSolidCircle( mClosest, 5 ); |
| 189 | |
| 190 | // Draw distance as a circle. |
| 191 | gl::color( 0.5f, 0.5f, 0 ); |
| 192 | gl::drawStrokedCircle( mMouse, mDistance ); |
| 193 | } |
| 194 | |
| 195 | void ShapeTestApp::mouseMove( MouseEvent event ) |
| 196 | { |
nothing calls this directly
no test coverage detected