| 236 | } |
| 237 | |
| 238 | void WindowTestApp::windowDraw() |
| 239 | { |
| 240 | gl::enableAlphaBlending(); |
| 241 | // glEnable(GL_MULTISAMPLE_ARB); |
| 242 | if( getWindow() == getForegroundWindow() ) |
| 243 | gl::clear( Color( 0.1f, 0.1f, 0.5f ) ); |
| 244 | else |
| 245 | gl::clear( Color( 0.3f, 0.1f, 0.1f ) ); |
| 246 | |
| 247 | // We'll set the color to an orange color |
| 248 | gl::color( 1.0f, 0.5f, 0.25f ); |
| 249 | |
| 250 | glEnable( GL_LINE_SMOOTH ); |
| 251 | glHint( GL_LINE_SMOOTH_HINT, GL_NICEST ); |
| 252 | |
| 253 | const auto window = getWindow(); |
| 254 | std::string info = "f : toggle fullscreen\n"; |
| 255 | info += "b : toggle borderless (current: " + std::string( window->isBorderless() ? "on" : "off" ) + ")\n"; |
| 256 | info += "t : toggle always-on-top (current: " + std::string( window->isAlwaysOnTop() ? "on" : "off" ) + ")\n"; |
| 257 | info += "h : hide/show\n"; |
| 258 | info += "s : span displays\n"; |
| 259 | gl::drawString( info, vec2( 12.0f, 12.0f ), ColorA( 1, 1, 1, 0.9f ) ); |
| 260 | |
| 261 | gl::begin( GL_LINE_STRIP ); |
| 262 | const vector<vec2> &points = window->getUserData<WindowData>()->mPoints; |
| 263 | for( auto pointIter = points.begin(); pointIter != points.end(); ++pointIter ) { |
| 264 | gl::vertex( *pointIter /*+ vec2( 0, getElapsedSeconds() )*/ ); |
| 265 | } |
| 266 | gl::end(); |
| 267 | |
| 268 | //if( window == mSecondWindow ) |
| 269 | gl::drawLine( vec2( 50, 50 ), vec2( 250, 250 ) ); |
| 270 | gl::pushMatrices(); |
| 271 | gl::color( 1.0f, 0.2f, 0.15f ); |
| 272 | gl::translate( getWindowCenter() ); |
| 273 | gl::rotate( getElapsedSeconds() ); |
| 274 | gl::drawSolidRect( Rectf( -100, -100, 100, 100 ) ); |
| 275 | gl::popMatrices(); |
| 276 | } |
| 277 | |
| 278 | CINDER_APP( WindowTestApp, RendererGl, WindowTestApp::prepareSettings ) |
nothing calls this directly
no test coverage detected