本文整理汇总了C++中wxArrayPtrVoid::Count方法的典型用法代码示例。如果您正苦于以下问题:C++ wxArrayPtrVoid::Count方法的具体用法?C++ wxArrayPtrVoid::Count怎么用?C++ wxArrayPtrVoid::Count使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxArrayPtrVoid
的用法示例。
在下文中一共展示了wxArrayPtrVoid::Count方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DrawPolygonsTessellated
void ODDC::DrawPolygonsTessellated( int n, int npoints[], wxPoint points[], wxCoord xoffset, wxCoord yoffset )
{
if( dc ) {
int prev = 0;
for( int i = 0; i < n; i++ ) {
dc->DrawPolygon( npoints[i], &points[i + prev], xoffset, yoffset );
prev += npoints[i];
}
}
#ifdef ocpnUSE_GL
else {
GLUtesselator *tobj = gluNewTess();
gluTessCallback( tobj, GLU_TESS_VERTEX, (_GLUfuncptr) &ODDCvertexCallback );
gluTessCallback( tobj, GLU_TESS_BEGIN, (_GLUfuncptr) &ODDCbeginCallback );
gluTessCallback( tobj, GLU_TESS_END, (_GLUfuncptr) &ODDCendCallback );
gluTessCallback( tobj, GLU_TESS_COMBINE, (_GLUfuncptr) &ODDCcombineCallback );
gluTessCallback( tobj, GLU_TESS_ERROR, (_GLUfuncptr) &ODDCerrorCallback );
gluTessNormal( tobj, 0, 0, 1);
gluTessProperty(tobj, GLU_TESS_WINDING_RULE, GLU_TESS_WINDING_ODD);
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
gluTessProperty(tobj, GLU_TESS_BOUNDARY_ONLY, GL_FALSE);
if(glIsEnabled(GL_TEXTURE_2D)) g_bTexture2D = true;
else g_bTexture2D = false;
ConfigurePen();
if( ConfigureBrush() ) {
gluTessBeginPolygon(tobj, NULL);
int prev = 0;
for( int j = 0; j < n; j++ ) {
gluTessBeginContour(tobj);
for( int i = 0; i < npoints[j]; i++ ) {
GLvertex* vertex = new GLvertex();
gTesselatorVertices.Add( vertex );
vertex->info.x = (GLdouble) points[i + prev].x;
vertex->info.y = (GLdouble) points[i + prev].y;
vertex->info.z = (GLdouble) 0.0;
vertex->info.r = (GLdouble) 0.0;
vertex->info.g = (GLdouble) 0.0;
vertex->info.b = (GLdouble) 0.0;
vertex->info.a = (GLdouble) 0.0;
gluTessVertex( tobj, (GLdouble*)vertex, (GLdouble*)vertex );
}
gluTessEndContour( tobj );
prev += npoints[j];
}
gluTessEndPolygon(tobj);
}
gluDeleteTess(tobj);
for (unsigned int i = 0; i<gTesselatorVertices.Count(); i++)
delete (GLvertex*)gTesselatorVertices.Item(i);
gTesselatorVertices.Clear();
}
#endif
}
示例2: DrawPolygonTessellated
void ocpnDC::DrawPolygonTessellated( int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset )
{
if( dc )
dc->DrawPolygon( n, points, xoffset, yoffset );
#ifdef ocpnUSE_GL
else {
# ifndef ocpnUSE_GLES // tessalator in glues is broken
if( n < 5 )
# endif
{
DrawPolygon( n, points, xoffset, yoffset );
return;
}
glPushAttrib( GL_ENABLE_BIT | GL_COLOR_BUFFER_BIT | GL_LINE_BIT | GL_HINT_BIT | GL_POLYGON_BIT ); //Save state
SetGLAttrs( false );
static GLUtesselator *tobj = NULL;
if( ! tobj ) tobj = gluNewTess();
gluTessCallback( tobj, GLU_TESS_VERTEX, (_GLUfuncptr) &ocpnDCvertexCallback );
gluTessCallback( tobj, GLU_TESS_BEGIN, (_GLUfuncptr) &ocpnDCbeginCallback );
gluTessCallback( tobj, GLU_TESS_END, (_GLUfuncptr) &ocpnDCendCallback );
gluTessCallback( tobj, GLU_TESS_COMBINE, (_GLUfuncptr) &ocpnDCcombineCallback );
gluTessCallback( tobj, GLU_TESS_ERROR, (_GLUfuncptr) &ocpnDCerrorCallback );
gluTessNormal( tobj, 0, 0, 1);
gluTessProperty( tobj, GLU_TESS_WINDING_RULE, GLU_TESS_WINDING_NONZERO );
if( ConfigureBrush() ) {
gluTessBeginPolygon( tobj, NULL );
gluTessBeginContour( tobj );
for( int i = 0; i < n; i++ ) {
GLvertex* vertex = new GLvertex();
gTesselatorVertices.Add( vertex );
vertex->info.x = (GLdouble) points[i].x;
vertex->info.y = (GLdouble) points[i].y;
vertex->info.z = (GLdouble) 0.0;
vertex->info.r = (GLdouble) 0.0;
vertex->info.g = (GLdouble) 0.0;
vertex->info.b = (GLdouble) 0.0;
gluTessVertex( tobj, (GLdouble*)vertex, (GLdouble*)vertex );
}
gluTessEndContour( tobj );
gluTessEndPolygon( tobj );
}
glPopAttrib();
for( unsigned int i=0; i<gTesselatorVertices.Count(); i++ )
delete (GLvertex*)gTesselatorVertices.Item(i);
gTesselatorVertices.Clear();
}
#endif
}
示例3: MacGetCurrentThread
// static functions
// ----------------
wxThread *wxThread::This()
{
wxMacStCritical critical ;
ThreadID current ;
OSErr err ;
err = MacGetCurrentThread( ¤t ) ;
for ( size_t i = 0 ; i < s_threads.Count() ; ++i )
{
if ( ( (wxThread*) s_threads[i] )->GetId() == current )
return (wxThread*) s_threads[i] ;
}
wxLogSysError(_("Couldn't get the current thread pointer"));
return NULL;
}