当前位置: 首页>>代码示例>>C++>>正文


C++ InitApp函数代码示例

本文整理汇总了C++中InitApp函数的典型用法代码示例。如果您正苦于以下问题:C++ InitApp函数的具体用法?C++ InitApp怎么用?C++ InitApp使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了InitApp函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: wWinMain

//--------------------------------------------------------------------------------------
// Entry point to the program. Initializes everything and goes into a message processing 
// loop. Idle time is used to render the scene.
//--------------------------------------------------------------------------------------
int WINAPI wWinMain(HINSTANCE /*hInstance*/, HINSTANCE /*hPrevInstance*/, LPWSTR /*lpCmdLine*/, int /*nCmdShow*/)
{
    // Enable run-time memory check for debug builds.
#if defined(DEBUG) | defined(_DEBUG)
    _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
#endif

    // Disable gamma correction on this sample
    DXUTSetIsInGammaCorrectMode(false);

    DXUTSetCallbackDeviceChanging(ModifyDeviceSettings);
    DXUTSetCallbackMsgProc(MsgProc);
    DXUTSetCallbackFrameMove(OnFrameMove);

    DXUTSetCallbackD3D11DeviceAcceptable(IsD3D11DeviceAcceptable);
    DXUTSetCallbackD3D11DeviceCreated(OnD3D11CreateDevice);
    DXUTSetCallbackD3D11SwapChainResized(OnD3D11ResizedSwapChain);
    DXUTSetCallbackD3D11FrameRender(OnD3D11FrameRender);
    DXUTSetCallbackD3D11SwapChainReleasing(OnD3D11ReleasingSwapChain);
    DXUTSetCallbackD3D11DeviceDestroyed(OnD3D11DestroyDevice);

    InitApp();

    // Force create a ref device so that feature level D3D_FEATURE_LEVEL_11_0 is guaranteed
    DXUTInit(true, true, NULL); // Parse the command line, show msgboxes on error
    DXUTSetCursorSettings(true, true); // Show the cursor and clip it when in full screen
    DXUTCreateWindow(L"OIT11");
    DXUTCreateDevice(D3D_FEATURE_LEVEL_11_0, true, g_nFrameWidth, g_nFrameHeight);
    DXUTMainLoop(); // Enter into the DXUT render loop

    return DXUTGetExitCode();
}
开发者ID:marselas,项目名称:Zombie-Direct3D-Samples,代码行数:36,代码来源:main.cpp

示例2: WinMain

int WINAPI WinMain(HINSTANCE hCurInst, HINSTANCE hPrevInst,
                   LPSTR lpsCmdLine, int nCmdShow)
{
    MSG msg;
    BOOL bRet;
    HACCEL hAccel;                      // アクセラレータハンドル

    if (!InitApp(hCurInst))
        return FALSE;
    if (!InitInstance(hCurInst, nCmdShow))
        return FALSE;

    // アクセラレータテーブルを読み込む
    hAccel = LoadAccelerators(hCurInst, TEXT("MYACCEL"));

    while ((bRet = GetMessage(&msg, NULL, 0, 0)) != 0) {
        if (bRet == -1) {
            break;
        } else {
            if (!TranslateAccelerator(hParent, hAccel, &msg)) {
                TranslateMessage(&msg);
                DispatchMessage(&msg);
            }
        }
    }
    return (int)msg.wParam;
}
开发者ID:tomorrow56,项目名称:VS2010,代码行数:27,代码来源:menu02.cpp

示例3: main

int16_t main(void)
{
    // Initialize IO ports and peripherals.
    ConfigureOscillator();
    InitApp();
    InitAdc();
    AtpInit();
    odo_init(); // TODO
    motion_init(SendDone);

    SendBoardId();
    __delay_ms(3000);
    SendBoardId();


    while(1) {
        //SendBoardId();

        if (odoBroadcast) {
            OnGetPos();
        }

        __delay_ms(odoDelay);

    }
}
开发者ID:7Robot,项目名称:ATP,代码行数:26,代码来源:main.c

示例4: main

