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

Method drawLabels

samples/_audio/InputAnalyzer/src/InputAnalyzerApp.cpp:109–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

107}
108
109void InputAnalyzer::drawLabels()
110{
111 if( ! mTextureFont )
112 mTextureFont = gl::TextureFont::create( ci::Font( ci::Font::getDefault().getName(), 16 ) );
113
114 gl::color( 0, 0.9f, 0.9f );
115
116 // draw x-axis label
117 string freqLabel = "Frequency (hertz)";
118 mTextureFont->drawString( freqLabel, vec2( getWindowCenter().x - mTextureFont->measureString( freqLabel ).x / 2, (float)getWindowHeight() - 20 ) );
119
120 // draw y-axis label
121 string dbLabel = "Magnitude (decibels, linear)";
122 gl::pushModelView();
123 gl::translate( 30, getWindowCenter().y + mTextureFont->measureString( dbLabel ).x / 2 );
124 gl::rotate( -M_PI / 2 );
125 mTextureFont->drawString( dbLabel, vec2( 0 ) );
126 gl::popModelView();
127}
128
129void InputAnalyzer::printBinInfo( int mouseX )
130{

Callers

nothing calls this directly

Calls 12

getWindowCenterFunction · 0.85
getWindowHeightFunction · 0.85
pushModelViewFunction · 0.85
popModelViewFunction · 0.85
drawStringMethod · 0.80
measureStringMethod · 0.80
createFunction · 0.50
FontFunction · 0.50
colorFunction · 0.50
translateFunction · 0.50
rotateFunction · 0.50
getNameMethod · 0.45

Tested by

no test coverage detected