本文整理匯總了C++中DeInit函數的典型用法代碼示例。如果您正苦於以下問題:C++ DeInit函數的具體用法?C++ DeInit怎麽用?C++ DeInit使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了DeInit函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: LOG_ERROR
OMX_ERRORTYPE TextSource::Init()
{
CPresult ret = 0;
ret = mPipe->Open(&mHandle, mUrl, CP_AccessRead);
if(ret != 0) {
LOG_ERROR("Can't open content: %s\n", mUrl);
return OMX_ErrorUndefined;
}
mBuffer = (OMX_U8*)FSL_MALLOC(mBufferSize);
if(mBuffer == NULL) {
DeInit();
return OMX_ErrorInsufficientResources;
}
mCache = (OMX_U8*)FSL_MALLOC(mCacheSize);
if(mCache == NULL) {
DeInit();
return OMX_ErrorInsufficientResources;
}
mCacheRead = mCacheFill = 0;
mOffset = 0;
return OMX_ErrorNone;
}
示例2: WinProc
LRESULT CALLBACK WinProc(HWND hWnd,UINT uMsg, WPARAM wParam, LPARAM lParam)
{
LONG lRet = 0;
PAINTSTRUCT ps;
switch (uMsg)
{
case WM_SIZE: // If the window is resized
if(!g_bFullScreen) // Do this only if we are NOT in full screen
{
SizeOpenGLScreen(LOWORD(lParam),HIWORD(lParam));// LoWord=Width, HiWord=Height
GetClientRect(hWnd, &g_rRect); // Get the window rectangle
}
break;
case WM_PAINT: // If we need to repaint the scene
BeginPaint(hWnd, &ps); // Init the paint struct
EndPaint(hWnd, &ps); // EndPaint, Clean up
break;
case WM_KEYDOWN:
if(wParam == VK_ESCAPE) DeInit(); // Quit if we pressed ESCAPE
break;
case WM_DESTROY: // If the window is destroyed
DeInit(); // Release memory and restore settings
break;
default: // Return by default
lRet = DefWindowProc (hWnd, uMsg, wParam, lParam);
break;
}
return lRet; // Return by default
}
示例3: DeInit
/**
* @brief
* Initializes the window connection
*/
void WindowConnection::Initialize(const DisplayMode *pDisplayMode, bool bFullscreen)
{
// De-init window
DeInit();
// Display mode information given?
if (pDisplayMode) {
// Just copy over the given information
m_sDisplayMode = *pDisplayMode;
} else {
// Use default settings
m_sDisplayMode.vSize = m_pWidget->GetSize();
m_sDisplayMode.nColorBits = 32;
m_sDisplayMode.nFrequency = 60;
}
// Initialize renderer surface handler
InitWidget(bFullscreen);
// Emit the initial events so other components can set their proper initial states
if (bFullscreen)
OnFullscreenMode();
else
OnDisplayMode();
}
示例4: PreInit
void CService::ServiceMainMember(DWORD argc, LPTSTR* argv, LPHANDLER_FUNCTION pf, LPTHREAD_START_ROUTINE pfnWTP)
{
DWORD dwErr = 0;
__try
{
PreInit();
SetupHandlerInside(pf);
LaunchWatcherThread(pfnWTP);
SetStatus(SERVICE_START_PENDING, 1, kDefaultWaitTime );
if ( NTService::InitializeService( _theService, _params, false ) == 0 )
{
SetStatus( SERVICE_RUNNING, 0, 0, SERVICE_ACCEPT_STOP );
_theService->start();
}
else
{
CERR << NTEXT("Error initializing service") << std::endl;
}
}
__except(dwErr = GetExceptionCode(), EXCEPTION_EXECUTE_HANDLER)
{
if(m_hServiceStatus)
SetStatus(SERVICE_STOPPED, 0, 0, 0, dwErr, 0);
}
DeInit();
SetStatus(SERVICE_STOPPED, 0, 0, 0, dwErr, 0);
}
示例5: DeInit
/***************************************************************************//**
* 函數名稱: SetAttribute
* 功能描述: 設置輸入輸出圖片屬性以及Scale算法。
* 參 數: srcFormat >> 源圖像格式;
* 參 數: dstFormat >> 目標圖像格式;
* 參 數: enAlogrithm >> Scale算法;
* 返 回 值:
* 其它說明:
* 修改日期 修改人 修改內容
* ------------------------------------------------------------------------------
* 2011-10-28 Cloud 創建
*******************************************************************************/
void CFFScale::SetAttribute(PicFormat srcFormat, PicFormat dstFormat, SwsAlogrithm enAlogrithm)
{
m_srcFormat = srcFormat;
m_dstFormat = dstFormat;
m_enAlogrithm = enAlogrithm;
DeInit();
}
示例6: SetCurrentOperation
VError DB4DJournalParser::SetEndOfJournal( uLONG8 inOperation )
{
VError error = VE_OK;
if ( fFileStream )
{
CDB4DJournalData *journalData = NULL;
error = SetCurrentOperation( inOperation, &journalData );
if ( journalData )
journalData->Release();
if ( error == VE_OK )
{
sLONG8 filePos = fFileStream->GetPos();
error = DeInit();
if ( error == VE_OK )
{
VFileDesc *fileDesc = NULL;
error = fLogFile->Open( FA_READ_WRITE, &fileDesc );
if ( error == VE_OK )
{
error = fileDesc->SetSize( filePos );
delete fileDesc;
}
if ( error == VE_OK )
fTotalOperationCount = fCurrentOperation;
}
}
}
else
{
error = VE_UNIMPLEMENTED; // not initialized
}
return error;
}
示例7: MainLoop
WPARAM MainLoop()
{
MSG msg;
while(1) // Do our infinate loop
{ // Check if there was a message
if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
{
if(msg.message == WM_QUIT) // If the message wasnt to quit
break;
TranslateMessage(&msg); // Find out what the message does
DispatchMessage(&msg); // Execute the message
}
else // if there wasn't a message
{
/////// * /////////// * /////////// * NEW * /////// * /////////// * /////////// *
g_Camera.Update(); // Update the camera data
/////// * /////////// * /////////// * NEW * /////// * /////////// * /////////// *
RenderScene(); // Update the screen every frame (Not good in a game)
}
}
DeInit(); // Clean up and free all allocated memory
return(msg.wParam); // Return from the program
}
示例8: WndProc
// Here is the WndProc that handles all the messages
LRESULT CALLBACK WndProc (HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
{
// Check which message was passed in
switch (iMsg)
{
// This message is sent when the window is created (CreateWindow())
case WM_CREATE:
// Create the double buffer and load the bitmaps
Init(hwnd);
break;
case WM_RBUTTONDOWN:
// By pressing the right mouse button you can switch animations
SetSpriteState(&gMonster, ++gMonster.state % 4);
break;
// This message is sent when the window is destroyed
case WM_DESTROY:
// Free all the data and set everything back to normal, then post the quit message
DeInit();
break;
}
// Process/handle the default messages
return DefWindowProc (hwnd, iMsg, wParam, lParam);
}
示例9: MainLoop
WPARAM MainLoop()
{
MSG msg;
while(1) // Do our infinite loop
{
// Check if there was a message
if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
{
if(msg.message == WM_QUIT) // If the message wasn't to quit
break;
TranslateMessage(&msg); // Find out what the message does
DispatchMessage(&msg); // Execute the message
}
else // If there wasn't a message
{
if(AnimateNextFrame(60)) // Make sure we only render 60 frames per second
{
RenderScene(); // Render the scene
}
}
}
DeInit(); // Clean up and free all allocated memory
return(msg.wParam); // Return from the program
}
示例10: OBJECTTEMPLATE
CMeshObject::CMeshObject(IHashString *parentName, IHashString *name) :
OBJECTTEMPLATE( CRenderManager, CMeshObject, IMeshObject, parentName, name )
{
//Not sure if we want to add to hierarchy
//AddToHierarchy();
DeInit();
}
示例11: AfxEnableControlContainer
BOOL CYTGetApp::InitInstance()
{
AfxEnableControlContainer();
// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need.
#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif
Init();
CMainDlg dlg;
m_pMainWnd = &dlg;
int nResponse = dlg.DoModal();
if (nResponse == IDOK)
{
// TODO: Place code here to handle when the dialog is
// dismissed with OK
}
else if (nResponse == IDCANCEL)
{
// TODO: Place code here to handle when the dialog is
// dismissed with Cancel
}
DeInit();
// Since the dialog has been closed, return FALSE so that we exit the
// application, rather than start the application's message pump.
return FALSE;
}
示例12: MainLoop
WPARAM MainLoop()
{
MSG msg;
while(1) // Do our infinite loop
{ // Check if there was a message
if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
{
if(msg.message == WM_QUIT) // If the message wasn't to quit
break;
TranslateMessage(&msg); // Find out what the message does
DispatchMessage(&msg); // Execute the message
}
else // if there wasn't a message
{
if(AnimateNextFrame(60)) // Make sure we only animate 60 FPS
{
g_Camera.Update(); // Update the camera information
RenderScene(); // Render the scene every frame
}
else
{
Sleep(1); // Let other processes work
}
}
}
DeInit(); // Clean up and free all allocated memory
return(msg.wParam); // Return from the program
}
示例13: MainLoop
WPARAM MainLoop()
{
MSG msg;
// This is where we load our accelerators for keyboard shortcuts
HACCEL hAccelTable = LoadAccelerators(g_hInstance, MAKEINTRESOURCE(IDR_ACCELERATOR1));
while(1) // Do our infinite loop
{ // Check if there was a message
if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
{
if(msg.message == WM_QUIT) // If the message wasn't to quit
break;
// Check if there was keyboard command - if not, process messages like normal
if(!TranslateAccelerator(g_hWnd, hAccelTable, &msg))
{
TranslateMessage(&msg); // Find out what the message does
DispatchMessage(&msg); // Execute the message
}
RenderScene(); // Since no animation, only render when the user does something
}
}
DeInit(); // Clean up and free all allocated memory
return(msg.wParam); // Return from the program
}
示例14: DeInit
void Replay::Init(bool rec)
{
DeInit();
is_recorder = rec;
replay_state = (rec) ? PAUSED_RECORD : PAUSED_PLAY;
}
示例15: MainLoop
WPARAM MainLoop()
{
MSG msg;
while(1) // Do our infinite loop
{ // Check if there was a message
if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
{
if(msg.message == WM_QUIT) // If the message wasn't to quit
break;
TranslateMessage(&msg); // Find out what the message does
DispatchMessage(&msg); // Execute the message
}
else // if there wasn't a message
{
// Render the scene every frame to update the rotating cube
RenderScene();
}
}
DestroyFont(); // This frees up our font display list
DeInit(); // Release memory and restore settings
return(msg.wParam); // Return from the program
}