void main(void)
{
    /* Configure the oscillator for the device */
    ConfigureOscillator();

    /* Initialize I/O and Peripherals for application */
    InitApp();
    
    /* everything is an output */
    TRISIO = 0;
    
    /* turn off all pins */
    GPIO = 0x00000000;

    while(1)
    {
        __delay_ms(100);
    
        /* turn on GPIO pin 2 */
        GPIO = 0b00000100;
        
        __delay_ms(100);
    
        /* turn off GPIO pin 2 */
        GPIO = 0b00000000;
    }

}
开发者ID:camswords,项目名称:pic-blink-led,代码行数:28,代码来源:main.c

示例5: main

void main(void)
{
    /* Configure the oscillator for the device */
    ConfigureOscillator();

    /* Initialize I/O and Peripherals for application */
    InitApp();
    InitSPI();
    InitInterrupts();

    LCD_Init();

    RF_ConfigReceiver();
    LCD_WriteFirstLine("NRF Initialized");
//    LCD_Write();

    
    while(1)
    {
        if(RF_ReceiveFlag == 1){
            RF_ResetReceiver();
            if(RF_ReceiveBuffer[0] == 0x01){
                ToggleLED_B7();
                LCD_WriteFirstLine("Receive Action:");
                LCD_WriteSecondLine("L-Button Pressed");
            }

            else if(RF_ReceiveBuffer[0] == 0x02){
                ToggleLED_B7();
                LCD_WriteFirstLine("Receive Action:");
                LCD_WriteSecondLine("R-Button Pressed");
            }
        }
    }
}
开发者ID:RonMar89,项目名称:pic18_LF25K50_LCD.X,代码行数:35,代码来源:main.c

示例6: WinMain

//--------------------------------------------------------------------------------------
// Entry point to the program. Initializes everything and goes into a message processing 
// loop. Idle time is used to render the scene.
//--------------------------------------------------------------------------------------
INT WINAPI WinMain( HINSTANCE, HINSTANCE, LPSTR, int )
{
    // Enable run-time memory check for debug builds.
#if defined(DEBUG) | defined(_DEBUG)
    _CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
#endif

    // DXUT will create and use the best device (either D3D9 or D3D10) 
    // that is available on the system depending on which D3D callbacks are set below

    // Set DXUT callbacks
    DXUTSetCallbackDeviceChanging( ModifyDeviceSettings );
    DXUTSetCallbackMsgProc( MsgProc );
    DXUTSetCallbackKeyboard( KeyboardProc );
    DXUTSetCallbackFrameMove( OnFrameMove );
    DXUTSetCallbackD3D10DeviceAcceptable( IsD3D10DeviceAcceptable );
    DXUTSetCallbackD3D10DeviceCreated( OnD3D10CreateDevice );
    DXUTSetCallbackD3D10SwapChainResized( OnD3D10SwapChainResized );
    DXUTSetCallbackD3D10SwapChainReleasing( OnD3D10ReleasingSwapChain );
    DXUTSetCallbackD3D10DeviceDestroyed( OnD3D10DestroyDevice );
    DXUTSetCallbackD3D10FrameRender( OnD3D10FrameRender );

    InitApp();
    DXUTInit( true, true, NULL ); // Parse the command line, show msgboxes on error, no extra command line params
    DXUTSetCursorSettings( true, true ); // Show the cursor and clip it when in full screen
    DXUTCreateWindow( L"D3D10 Shader Model 4.0 Workshop: Exercise03" );
    DXUTCreateDevice( true, 800, 600 );
    DXUTMainLoop(); // Enter into the DXUT render loop

    return DXUTGetExitCode();
}
开发者ID:KNeal,项目名称:Oculus,代码行数:35,代码来源:Exercise03.cpp

示例7: wWinMain

