本文整理汇总了C++中ShutDown函数的典型用法代码示例。如果您正苦于以下问题:C++ ShutDown函数的具体用法?C++ ShutDown怎么用?C++ ShutDown使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ShutDown函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ShutDown
bool SINMOVIE::PrepareMovie(IDirectDraw* pDD, IDirectDrawSurface *pDDSurface, char* FName)
{
if (!Open(pDD,FName,&pMMStream)) return false;
if (FAILED(pMMStream->GetMediaStream(MSPID_PrimaryVideo, &pPrimaryVidStream)))
{
ShutDown();
return false;
};
if (FAILED(pPrimaryVidStream->QueryInterface(IID_IDirectDrawMediaStream, (void **)&pDDStream)))
{
ShutDown();
return false;
}
if (FAILED(pDDStream->CreateSample(NULL, NULL, 0, &pSample)))
{
ShutDown();
return false;
}
if (FAILED(pSample->GetSurface(&pSurface, &SRect)))
{
ShutDown();
return false;
}
if (FAILED(pMMStream->SetState(STREAMSTATE_RUN)))
{
ShutDown();
return false;
}
pMovieSurface=pDDSurface;
MovieState=1;
return true;
}
示例2: mainLoop
static _Noreturn void mainLoop()
{
uint32_t pad;
while (true) {
pad = InputWait();
if (pad & (BUTTON_DOWN | BUTTON_RIGHT | BUTTON_R1))
MenuNextSelection();
if (pad & (BUTTON_UP | BUTTON_LEFT | BUTTON_L1))
MenuPrevSelection();
if (pad & BUTTON_A) {
OpenAnimation();
MenuSelect();
}
if (pad & BUTTON_SELECT) {
fadeOut();
ShutDown(1); //shutdown
}
if (pad & BUTTON_START) {
fadeOut();
ShutDown(0); //reboot
}
MenuShow();
}
}
示例3: RenderStreamToSurface
bool SINMOVIE::RenderStreamToSurface()
{
if (KeyState(VK_RETURN)) { MovieState=2; ShutDown();return false; }
if (pSample->Update(0, NULL, NULL, 0) != S_OK) { MovieState=2; ShutDown(); return
false; }
pMovieSurface->Blt(&DRect, pSurface, &SRect, DDBLT_WAIT, NULL);
return true;
}
示例4: while
void SINMOVIE::RenderStreamToSurfaceAll()
{
while (1)
{
if (KeyState(VK_RETURN)) { MovieState=2; ShutDown(); return; }
if (pSample->Update(0, NULL, NULL, 0) != S_OK) { MovieState=2; ShutDown(); return; }
pMovieSurface->Blt(&DRect, pSurface, &SRect, DDBLT_WAIT, NULL);
}
}
示例5: IVS_LOG
int CConnection::InitMulticast(const std::string& strRemoteSendStreamIp,
unsigned int uRemoteSendStreamPort,
const std::string& strLocalRecvStreamIp)
{
//增加组播端口复用,复用选项必须在绑定之前设置
//TODO为降低圈复杂度,此处未记录设置端口复用是否成功
int isReusable = TRUE;
if (::setsockopt(m_socket, SOL_SOCKET, SO_REUSEADDR, (char *)&isReusable, sizeof(isReusable)) == SOCKET_ERROR)
{
IVS_LOG(IVS_LOG_ERR, "Init Multicast",
"Set Multicast Port Reusable error, error code:%d", WSAGetLastError());
ShutDown();
return IVS_FAIL;
}
// 初始化多播地址;
struct ip_mreq mreq;
memset(&mreq, 0, sizeof(mreq));
//多播地址;
mreq.imr_multiaddr.s_addr = inet_addr(strRemoteSendStreamIp.c_str());
mreq.imr_interface.s_addr = inet_addr(strLocalRecvStreamIp.c_str());
if (::setsockopt(m_socket, IPPROTO_IP, IP_ADD_MEMBERSHIP, (const char*)&mreq, sizeof(mreq)) == SOCKET_ERROR)
{
IVS_LOG(IVS_LOG_ERR, "Init Multicast",
"Get Multicast Port error, add multicast group failed, error code:%d", WSAGetLastError());
ShutDown();
return IVS_FAIL;
}
//将视频Socket缓存设置为1MByte 满足高清视频
int iRecvBuf = IVS_PLAYER_RTP_MAX_SOCKET_BUFFER;
int iOptLen = sizeof(iRecvBuf);
if (::setsockopt(m_socket, SOL_SOCKET, SO_RCVBUF, (char*)&iRecvBuf, iOptLen) == SOCKET_ERROR)
{
IVS_LOG(IVS_LOG_ERR, "Init Multicast",
"Get Multicast Port error, set receive buffer size=%d failed, error code:%d", iRecvBuf, errno);
}
else
{
iRecvBuf = 0;
(void)getsockopt(m_socket, SOL_SOCKET, SO_RCVBUF, (char*)&iRecvBuf, &iOptLen);
IVS_LOG(IVS_LOG_DEBUG, "Init Multicast",
"Get Multicast Port success, set receive buffer size=%d", iRecvBuf);
}
return IVS_SUCCEED;
}//lint !e715
示例6: ShutDown
bool eae6320::Graphics::Initialize( const HWND i_renderingWindow )
{
if (!Context::Initialize(i_renderingWindow))
goto OnError;
s_FrameRate.Create(eae6320::Time::GetFrameRate(), "Frame Rate");
s_PlayerScore.Create(teamScore, "Score");
s_EnemyScore.Create(enemyScore, "Score");
eae6320::Graphics::DebugMenu::CreateDebugMenuFont();
m_StaminaSprite.CreateTexture("data/Stamina.material", 0.9f, 1.0f, 1.0f, 0.0f, 1.0f, 1.0f);
// Create the renderables
if (!CreateRenderables())
goto OnError;
if (!CreateCamera())
goto OnError;
return true;
OnError:
ShutDown();
return false;
}
示例7: ShutDown
Worker::~Worker()
{
ShutDown();
if (fWorkerThread >= 0)
wait_for_thread(fWorkerThread, NULL);
}
示例8: main
int main(int argc, char *argv[])
{
ESContext esContext;
UserData userData;
//==========================================================
// Init GLES Context
//==========================================================
esInitContext ( &esContext );
esContext.userData = &userData;
esCreateWindow ( &esContext, "Model 3D Render", 640, 480, ES_WINDOW_ALPHA | ES_WINDOW_DEPTH);
if ( !Init ( &esContext ) )
return 0;
esRegisterDrawFunc ( &esContext, Draw );
esRegisterUpdateFunc ( &esContext, Update );
esMainLoop ( &esContext );
ShutDown ( &esContext );
return 1;
}
示例9: ShutDown
void InputMonitor::Init(VideoOutputDevice* videoout, AudioOutputDevice* audioout) {
ShutDown(); // Shut down devices and set them to NULL
InnerSetVideoIn(m_Data->m_VID);
InnerSetVideoOut(videoout);
InnerSetAudioOut(audioout);
AVController::Init();
}
示例10: ShutDown
bool eae6320::Graphics::Initialize( const HWND i_renderingWindow )
{
s_renderingWindow = i_renderingWindow;
// Create an OpenGL rendering context
if ( !CreateRenderingContext() )
{
goto OnError;
}
// Load any required OpenGL extensions
{
std::string errorMessage;
if ( !OpenGlExtensions::Load( &errorMessage ) )
{
UserOutput::Print( errorMessage );
goto OnError;
}
}
if (!LoadObjects())
{
goto OnError;
}
return true;
OnError:
ShutDown();
return false;
}
示例11: ProcessCommand
LRESULT CALLBACK ProcessCommand( WPARAM wParam )
{
switch ( wParam )
{
case IDM_FILE_OPEN:
OnFileOpen( );
break;
case IDM_FILE_SAVE:
break;
case IDM_FILE_EXIT:
ShutDown();
break;
case IDM_TOOLS_MOVE:
//g_pDisplayWidget->SetState( DWS_MOVE );
break;
case IDM_TOOLS_ZOOM:
//g_pDisplayWidget->SetState( DWS_ZOOM );
break;
case ID_GEODESICMATTING_FORE:
break;
case ID_GEODESICMATTING_BACK:
break;
case ID_GEODESICMATTING_DONE:
break;
default:
break;
}
return 0;
}
示例12: doRpcCall
void doRpcCall()
{
char buff[1024];
RpcTryExcept
{
while (1)
{
printf("Please input a string param for RPC call:\n");
gets(buff);
if ( strcmp(buff, "exit") == 0 || strcmp(buff, "quit") == 0 )
{
ShutDown();
break;
}
else
{
HelloProc( (unsigned char *)buff );
printf("RPC call <HelloProc> succeed!\n");
}
}
}
RpcExcept(1)
{
/*
unsigned long ulCode = RpcExceptionCode();
printf("RPC exception occured! code: %ld\n", ulCode);
*/
}
RpcEndExcept
}
示例13: ShutDown
CClientWizard::~CClientWizard()
{
ShutDown();
DeleteCriticalSection(&m_csHostList);
DeleteCriticalSection(&m_csDecomposer);
}
示例14: _tmain
int _tmain(int argc, char* argv[])
{
screenHeight = 600;
screenWidth = 800;
isFullScreen = false;
isAnimated = true;
gltSetWorkingDirectory(argv[0]);
glutInit(&argc,argv);
glutInitDisplayMode(GLUT_DEPTH | GLUT_DOUBLE | GLUT_RGB);
glutInitWindowSize(screenWidth,screenHeight);
glutCreateWindow("FBO Mirror");
glutReshapeFunc(Reshape);
glutDisplayFunc(Display);
glutSpecialFunc(SpecialKeys);
glutSpecialUpFunc(SpecialKeysUp);
Init();
glutMainLoop();
ShutDown();
return 0;
}
示例15: ExitProc
int ExitProc(int ccode,
char *str)
{
xcode code=(xcode)ccode;
printf("\n Exit -- %d : ",ccode);
switch (code) {
case OptFound:
printf("optimal solution found");
return code;
case OutOfSpc:
printf("out of memory space");
break;
default:
break;
}
if (str) printf(", %s",str);
ShutDown();
printf("\n Exiting -- ");
return 1;
} /* ExitProc */