本文整理汇总了C++中Clear函数的典型用法代码示例。如果您正苦于以下问题:C++ Clear函数的具体用法?C++ Clear怎么用?C++ Clear使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Clear函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Clear
DBManagerThreadData::DBManagerThreadData(void)
{
Clear();
}
示例2: Clear
CodeBook::~CodeBook()
{
Clear();
}
示例3: Clear
void ToDoListView::Parse()
{
// wxBusyCursor busy;
// based on user prefs, parse files for todo items
if (m_Ignore || (m_pPanel && !m_pPanel->IsShownOnScreen()) )
return; // Reentrancy
Clear();
m_ItemsMap.clear();
m_Items.Clear();
switch (m_pSource->GetSelection())
{
case 0: // current file only
{
// this is the easiest selection ;)
cbEditor* ed = Manager::Get()->GetEditorManager()->GetBuiltinEditor(Manager::Get()->GetEditorManager()->GetActiveEditor());
ParseEditor(ed);
break;
}
case 1: // open files
{
// easy too; parse all open editor files...
for (int i = 0; i < Manager::Get()->GetEditorManager()->GetEditorsCount(); ++i)
{
cbEditor* ed = Manager::Get()->GetEditorManager()->GetBuiltinEditor(Manager::Get()->GetEditorManager()->GetEditor(i));
ParseEditor(ed);
}
break;
}
case 2: // active target files
{
// loop all project files
// but be aware: if a file is opened, use the open file because
// it might not be the same on the disk...
cbProject* prj = Manager::Get()->GetProjectManager()->GetActiveProject();
if (!prj)
return;
ProjectBuildTarget *target = prj->GetBuildTarget(prj->GetActiveBuildTarget());
if (!target)
return;
wxProgressDialog pd(_T("Todo Plugin: Processing all files in the active target.."),
_T("Processing a target of a big project may take large amount of time.\n\n"
"Please be patient!\n"),
target->GetFilesCount(),
Manager::Get()->GetAppWindow(),
wxPD_AUTO_HIDE | wxPD_APP_MODAL | wxPD_CAN_ABORT);
int i = 0;
for (FilesList::iterator it = target->GetFilesList().begin();
it != target->GetFilesList().end();
++it)
{
ProjectFile* pf = *it;
wxString filename = pf->file.GetFullPath();
cbEditor* ed = Manager::Get()->GetEditorManager()->IsBuiltinOpen(filename);
if (ed)
ParseEditor(ed);
else
ParseFile(filename);
if (!pd.Update(i++))
{
break;
}
}
break;
}
case 3: // all project files
{
// loop all project files
// but be aware: if a file is opened, use the open file because
// it might not be the same on the disk...
cbProject* prj = Manager::Get()->GetProjectManager()->GetActiveProject();
if (!prj)
return;
wxProgressDialog pd(_T("Todo Plugin: Processing all files.."),
_T("Processing a big project may take large amount of time.\n\n"
"Please be patient!\n"),
prj->GetFilesCount(),
Manager::Get()->GetAppWindow(),
wxPD_AUTO_HIDE | wxPD_APP_MODAL | wxPD_CAN_ABORT);
int i = 0;
for (FilesList::iterator it = prj->GetFilesList().begin(); it != prj->GetFilesList().end(); ++it)
{
ProjectFile* pf = *it;
wxString filename = pf->file.GetFullPath();
cbEditor* ed = Manager::Get()->GetEditorManager()->IsBuiltinOpen(filename);
if (ed)
ParseEditor(ed);
else
ParseFile(filename);
if (!pd.Update(i++))
{
break;
}
}
break;
}
default:
break;
}
//.........这里部分代码省略.........
示例4: Clear
plFontCache::~plFontCache()
{
Clear();
fInstance = nil;
}
示例5: DebugMessage
//.........这里部分代码省略.........
EGL_display = eglGetDisplay((EGLNativeDisplayType) EGL_device);
if (EGL_display == EGL_NO_DISPLAY){
printf( "EGL Display Get failed: %s \n", EGLErrorString());
return FALSE;
}
if (!eglInitialize(EGL_display, &EGL_version_major, &EGL_version_minor)){
printf( "EGL Display Initialize failed: %s \n", EGLErrorString());
return FALSE;
}
if (!eglChooseConfig(EGL_display, ConfigAttribs, &EGL_config, 1, &nConfigs)){
printf( "EGL Configuration failed: %s \n", EGLErrorString());
return FALSE;
} else if (nConfigs != 1){
printf( "EGL Configuration failed: nconfig %i, %s \n", nConfigs, EGLErrorString());
return FALSE;
}
EGL_surface = eglCreateWindowSurface(EGL_display, EGL_config, EGL_handle, NULL);
if (EGL_surface == EGL_NO_SURFACE){
printf("EGL Surface Creation failed: %s will attempt without window... \n", EGLErrorString());
EGL_surface = eglCreateWindowSurface(EGL_display, EGL_config, NULL, NULL);
if (EGL_surface == EGL_NO_SURFACE){
printf( "EGL Surface Creation failed: %s \n", EGLErrorString());
return FALSE;
}
}
eglBindAPI(EGL_OPENGL_ES_API);
EGL_context = eglCreateContext(EGL_display, EGL_config, EGL_NO_CONTEXT, ContextAttribs);
if (EGL_context == EGL_NO_CONTEXT){
printf( "EGL Context Creation failed: %s \n", EGLErrorString());
return FALSE;
}
if (!eglMakeCurrent(EGL_display, EGL_surface, EGL_surface, EGL_context)){
printf( "EGL Make Current failed: %s \n", EGLErrorString());
return FALSE;
};
eglSwapInterval(EGL_display, 1);
*/
#ifdef USE_SDL
//// paulscode, added for switching between RGBA8888 and RGB565
// (part of the color banding fix)
int bitsPP;
if( Android_JNI_UseRGBA8888() )
bitsPP = 32;
else
bitsPP = 16;
/* Set the video mode */
SDL_Surface* hScreen;
printf( "Setting video mode %dx%d...\n", windowSetting.uDisplayWidth, windowSetting.uDisplayHeight );
// TODO: I should actually check what the pixelformat is, rather than assuming 16 bpp (RGB_565) or 32 bpp (RGBA_8888):
// if (!(hScreen = SDL_SetVideoMode( windowSetting.uDisplayWidth, windowSetting.uDisplayHeight, 16, SDL_HWSURFACE )))
if (!(hScreen = SDL_SetVideoMode( windowSetting.uDisplayWidth, windowSetting.uDisplayHeight, bitsPP, SDL_HWSURFACE )))
{
printf( "Problem setting videomode %dx%d: %s\n", windowSetting.uDisplayWidth, windowSetting.uDisplayHeight, SDL_GetError() );
SDL_QuitSubSystem( SDL_INIT_VIDEO );
return false;
}
#endif
InitState();
InitOGLExtension();
sprintf(m_strDeviceStats, "%.60s - %.128s : %.60s", m_pVendorStr, m_pRenderStr, m_pVersionStr);
TRACE0(m_strDeviceStats);
DebugMessage(M64MSG_INFO, "Using OpenGL: %s", m_strDeviceStats);
GLint precision,range;
glGetShaderPrecisionFormat(GL_VERTEX_SHADER,GL_LOW_FLOAT,&precision,&range);
DebugMessage(M64MSG_INFO,"GLSL Vertex Shader lowp precision:%i range:%i",precision,range);
glGetShaderPrecisionFormat(GL_VERTEX_SHADER,GL_MEDIUM_FLOAT,&precision,&range);
DebugMessage(M64MSG_INFO,"GLSL Vertex Shader mediump precision:%i range:%i",precision,range);
glGetShaderPrecisionFormat(GL_VERTEX_SHADER,GL_HIGH_FLOAT,&precision,&range);
DebugMessage(M64MSG_INFO,"GLSL Vertex Shader highp precision:%i range:%i",precision,range);
glGetShaderPrecisionFormat(GL_FRAGMENT_SHADER ,GL_LOW_FLOAT,&precision,&range);
DebugMessage(M64MSG_INFO,"GLSL Fragment Shader lowp precision:%i range:%i",precision,range);
glGetShaderPrecisionFormat(GL_FRAGMENT_SHADER,GL_MEDIUM_FLOAT,&precision,&range);
DebugMessage(M64MSG_INFO,"GLSL Fragment Shader mediump precision:%i range:%i",precision,range);
glGetShaderPrecisionFormat(GL_FRAGMENT_SHADER,GL_HIGH_FLOAT,&precision,&range);
DebugMessage(M64MSG_INFO,"GLSL Fragment Shader highp precision:%i range:%i",precision,range);
Unlock();
Clear(CLEAR_COLOR_AND_DEPTH_BUFFER); // Clear buffers
UpdateFrame();
Clear(CLEAR_COLOR_AND_DEPTH_BUFFER);
UpdateFrame();
m_bReady = true;
status.isVertexShaderEnabled = false;
return true;
}
示例6: Clear
void ShaderManagerVulkan::ClearShaders() {
Clear();
DirtyShader();
gstate_c.Dirty(DIRTY_ALL_UNIFORMS | DIRTY_VERTEXSHADER_STATE | DIRTY_FRAGMENTSHADER_STATE);
}
示例7: Clear
/**
* name: MAnnivDate
* class: MAnnivDate
* desc: default constructor
* param: none
* return: nothing
**/
MAnnivDate::MAnnivDate()
{
Clear();
}
示例8: Clear
TextEventDispatcher::PendingComposition::PendingComposition()
{
Clear();
}
示例9: Clear
TiXmlComment& TiXmlComment::operator=( const TiXmlComment& base )
{
Clear();
base.CopyTo( this );
return *this;
}
示例10: Clear
virtual ~Grid_Array (void) { Clear (); }
示例11: Clear
cPrefabPiecePool::~cPrefabPiecePool()
{
Clear();
}
示例12: Clear
CLevel::~CLevel( )
{
Clear( );
}
示例13: Clear
void CInsideSocket::Reset()
{
m_nSocketAttr = enmSocketAttr_Inside;
Clear();
}
示例14: LOGWARNING
bool cBlockArea::Read(cWorld * a_World, int a_MinBlockX, int a_MaxBlockX, int a_MinBlockY, int a_MaxBlockY, int a_MinBlockZ, int a_MaxBlockZ, int a_DataTypes)
{
// Normalize the coords:
if (a_MinBlockX > a_MaxBlockX)
{
std::swap(a_MinBlockX, a_MaxBlockX);
}
if (a_MinBlockY > a_MaxBlockY)
{
std::swap(a_MinBlockY, a_MaxBlockY);
}
if (a_MinBlockZ > a_MaxBlockZ)
{
std::swap(a_MinBlockZ, a_MaxBlockZ);
}
// Include the Max coords:
a_MaxBlockX += 1;
a_MaxBlockY += 1;
a_MaxBlockZ += 1;
// Check coords validity:
if (a_MinBlockY < 0)
{
LOGWARNING("%s: MinBlockY less than zero, adjusting to zero", __FUNCTION__);
a_MinBlockY = 0;
}
else if (a_MinBlockY >= cChunkDef::Height)
{
LOGWARNING("%s: MinBlockY more than chunk height, adjusting to chunk height", __FUNCTION__);
a_MinBlockY = cChunkDef::Height - 1;
}
if (a_MaxBlockY < 0)
{
LOGWARNING("%s: MaxBlockY less than zero, adjusting to zero", __FUNCTION__);
a_MaxBlockY = 0;
}
else if (a_MaxBlockY >= cChunkDef::Height)
{
LOGWARNING("%s: MaxBlockY more than chunk height, adjusting to chunk height", __FUNCTION__);
a_MaxBlockY = cChunkDef::Height - 1;
}
// Allocate the needed memory:
Clear();
if (!SetSize(a_MaxBlockX - a_MinBlockX, a_MaxBlockY - a_MinBlockY, a_MaxBlockZ - a_MinBlockZ, a_DataTypes))
{
return false;
}
m_OriginX = a_MinBlockX;
m_OriginY = a_MinBlockY;
m_OriginZ = a_MinBlockZ;
cChunkReader Reader(*this);
// Convert block coords to chunks coords:
int MinChunkX, MaxChunkX;
int MinChunkZ, MaxChunkZ;
cChunkDef::AbsoluteToRelative(a_MinBlockX, a_MinBlockY, a_MinBlockZ, MinChunkX, MinChunkZ);
cChunkDef::AbsoluteToRelative(a_MaxBlockX, a_MaxBlockY, a_MaxBlockZ, MaxChunkX, MaxChunkZ);
// Query block data:
if (!a_World->ForEachChunkInRect(MinChunkX, MaxChunkX, MinChunkZ, MaxChunkZ, Reader))
{
Clear();
return false;
}
return true;
}