//--------------------------------------------------------------------------------------
// Entry point to the program. Initializes everything and goes into a message processing 
// loop. Idle time is used to render the scene.
//--------------------------------------------------------------------------------------
int WINAPI wWinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow )
{
    // Enable run-time memory check for debug builds.
#if defined(DEBUG) | defined(_DEBUG)
    _CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
#endif

    // DXUT will create and use the best device (either D3D9 or D3D11) 
    // that is available on the system depending on which D3D callbacks are set below

    // Set DXUT callbacks
    DXUTSetCallbackDeviceChanging( ModifyDeviceSettings );
    DXUTSetCallbackMsgProc( MsgProc );
    DXUTSetCallbackKeyboard( OnKeyboard );
    DXUTSetCallbackFrameMove( OnFrameMove );

    DXUTSetCallbackD3D11DeviceAcceptable( IsD3D11DeviceAcceptable );
    DXUTSetCallbackD3D11DeviceCreated( OnD3D11CreateDevice );
    DXUTSetCallbackD3D11SwapChainResized( OnD3D11ResizedSwapChain );
    DXUTSetCallbackD3D11FrameRender( OnD3D11FrameRender );
    DXUTSetCallbackD3D11SwapChainReleasing( OnD3D11ReleasingSwapChain );
    DXUTSetCallbackD3D11DeviceDestroyed( OnD3D11DestroyDevice );

    InitApp();
    DXUTInit( true, true, NULL ); // Parse the command line, show msgboxes on error, no extra command line params
    DXUTSetCursorSettings( true, true ); // Show the cursor and clip it when in full screen
    DXUTCreateWindow( L"BasicHLSL11" );
    DXUTCreateDevice (D3D_FEATURE_LEVEL_11_0, true, 800, 600 );
    //DXUTCreateDevice(true, 640, 480);
    DXUTMainLoop(); // Enter into the DXUT render loop

    return DXUTGetExitCode();
}
开发者ID:AlexKLM,项目名称:DX11-Shader-Language-Coursework,代码行数:37,代码来源:BasicHLSL11.cpp

示例8: main

int16_t main(void)
{

    /* Configure the oscillator for the device */
    ConfigureOscillator();

    /* Initialize IO ports and peripherals */
    InitApp();

    TRISBbits.TRISB1 = 0;
    TRISBbits.TRISB2 = 0;
    TRISAbits.TRISA2 = 0;

    LATBbits.LATB1=0;
    LATBbits.LATB2=0;
    LATAbits.LATA2=0;

   IPC0bits.T1IP = 5;	 //set interrupt priority

    PR1 = 32767;
    T1CONbits.TON = 1;
    T1CONbits.TCS = 1;
    T1CONbits.TCKPS = 0;

    IFS0bits.T1IF = 0;	 //reset interrupt flag
    IEC0bits.T1IE = 1;	 //turn on the timer1 interrupt
    while(1);
}
开发者ID:andyHa,项目名称:electronics,代码行数:28,代码来源:main.c

示例9: main

void main(void)
{
    /* Configure the oscillator for the device */
    ConfigureOscillator();

    /* Initialize I/O and Peripherals for application */
    InitApp();

    TRISA = 0x00; // If you use RA2 as an input without first setting it as an output, some charge lingers and the input reads high even if the pin is tied to ground. I have a theory as to why this happens but all I really know for sure is that setting it as output first seems to prevent the weird thing from happening.

    for (int x = 0; x < 5; x++) senderAddress [x] = 0x02;
    for (int x = 0; x < 5; x++) receiverAddress [x] = 0x01;

    
    uint8_t receivedMessage [9];

    //runTests();

    //loopReceivingTestMessage();
    loopSendingTestMessage();


    nerf_init (&TRISA, &LATA, &PORTA, &TRISB, &LATB, &PORTB, receiverAddress);

    while (true){
        nerf_receiveAndRespondToCommand();
    }
}
开发者ID:easlern,项目名称:nerf,代码行数:28,代码来源:main.c

示例10: main

