本文整理汇总了C++中History::getVal方法的典型用法代码示例。如果您正苦于以下问题:C++ History::getVal方法的具体用法?C++ History::getVal怎么用?C++ History::getVal使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类History
的用法示例。
在下文中一共展示了History::getVal方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: render
void render() {
int i;
if( changeMon.hasChanged() ) {
cheReactionReset();
}
glScalef( 1.f/DIMX, 1.f/DIMX, 1.f );
glTranslatef( -DIMX/2.f, -DIMY/2.f, 0.f );
zviewpointSetupView();
zprofBeg( band_update );
for( i=0; i<Band_updates; i++ ) {
partUpdate();
cheReactionUpdate();
}
zprofEnd();
Band_avgZHits = (float)zReactHits / (float)framesSinceLastReset;
zprofBeg( band_render );
glPointSize( Band_pointSize );
glVertexPointer( 2, GL_INT, sizeof(Part), &part[0].pos );
glEnableClientState( GL_VERTEX_ARRAY );
glColorPointer( 3, GL_UNSIGNED_BYTE, sizeof(Part), &part[0].color );
glEnableClientState( GL_COLOR_ARRAY );
glDrawArrays( GL_POINTS, 0, partCount );
glColor3ub( 100, 100, 100 );
glBegin( GL_LINES );
float cntf = (float)spatialHistogramCount;
for( int x=0; x<DIMX; x++ ) {
glVertex2f( (float)x, 0.f );
glVertex2f( (float)x, Band_histogramScale * (float)spatialHistogram[x] / cntf );
}
glEnd();
glTranslatef( 0.f, -22, 0.f );
glBegin( GL_LINES );
glColor3ub( 255, 255, 255 );
glVertex2f( 0.f, 0.f );
glVertex2f( Band_plotScaleX * (float)inputHistory.size, 0.f );
glColor3ub( 50, 255, 50 );
glVertex2f( 0.f, Band_plotScaleY0 * Band_signalTop );
glVertex2f( Band_plotScaleX * (float)inputHistory.size, Band_plotScaleY0 * Band_signalTop );
glEnd();
glColor3ub( 100, 255, 100 );
glBegin( GL_LINE_STRIP );
for( i=0; i<inputHistory.size-1; i++ ) {
glVertex2f( Band_plotScaleX * (float)i, Band_plotScaleY0 * inputHistory.getVal(i) );
}
glEnd();
glColor3ub( 100, 100, 255 );
glBegin( GL_LINE_STRIP );
for( i=0; i<inputHistory.size-1; i++ ) {
glVertex2f( Band_plotScaleX * (float)i, Band_plotScaleY1 * outputHistory.getAvg(i) );
}
glEnd();
// DRAW the power spectrum
glTranslatef( 0.f, -22, 0.f );
glBegin( GL_LINES );
glColor3ub( 255, 255, 255 );
glVertex2f( 0.f, 0.f );
glVertex2f( Band_plotFFTScaleX * (float)fftBufSize/2.f, 0.f );
glEnd();
glColor3ub( 200, 200, 50 );
glBegin( GL_LINE_STRIP );
for( i=1; i<fftBufSize/2-1; i++ ) {
glVertex2f( Band_plotFFTScaleX * (float)i, Band_plotFFTScaleY * cumPowerSpectrumLog[i] );
}
glEnd();
zprofEnd();
}