MCPcopy Create free account
hub / github.com/cinder/Cinder / windowDraw

Method windowDraw

test/windowTest/src/windowTestApp.cpp:238–276  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

236}
237
238void 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
278CINDER_APP( WindowTestApp, RendererGl, WindowTestApp::prepareSettings )

Callers

nothing calls this directly

Calls 15

enableAlphaBlendingFunction · 0.85
stringFunction · 0.85
drawStringFunction · 0.85
pushMatricesFunction · 0.85
getWindowCenterFunction · 0.85
drawSolidRectFunction · 0.85
popMatricesFunction · 0.85
getWindowFunction · 0.50
clearFunction · 0.50
ColorFunction · 0.50
colorFunction · 0.50
beginFunction · 0.50

Tested by

no test coverage detected