void main(void) {
    int count;
    unsigned int adcValue = 0;
    unsigned int adcValueOld = 0;
    char buffer[16];

    ConfigureOscillator();
    InitApp();

    lcd_init();
    lcd_enable();
    lcd_cursor_off();
    lcd_test();
    lcd_pos(2, 1);
    while (1) {
        ConvertADC();
        while (BusyADC());
        adcValue = ReadADC();
        if (adcValue != adcValueOld) {
            lcd_clear();
            lcd_pos(1, 1);
            memset(&buffer[0], 0, sizeof(buffer));
            sprintf(&buffer[0], "Valor: %.4u %.3u%%", adcValue, (int)(((float)adcValue / 1024) * 100));
            lcd_write_buffer(buffer, strlen(buffer));
            adcValueOld = adcValue;
        }
        __delay_ms(20);
    }
}
开发者ID:alexandrebl,项目名称:MicrochipPIC,代码行数:29,代码来源:main.c

示例11: acrxEntryPoint

AcRx::AppRetCode 
acrxEntryPoint(AcRx::AppMsgCode msg, void* pkt)
{
	switch(msg)
	{
        case AcRx::kInitAppMsg:
			acrxUnlockApplication(pkt);
			acrxRegisterAppMDIAware(pkt);
			InitApp();
            break;
        case AcRx::kUnloadAppMsg:
			acedRegCmds->removeGroup(_T("DYNBLKAPP"));
			if (pPts)
			{
				ACRX_PROTOCOL_REACTOR_LIST_AT(AcDbBlockTableRecord::desc(), 
					AsdkInsertionPoints::desc())->removeReactor(pPts);
				delete pPts;
                pPts = NULL;
			}
            break;
        default:
            break;
    }
	return AcRx::kRetOK;
}
开发者ID:FengLuanShuangWu,项目名称:AutoCADPlugin-HeatSource,代码行数:25,代码来源:ProtocolReactors.cpp

示例12: wWinMain

//--------------------------------------------------------------------------------------
// Entry point to the program. Initializes everything and goes into a message processing 
// loop. Idle time is used to render the scene.
//--------------------------------------------------------------------------------------
int WINAPI wWinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, 
                     LPWSTR lpCmdLine, int nCmdShow )
{
    // Enable run-time memory check for debug builds.
#if defined(DEBUG) | defined(_DEBUG)
    _CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
#endif

    // Disable gamma correction on this sample
    DXUTSetIsInGammaCorrectMode( false );

    DXUTSetCallbackDeviceChanging( ModifyDeviceSettings );
    DXUTSetCallbackMsgProc( MsgProc );
    DXUTSetCallbackFrameMove( OnFrameMove );
    DXUTSetCallbackMouse( MouseProc );
    DXUTSetCallbackKeyboard( OnKeyboard );

    DXUTSetCallbackD3D11DeviceAcceptable( IsD3D11DeviceAcceptable );
    DXUTSetCallbackD3D11DeviceCreated( OnD3D11CreateDevice );
    DXUTSetCallbackD3D11SwapChainResized( OnD3D11ResizedSwapChain );
    DXUTSetCallbackD3D11FrameRender( OnD3D11FrameRender );
    DXUTSetCallbackD3D11SwapChainReleasing( OnD3D11ReleasingSwapChain );
    DXUTSetCallbackD3D11DeviceDestroyed( OnD3D11DestroyDevice );

    InitApp();
    
    DXUTInit( true, true );

    DXUTSetCursorSettings( true, true );// Show the cursor and clip when in full screen
    DXUTCreateWindow( L"Contact Hardening Shadows - Direct3D 11" );
    DXUTCreateDevice( D3D_FEATURE_LEVEL_11_0, true, 800, 600 );
    DXUTMainLoop();                         // Enter into the DXUT render loop

    return DXUTGetExitCode();
}
开发者ID:KNeal,项目名称:Oculus,代码行数:39,代码来源:ContactHardeningShadows11.cpp

示例13: wWinMain

