本文整理汇总了C++中core::array::clear方法的典型用法代码示例。如果您正苦于以下问题:C++ array::clear方法的具体用法?C++ array::clear怎么用?C++ array::clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类core::array
的用法示例。
在下文中一共展示了array::clear方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: clear
void CSMFile::clear()
{
header.clear();
cameraData.clear();
u32 x =0;
for( x= 0; x < groups.size(); x++)
delete groups[x];
groups.clear();
for(x= 0; x < visgroups.size(); x++)
delete visgroups[x];
visgroups.clear();
for(x= 0; x < lightmaps.size(); x++)
delete lightmaps[x];
lightmaps.clear();
for(x= 0; x < meshes.size(); x++)
delete meshes[x];
meshes.clear();
for(x= 0; x < entities.size(); x++)
delete entities[x];
entities.clear();
}
示例2: clear
void Surface::clear()
{
flags = 0;
lightMapId = 0;
textureName = "";
uvOffset.set(0.0f,0.0f);
uvScale.set(0.0f,0.0f);
uvRotation = 0.0f;
triangles.clear();
lines.clear();
vertices.clear();
}
示例3: sizeof
bool CIrrDeviceWin32::activateJoysticks(core::array<SJoystickInfo> & joystickInfo)
{
#if defined _IRR_COMPILE_WITH_JOYSTICK_EVENTS_
joystickInfo.clear();
ActiveJoysticks.clear();
const u32 numberOfJoysticks = ::joyGetNumDevs();
JOYINFOEX info;
info.dwSize = sizeof(info);
info.dwFlags = JOY_RETURNALL;
JoystickInfo activeJoystick;
SJoystickInfo returnInfo;
joystickInfo.reallocate(numberOfJoysticks);
ActiveJoysticks.reallocate(numberOfJoysticks);
u32 joystick = 0;
for(; joystick < numberOfJoysticks; ++joystick)
{
if(JOYERR_NOERROR == joyGetPosEx(joystick, &info)
&&
JOYERR_NOERROR == joyGetDevCaps(joystick,
&activeJoystick.Caps,
sizeof(activeJoystick.Caps)))
{
activeJoystick.Index = joystick;
ActiveJoysticks.push_back(activeJoystick);
returnInfo.Joystick = (u8)joystick;
returnInfo.Axes = activeJoystick.Caps.wNumAxes;
returnInfo.Buttons = activeJoystick.Caps.wNumButtons;
returnInfo.Name = activeJoystick.Caps.szPname;
returnInfo.PovHat = ((activeJoystick.Caps.wCaps & JOYCAPS_HASPOV) == JOYCAPS_HASPOV)
? SJoystickInfo::POV_HAT_PRESENT : SJoystickInfo::POV_HAT_ABSENT;
joystickInfo.push_back(returnInfo);
}
}
for(joystick = 0; joystick < joystickInfo.size(); ++joystick)
{
char logString[256];
(void)sprintf(logString, "Found joystick %d, %d axes, %d buttons '%s'",
joystick, joystickInfo[joystick].Axes,
joystickInfo[joystick].Buttons, joystickInfo[joystick].Name.c_str());
os::Printer::log(logString, ELL_INFORMATION);
}
return true;
#else
return false;
#endif // _IRR_COMPILE_WITH_JOYSTICK_EVENTS_
}
示例4: activateJoysticks
//! Activate any joysticks, and generate events for them.
bool CIrrDeviceSDL::activateJoysticks(core::array<SJoystickInfo> & joystickInfo)
{
#if defined(_IRR_COMPILE_WITH_JOYSTICK_EVENTS_)
joystickInfo.clear();
// we can name up to 256 different joysticks
const int numJoysticks = core::min_(SDL_NumJoysticks(), 256);
Joysticks.reallocate(numJoysticks);
joystickInfo.reallocate(numJoysticks);
int joystick = 0;
for (; joystick<numJoysticks; ++joystick)
{
Joysticks.push_back(SDL_JoystickOpen(joystick));
SJoystickInfo info;
info.Joystick = joystick;
info.Axes = SDL_JoystickNumAxes(Joysticks[joystick]);
info.Buttons = SDL_JoystickNumButtons(Joysticks[joystick]);
info.Name = SDL_JoystickName(joystick);
info.PovHat = (SDL_JoystickNumHats(Joysticks[joystick]) > 0)
? SJoystickInfo::POV_HAT_PRESENT : SJoystickInfo::POV_HAT_ABSENT;
joystickInfo.push_back(info);
}
for(joystick = 0; joystick < (int)joystickInfo.size(); ++joystick)
{
char logString[256];
(void)sprintf(logString, "Found joystick %d, %d axes, %d buttons '%s'",
joystick, joystickInfo[joystick].Axes,
joystickInfo[joystick].Buttons, joystickInfo[joystick].Name.c_str());
os::Printer::log(logString, ELL_INFORMATION);
}
return true;
#endif // _IRR_COMPILE_WITH_JOYSTICK_EVENTS_
return false;
}