// main 함수 임
INT WINAPI wWinMain( HINSTANCE, HINSTANCE, LPWSTR, int )
{
    // Enable run-time memory check for debug builds.
#if defined(DEBUG) | defined(_DEBUG)
    _CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
#endif

    DXUTSetCallbackD3D9DeviceCreated( OnCreateDevice );
    DXUTSetCallbackD3D9DeviceReset( OnResetDevice );
    DXUTSetCallbackD3D9FrameRender( OnFrameRender );
	
	//focus를 상실했을 때. 즉 창모드/전체화면 모드 변경시 처리 과정
    DXUTSetCallbackD3D9DeviceLost( OnLostDevice );
    DXUTSetCallbackD3D9DeviceDestroyed( OnDestroyDevice );
    DXUTSetCallbackMsgProc( MsgProc );

	//update 역할, 렌더 직전에 변경사항 적용하는 부분
	DXUTSetCallbackFrameMove( OnFrameMove );

	//조명 초기화
    InitApp();

	//키보드 단축키를 받아 처리하도록 하는 플래그 설정 함수
	DXUTSetHotkeyHandling( true, true, true );

    DXUTCreateWindow( L"BasicHLSL" );
    DXUTCreateDevice( true, 640, 480 );

	// main 무한 루프
	// 무한 루프 중 세팅되는 값들을 적용해 화면에 표시함
    DXUTMainLoop();


    return DXUTGetExitCode();
}
开发者ID:trizdreaming,项目名称:windowsGameProg_DirectXTutorial,代码行数:36,代码来源:BasicHLSL.cpp

示例14: WinMain

// ------------------------------------------------------------------------------------------
// WinMain
// ------------------------------------------------------------------------------------------
int PASCAL WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR lpCmdLine, int nCmdShow)
{
	MSG msg;

	if(!InitApp(hInst, nCmdShow))
        CDXError( NULL , "could not initialize CDX application" );

	while(1)
	{
		if(PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE))
		{
			if(!GetMessage(&msg, NULL, 0, 0 )) return msg.wParam;
			TranslateMessage(&msg); 
			DispatchMessage(&msg);
		}
		else if(bActive)
		{
            // clear screen
			Screen->GetBack()->Fill(0);

            // draw menu
			CurrentMenu->Draw(300, 150);

            // display back buffer
			Screen->Flip();
		}
		else WaitMessage();
	}
}
开发者ID:hyuntaeng,项目名称:CDX,代码行数:32,代码来源:ex12.cpp

示例15: wWinMain

//--------------------------------------------------------------------------------------
// Entry point to the program. Initializes everything and goes into a message processing 
// loop. Idle time is used to render the scene.
//--------------------------------------------------------------------------------------
INT WINAPI wWinMain( HINSTANCE, HINSTANCE, LPWSTR, int )
{
    // Enable run-time memory check for debug builds.
#if defined(DEBUG) | defined(_DEBUG)
    _CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
#endif

    // DXUT will create and use the best device (either D3D9 or D3D10) 
    // that is available on the system depending on which D3D callbacks are set below

    // Set DXUT callbacks
    DXUTSetCallbackD3D9DeviceAcceptable( IsDeviceAcceptable );
    DXUTSetCallbackD3D9DeviceCreated( OnCreateDevice );
    DXUTSetCallbackD3D9DeviceReset( OnResetDevice );
    DXUTSetCallbackD3D9FrameRender( OnFrameRender );
    DXUTSetCallbackD3D9DeviceLost( OnLostDevice );
    DXUTSetCallbackD3D9DeviceDestroyed( OnDestroyDevice );
    DXUTSetCallbackMsgProc( MsgProc );
    DXUTSetCallbackKeyboard( KeyboardProc );
    DXUTSetCallbackFrameMove( OnFrameMove );
    DXUTSetCallbackDeviceChanging( ModifyDeviceSettings );

    DXUTSetCursorSettings( true, true );
    InitApp();
    DXUTInit( true, true ); // Parse the command line and show msgboxes
    DXUTSetHotkeyHandling( true, true, true );
    DXUTCreateWindow( L"CompiledEffect" );
    DXUTCreateDevice( true, 640, 480 );
    DXUTMainLoop();

    return DXUTGetExitCode();
}
开发者ID:KNeal,项目名称:Oculus,代码行数:36,代码来源:CompiledEffect.cpp


注:本文中的InitApp函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。