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


C++ Activate函数代码示例

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


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

示例1: sizeof

//============================================================================
//    IMPLEMENTATION PRIVATE FUNCTION PROTOTYPES
//============================================================================
//============================================================================
//    IMPLEMENTATION PRIVATE FUNCTIONS
//============================================================================
//============================================================================
//    INTERFACE FUNCTIONS
//============================================================================
//============================================================================
//    INTERFACE CLASS BODIES
//============================================================================
// --- Archive Class ---
// Parse the Archive.
VFS_BOOL CArchive::Parse()
{
	// Read in the Archive Header.
	ARCHIVE_HEADER RawHeader;
	if( !VFS_File_Read( m_hFile, ( VFS_BYTE* ) &RawHeader, sizeof( ARCHIVE_HEADER ) ) )
		return VFS_FALSE;

	m_Header.dwDataOffset = sizeof( ARCHIVE_HEADER ) +
							RawHeader.dwNumFilters * sizeof( ARCHIVE_FILTER ) +
							RawHeader.dwNumDirs * sizeof( ARCHIVE_DIR ) +
							RawHeader.dwNumFiles * sizeof( ARCHIVE_FILE );
	m_Header.dwFileDataOffset = m_Header.dwDataOffset;

	// Read in the Filters.
	VFS_DWORD dwIndex;
	for( dwIndex = 0; dwIndex < RawHeader.dwNumFilters; dwIndex++ )
	{
		ARCHIVE_FILTER RawFilter;
		if( !VFS_File_Read( m_hFile, ( VFS_BYTE* ) &RawFilter, sizeof( ARCHIVE_FILTER ) ) )
			return VFS_FALSE;

		// Get the Filter for the Name.
		VFS_Filter* pFilter = ( VFS_Filter* ) VFS_GetFilter( RawFilter.szName );
		if( pFilter == NULL )
			return VFS_FALSE;

        // Increase the File Data Offset.
		m_Header.dwFileDataOffset += pFilter->GetConfigDataSize();

		m_Header.Filters.push_back( pFilter );
	}

	// Read in the Dirs.
	for( dwIndex = 0; dwIndex < RawHeader.dwNumDirs; dwIndex++ )
	{
		ARCHIVE_DIR RawDir;
		if( !VFS_File_Read( m_hFile, ( VFS_BYTE* ) &RawDir, sizeof( ARCHIVE_DIR ) ) )
			return VFS_FALSE;

		ArchiveDir Dir;
		Dir.dwParentDirIndex = RawDir.dwParentIndex;
		Dir.strName = RawDir.szName;

		m_Header.Dirs.push_back( Dir );
	}

	// Calculate the Full Name.
	for( dwIndex = 0; dwIndex < RawHeader.dwNumDirs; dwIndex++ )
	{
		ArchiveDir* pBase = &m_Header.Dirs[ dwIndex ];
		ArchiveDir* pDir = pBase;
		while( pDir->dwParentDirIndex != DIR_INDEX_ROOT )
		{
			pDir = &m_Header.Dirs[ pDir->dwParentDirIndex ];
			pBase->strName = pDir->strName + VFS_PATH_SEPARATOR + pBase->strName;
		}

		m_Header.DirHash[ m_Header.Dirs[ dwIndex ].strName ] = dwIndex;
	}

	// Read in the Filter Data.
	VFS_DWORD dwPos = VFS_File_Tell( m_hFile );
	if( !Activate() )
		return VFS_FALSE;
	VFS_File_Seek( m_hFile, dwPos, VFS_SET );

	// Read in the Files.
	VFS_DWORD dwDataOffset = m_Header.dwFileDataOffset;
	for( dwIndex = 0; dwIndex < RawHeader.dwNumFiles; dwIndex++ )
	{
		ARCHIVE_FILE RawFile;
		if( !VFS_File_Read( m_hFile, ( VFS_BYTE* ) &RawFile, sizeof( ARCHIVE_FILE ) ) )
			return VFS_FALSE;

		ArchiveFile File;
		File.strName = RawFile.szName;
		File.dwDirIndex = RawFile.dwDirIndex;
		if( File.dwDirIndex != DIR_INDEX_ROOT )
			File.strName = m_Header.Dirs[ File.dwDirIndex ].strName + VFS_PATH_SEPARATOR + File.strName;
		File.dwCompressedSize = RawFile.dwCompressedSize;
		File.dwUncompressedSize = RawFile.dwUncompressedSize;
		File.dwDataOffset = dwDataOffset;
		dwDataOffset += File.dwCompressedSize;
		m_Header.Files.push_back( File );

		m_Header.FileHash[ m_Header.Files[ dwIndex ].strName ] = dwIndex;
//.........这里部分代码省略.........
开发者ID:Keinier,项目名称:KPackage,代码行数:101,代码来源:VFS_Archive.cpp

示例2: _ASSERTE

void CTabBarClass::Update(BOOL abPosted/*=FALSE*/)
{
	#ifdef _DEBUG
	if (this != gpConEmu->mp_TabBar)
	{
		_ASSERTE(this == gpConEmu->mp_TabBar);
	}
	#endif

	MCHKHEAP
	/*if (!_active)
	{
	    return;
	}*/ // Теперь - ВСЕГДА! т.к. сами управляем мультиконсолью

	if (mb_DisableRedraw)
	{
		_ASSERTE(FALSE && "mb_DisableRedraw?"); // Надо?
		return;
	}

	if (!isMainThread())
	{
		RequestPostUpdate();
		return;
	}

	gpConEmu->mp_Status->UpdateStatusBar();

	mb_PostUpdateCalled = FALSE;

	#ifdef _DEBUG
	_ASSERTE(mn_InUpdate >= 0);
	if (mn_InUpdate > 0)
	{
		_ASSERTE(mn_InUpdate == 0);
	}
	#endif

	mn_InUpdate ++;

	MCHKHEAP
	int V, I, tabIdx = 0, nCurTab = -1;
	BOOL bShowFarWindows = gpSet->bShowFarWindows;

	// Выполняться должно только в основной нити, так что CriticalSection не нужна

	#ifdef _DEBUG
	if (this != gpConEmu->mp_TabBar)
	{
		_ASSERTE(this == gpConEmu->mp_TabBar);
	}
	#endif

	TODO("Обработка gpSet->bHideInactiveConsoleTabs для новых табов");
	MCHKHEAP


	// Check if we need to AutoSHOW or AutoHIDE tab bar
	if (!IsTabsActive() && gpSet->isTabs)
	{
		int nTabs = CountActiveTabs(2);
		if (nTabs > 1)
		{
			Activate();
		}
	}
	else if (IsTabsActive() && gpSet->isTabs==2)
	{
		int nTabs = CountActiveTabs(2);
		if (nTabs <= 1)
		{
			Deactivate();
		}
	}


	// Validation?
	#ifdef _DEBUG
	if (this != gpConEmu->mp_TabBar)
	{
		_ASSERTE(this == gpConEmu->mp_TabBar);
	}
	#endif



	MCHKHEAP
	HANDLE hUpdate = m_Tabs.UpdateBegin();
	_ASSERTE(hUpdate!=NULL);

	bool bStackChanged = false;

	/* ********************* */
	/*          Go           */
	/* ********************* */
	{
		MMap<CVConGroup*,CVirtualConsole*> Groups; Groups.Init(MAX_CONSOLE_COUNT, true);

		for (V = 0; V < MAX_CONSOLE_COUNT; V++)
//.........这里部分代码省略.........
开发者ID:negadj,项目名称:ConEmu,代码行数:101,代码来源:TabBar.cpp

示例3: PlugInShell_SetPluginState

long PlugInShell_SetPluginState(const unsigned long inNewState)
{
    long macError = eDSNoErr;
    bool isAcquired = false;

    LOG_ENTER("inNewState = 0x%08x (%s)", inNewState, StateToString(inNewState));

    if (FlagOn(inNewState, ~(kActive | kInactive)))
    {
        LOG("Ignoring unexpected state flags: 0x%08x", FlagOn(inNewState, ~(kActive | kInactive)));
    }

    if (!FlagOn(inNewState, kActive | kInactive))
    {
        // Nothing to do.
        LOG("Nothing to do because inactive/active flags are not specified.");
        macError = eDSNoErr;
        GOTO_CLEANUP();
    }

    if (FlagOn(inNewState, kActive) && FlagOn(inNewState, kInactive))
    {
        LOG_ERROR("Cannot set active and inactive at the same time.");
        macError = ePlugInError;
        GOTO_CLEANUP();
    }

    GS_ACQUIRE_EXCLUSIVE();
    isAcquired = true;

    GS_VERIFY_INITIALIZED(macError);

    LOG("Current State = 0x%08x", GlobalState.PluginState);

    if ( (FlagOn(inNewState, kActive | kInactive) == FlagOn(GlobalState.PluginState, kActive | kInactive)) )
    {
        // Nothing to do.
        LOG("Nothing to do because the state matches");
        macError = eDSNoErr;
        GOTO_CLEANUP();
    }

    if ( FlagOn(inNewState, kActive) )
    {
        LOG("Activating");
        macError = Activate();
        GOTO_CLEANUP_ON_MACERROR(macError);

        SetFlag(GlobalState.PluginState, kActive);
        ClearFlag(GlobalState.PluginState, kInactive);
    }
    else if ( FlagOn(inNewState, kInactive) )
    {
        LOG("De-activating");
        macError = Deactivate();
        GOTO_CLEANUP_ON_MACERROR(macError);

        ClearFlag(GlobalState.PluginState, kActive);
        SetFlag(GlobalState.PluginState, kInactive);
    }
    else
    {
        // This should never happen.
        LOG_ERROR("Benign unexpected code path.");
        macError = eDSNoErr;
    }

cleanup:

    if (isAcquired)
    {
        LOG("Final State = 0x%08x", GlobalState.PluginState);
        GS_RELEASE();
    }

    LOG_LEAVE("--> %d", macError);
    return macError;
}
开发者ID:virtual-void,项目名称:pbis,代码行数:78,代码来源:PlugInShell.cpp

示例4: Activate

/*
================
idPhysics_Parametric::SetAngularInterpolation
================
*/
void idPhysics_Parametric::SetAngularInterpolation( int time, int accelTime, int decelTime, int duration, const idAngles &startAng, const idAngles &endAng ) {
	current.time = gameLocal.time;
	current.angularInterpolation.Init( time, accelTime, decelTime, duration, startAng, endAng );
	current.localAngles = startAng;
	Activate();
}
开发者ID:ET-NiK,项目名称:amxxgroup,代码行数:11,代码来源:Physics_Parametric.cpp

示例5: filter

int filter(const SDL_Event *tEvent){
    // recursion avoidance
    static bool recursion = false;
    if ( !recursion )
    {
        class RecursionGuard
        {
        public:
            RecursionGuard( bool& recursion )
                    :recursion_( recursion )
            {
                recursion = true;
            }

            ~RecursionGuard()
            {
                recursion_ = false;
            }

        private:
            bool& recursion_;
        };

        RecursionGuard guard( recursion );

        // boss key or OS X quit command
        if ((tEvent->type==SDL_KEYDOWN && tEvent->key.keysym.sym==27 &&
                tEvent->key.keysym.mod & KMOD_SHIFT) ||
                (tEvent->type==SDL_KEYDOWN && tEvent->key.keysym.sym==113 &&
                 tEvent->key.keysym.mod & KMOD_META) ||
                (tEvent->type==SDL_QUIT)){
            // sn_SetNetState(nSTANDALONE);
            // sn_Receive();

            // register end of recording
            tRecorder::Record("END");

            st_SaveConfig();
            uMenu::quickexit=true;
            return false;
        }

        if(tEvent->type==SDL_MOUSEMOTION)
            if(tEvent->motion.x==sr_screenWidth/2 && tEvent->motion.y==sr_screenHeight/2)
                return 0;
        if (su_mouseGrab &&
                tEvent->type!=SDL_MOUSEBUTTONDOWN &&
                tEvent->type!=SDL_MOUSEBUTTONUP &&
                ((tEvent->motion.x>=sr_screenWidth-10  || tEvent->motion.x<=10) ||
                 (tEvent->motion.y>=sr_screenHeight-10 || tEvent->motion.y<=10)))
            SDL_WarpMouse(sr_screenWidth/2,sr_screenHeight/2);

        // fetch alt-tab

        if (tEvent->type==SDL_ACTIVEEVENT)
        {
            // Jonathans fullscreen bugfix.
#ifdef MACOSX
            if(currentScreensetting.fullscreen ^ lastSuccess.fullscreen) return false;
#endif
            int flags = SDL_APPINPUTFOCUS;
            if ( tEvent->active.gain && tEvent->active.state & flags )
                Activate(true);
            if ( !tEvent->active.gain && tEvent->active.state & flags )
                Activate(false);

            // reload GL stuff if application gets reactivated
            if ( tEvent->active.gain && tEvent->active.state & SDL_APPACTIVE )
            {
                // just treat it like a screen mode change, gets the job done
                rCallbackBeforeScreenModeChange::Exec();
                rCallbackAfterScreenModeChange::Exec();
            }
            return false;
        }

        if (su_prefetchInput){
            return su_StoreSDLEvent(*tEvent);
        }

    }

    return 1;
}
开发者ID:KnIfER,项目名称:armagetron,代码行数:84,代码来源:gArmagetron.cpp

示例6: Activate

void CMultiStateMover::Event_Activate( idEntity *activator ) {
	Activate( activator );
}
开发者ID:SL987654,项目名称:The-Darkmod-Experimental,代码行数:3,代码来源:MultiStateMover.cpp

示例7: switch

		void AndroidEventLoop::ProcessAppEvent(int32_t pCommand)
		{
			switch (pCommand)
			{
				case APP_CMD_CONFIG_CHANGED:
					LOGD("APP_CMD_CONFIG_CHANGED");
					Activate();
					m_pActivityHandler->onConfigurationChanged();
					break;
				case APP_CMD_INIT_WINDOW:
					LOGD("APP_CMD_INIT_WINDOW");
					Activate();
					break;
				case APP_CMD_DESTROY:
					LOGD("APP_CMD_DESTROY");
					m_pActivityHandler->onDestroy();
					m_window.InvalidateSurface();
					m_window.InvalidateContext();
					m_enabled = false;
					break;
				case APP_CMD_GAINED_FOCUS:
					LOGD("APP_CMD_GAINED_FOCUS");
					m_pActivityHandler->onGainFocus();
					break;
				case APP_CMD_LOST_FOCUS:
					LOGD("APP_CMD_LOST_FOCUS");
					m_pActivityHandler->onLostFocus();
					break;
				case APP_CMD_LOW_MEMORY:
					LOGD("APP_CMD_LOW_MEMORY");
					m_pActivityHandler->onLowMemory();
					break;
				case APP_CMD_PAUSE:
					LOGD("APP_CMD_PAUSE");
					m_pActivityHandler->onPause();
					m_enabled = false;
					//m_window.InvalidateSurface();
					break;
				case APP_CMD_RESUME:
					LOGD("APP_CMD_RESUME");
					Activate();
					m_pActivityHandler->onResume();
					break;
				case APP_CMD_SAVE_STATE:
					LOGD("APP_CMD_SAVE_STATE");
					m_pActivityHandler->onSaveState(&Global::pAndroidApp->savedState,
						&Global::pAndroidApp->savedStateSize);
					break;
				case APP_CMD_START:
					LOGD("APP_CMD_START");
					Activate();
					m_pActivityHandler->onStart();
					break;
				case APP_CMD_STOP:
					LOGD("APP_CMD_STOP");
					m_pActivityHandler->onStop();
					m_window.InvalidateSurface();
					m_enabled = false;
					break;
				case APP_CMD_TERM_WINDOW:
					LOGD("APP_CMD_TERM_WINDOW");
					m_window.InvalidateSurface();
					m_enabled = false;
					break;
				default:
					break;
			}

			LOGD("m_enabled = %d",m_enabled);
			LOGD("is context bound? = %d",m_window.IsContextBound());
		}
开发者ID:mirceamt,项目名称:MPACK,代码行数:71,代码来源:AndroidEventLoop.cpp

示例8: Activate

/*
================
idPhysics_Player::SetAxis
================
*/
void idPhysics_Monster::SetAxis(const idMat3 &newAxis, int id)
{
	clipModel->Link(gameLocal.clip, self, 0, clipModel->GetOrigin(), newAxis);
	Activate();
}
开发者ID:AreaScout,项目名称:dante-doom3-odroid,代码行数:10,代码来源:Physics_Monster.cpp

示例9: getView

int PCB_EDITOR_CONTROL::PlaceModule( const TOOL_EVENT& aEvent )
{
    MODULE* module = NULL;
    KIGFX::VIEW* view = getView();
    KIGFX::VIEW_CONTROLS* controls = getViewControls();
    BOARD* board = getModel<BOARD>();

    // Add a VIEW_GROUP that serves as a preview for the new item
    KIGFX::VIEW_GROUP preview( view );
    view->Add( &preview );

    m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear, true );
    controls->ShowCursor( true );
    controls->SetSnapping( true );

    Activate();
    m_frame->SetToolID( ID_PCB_MODULE_BUTT, wxCURSOR_HAND, _( "Add footprint" ) );

    // Main loop: keep receiving events
    while( OPT_TOOL_EVENT evt = Wait() )
    {
        VECTOR2I cursorPos = controls->GetCursorPosition();

        if( evt->IsCancel() || evt->IsActivate() )
        {
            if( module )
            {
                board->Delete( module );  // it was added by LoadModuleFromLibrary()
                module = NULL;

                preview.Clear();
                preview.ViewUpdate( KIGFX::VIEW_ITEM::GEOMETRY );
                controls->ShowCursor( true );
            }
            else
                break;

            if( evt->IsActivate() )  // now finish unconditionally
                break;
        }

        else if( module && evt->Category() == TC_COMMAND )
        {
            if( evt->IsAction( &COMMON_ACTIONS::rotate ) )
            {
                module->Rotate( module->GetPosition(), m_frame->GetRotationAngle() );
                preview.ViewUpdate( KIGFX::VIEW_ITEM::GEOMETRY );
            }
            else if( evt->IsAction( &COMMON_ACTIONS::flip ) )
            {
                module->Flip( module->GetPosition() );
                preview.ViewUpdate( KIGFX::VIEW_ITEM::GEOMETRY );
            }
        }

        else if( evt->IsClick( BUT_LEFT ) )
        {
            if( !module )
            {
                // Pick the module to be placed
                module = m_frame->LoadModuleFromLibrary( wxEmptyString,
                                                         m_frame->Prj().PcbFootprintLibs(),
                                                         true, NULL );
                if( module == NULL )
                    continue;

                module->SetPosition( wxPoint( cursorPos.x, cursorPos.y ) );

                // Add all the drawable parts to preview
                preview.Add( module );
                module->RunOnChildren( boost::bind( &KIGFX::VIEW_GROUP::Add, &preview, _1 ) );

                preview.ViewUpdate( KIGFX::VIEW_ITEM::GEOMETRY );
            }
            else
            {
                // Place the selected module
                module->RunOnChildren( boost::bind( &KIGFX::VIEW::Add, view, _1 ) );
                view->Add( module );
                module->ViewUpdate( KIGFX::VIEW_ITEM::GEOMETRY );

                m_frame->OnModify();
                m_frame->SaveCopyInUndoList( module, UR_NEW );

                // Remove from preview
                preview.Remove( module );
                module->RunOnChildren( boost::bind( &KIGFX::VIEW_GROUP::Remove, &preview, _1 ) );
                module = NULL;  // to indicate that there is no module that we currently modify
            }

            bool placing = ( module != NULL );

            controls->SetAutoPan( placing );
            controls->CaptureCursor( placing );
            controls->ShowCursor( !placing );
        }

        else if( module && evt->IsMotion() )
        {
            module->SetPosition( wxPoint( cursorPos.x, cursorPos.y ) );
//.........这里部分代码省略.........
开发者ID:grtwall,项目名称:kicad-source-mirror,代码行数:101,代码来源:pcb_editor_control.cpp

示例10: Activate

void UAITask_MoveTo::Resume()
{
	Activate();
	Super::Resume();
}
开发者ID:amyvmiwei,项目名称:UnrealEngine4,代码行数:5,代码来源:AITask_MoveTo.cpp

示例11: Invalidate

	void CButtonUI::DoEvent(TEventUI& event)
	{
		if( !IsMouseEnabled() && event.Type > UIEVENT__MOUSEBEGIN && event.Type < UIEVENT__MOUSEEND ) {
			if( m_pParent != NULL ) m_pParent->DoEvent(event);
			else CLabelUI::DoEvent(event);
			return;
		}

		if( event.Type == UIEVENT_SETFOCUS ) 
		{
			Invalidate();
		}
		if( event.Type == UIEVENT_KILLFOCUS ) 
		{
			Invalidate();
		}
		if( event.Type == UIEVENT_KEYDOWN )
		{
			if (IsKeyboardEnabled()) {
				if( event.chKey == VK_SPACE || event.chKey == VK_RETURN ) {
					Activate();
					return;
				}
			}
		}
		if( event.Type == UIEVENT_BUTTONDOWN || event.Type == UIEVENT_DBLCLICK )
		{
			if( ::PtInRect(&m_rcItem, event.ptMouse) && IsEnabled() ) {
				m_uButtonState |= UISTATE_PUSHED | UISTATE_CAPTURED;
				Invalidate();
			}
			return;
		}
		if( event.Type == UIEVENT_MOUSEMOVE )
		{
			if( (m_uButtonState & UISTATE_CAPTURED) != 0 ) {
				if( ::PtInRect(&m_rcItem, event.ptMouse) ) m_uButtonState |= UISTATE_PUSHED;
				else m_uButtonState &= ~UISTATE_PUSHED;
				Invalidate();
			}
			return;
		}
		if( event.Type == UIEVENT_BUTTONUP )
		{
			if( (m_uButtonState & UISTATE_CAPTURED) != 0 ) {
				if( ::PtInRect(&m_rcItem, event.ptMouse) ) Activate();
				m_uButtonState &= ~(UISTATE_PUSHED | UISTATE_CAPTURED);
				Invalidate();
			}
			return;
		}
		if( event.Type == UIEVENT_CONTEXTMENU )
		{
			if( IsContextMenuUsed() ) {
				m_pManager->SendNotify(this, _T("menu"), event.wParam, event.lParam);
			}
			return;
		}
		if( event.Type == UIEVENT_MOUSEENTER )
		{
			if( IsEnabled() ) {
				m_uButtonState |= UISTATE_HOT;
				Invalidate();
			}
			// return;
		}
		if( event.Type == UIEVENT_MOUSELEAVE )
		{
			if( IsEnabled() ) {
				m_uButtonState &= ~UISTATE_HOT;
				Invalidate();
			}
			// return;
		}
		if( event.Type == UIEVENT_SETCURSOR ) {
			::SetCursor(::LoadCursor(NULL, MAKEINTRESOURCE(IDC_ARROW)));
			return;
		}
		CLabelUI::DoEvent(event);
	}
开发者ID:XLIVEMEN,项目名称:ScreenCaptrue,代码行数:80,代码来源:UIButton.cpp

示例12: sizeof


//.........这里部分代码省略.........

  if(windowsContext==0)
	  std::cout << "failed getting window device context\n";
                 
	static PIXELFORMATDESCRIPTOR pfd =// pfd Tells Windows How We Want Things To Be
	{
		sizeof(PIXELFORMATDESCRIPTOR),	// Size Of This Pixel Format Descriptor
		1,								              // Version Number
		PFD_DRAW_TO_WINDOW |						// Format Must Support Window
		PFD_SUPPORT_OPENGL |						// Format Must Support OpenGL
		PFD_DOUBLEBUFFER |
		PFD_SWAP_EXCHANGE ,					    // Must Support Double Buffering
		PFD_TYPE_RGBA,							    // Request An RGBA Format
		24,								              // Select Our Color Depth
		0, 0, 0, 0, 0, 0,						    // Color Bits Ignored  if(openGLContext==0)
		0,								              // No Alpha Buffer
		0,								              // Shift Bit Ignored
		0,								              // No Accumulation Buffer
		0, 0, 0, 0,							        // Accumulation Bits Ignored
		0,								              // 16Bit Z-Buffer (Depth Buffer)
		0,								              // No Stencil Buffer
		0,								              // No Auxiliary Buffer
		PFD_MAIN_PLANE,							    // Main Drawing Layer
		0,								              // Reserved
		0, 0, 0								          // Layer Masks Ignored
	};


  // Sonstiges einstellen
  int iFormat = ChoosePixelFormat(windowsContext,&pfd);
  SetPixelFormat(windowsContext,iFormat,&pfd);


  openGLContext = wglCreateContext(windowsContext);

  int errw=GetLastError();

  if(openGLContext==0)
	  std::cout << "failed creating openGL context "<<errw<<"\n";

#else

  X_display = XOpenDisplay(NULL);

  GPGPU_ERROR( !X_display ) << "cant open X display";

  GLX_drawable = QApplication::topLevelWidgets().at(0)->winId();

  GPGPU_ERROR( !GLX_drawable ) << "cant get toplevel widget from QT";

  static int visAttributes[] = {
    GLX_RGBA,
    GLX_RED_SIZE, 1,
    GLX_GREEN_SIZE, 1,
    GLX_BLUE_SIZE, 1,
    GLX_DOUBLEBUFFER,
    None
  };

  XVisualInfo *visinfo = glXChooseVisual(X_display, 0, visAttributes);

  GPGPU_ERROR(!visinfo) << "Unable to choose specified visual!";

  openGLContext = glXCreateContext(X_display, visinfo, 0, true);

  if(visinfo)
     XFree(visinfo);

  GPGPU_ERROR(!openGLContext) << "cant create GLX context";

#endif

  Activate();

  GPGPU_INFO << "initializing glew";

  int err=glewInit();

  GPGPU_CHECKGLERR << "initializing glew";
  GPGPU_ERROR(GLEW_OK != err) << "glewInit() fails with " << err << " as text: " << glewGetErrorString(err);

  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  glOrtho(0,1,0,1,-1,1);
  glMatrixMode(GL_MODELVIEW);
  glLoadIdentity();

  GPGPU_CHECKGLERR << "intializing projection&modelview matrix";

  glDisable(GL_CULL_FACE);
	glShadeModel(GL_SMOOTH);							// Enable Smooth Shading
	glClearColor(0.0f, 0.0f, 0.0f, 0.0f);				// Black Background
	glClearDepth(1.0f);									// Depth Buffer Setup
  glDisable(GL_DEPTH_TEST);							// Enables Depth Testing
	glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);	// Really Nice Perspective Calculations
  glHint(GL_TEXTURE_COMPRESSION_HINT, GL_NICEST);
  glDepthMask(false);

  GPGPU_CHECKGLERR << "setting up openGL context";
}
开发者ID:david-guerrero,项目名称:MITK,代码行数:101,代码来源:mitkGPGPU.cpp

示例13: Logger

	DatabaseLogger::DatabaseLogger (OStream& os)
		: Logger (os)
	{
		Activate (true);
	}
开发者ID:Noxalus,项目名称:YAPOG,代码行数:5,代码来源:DatabaseLogger.cpp

示例14: event

/*
   The numArg here is the listbox item index while the strArg is used
   differently for the different actions:

   a) for wxACTION_LISTBOX_FIND it has the natural meaning: this is the string
      to find

   b) for wxACTION_LISTBOX_SELECT and wxACTION_LISTBOX_EXTENDSEL it is used
      to decide if the listbox should send the notification event (it is empty)
      or not (it is not): this allows us to reuse the same action for when the
      user is dragging the mouse when it has been released although in the
      first case no notification is sent while in the second it is sent.
 */
bool wxListBox::PerformAction(const wxControlAction& action,
                              long numArg,
                              const wxString& strArg)
{
    int item = (int)numArg;

    if ( action == wxACTION_LISTBOX_SETFOCUS )
    {
        SetCurrentItem(item);
    }
    else if ( action == wxACTION_LISTBOX_ACTIVATE )
    {
        Activate(item);
    }
    else if ( action == wxACTION_LISTBOX_TOGGLE )
    {
        if ( item == -1 )
            item = m_current;

        if ( IsSelected(item) )
            DoUnselect(item);
        else
            SelectAndNotify(item);
    }
    else if ( action == wxACTION_LISTBOX_SELECT )
    {
        DeselectAll(item);

        if ( strArg.empty() )
            SelectAndNotify(item);
        else
            DoSelect(item);
    }
    else if ( action == wxACTION_LISTBOX_SELECTADD )
        DoSelect(item);
    else if ( action == wxACTION_LISTBOX_UNSELECT )
        DoUnselect(item);
    else if ( action == wxACTION_LISTBOX_MOVEDOWN )
        ChangeCurrent(1);
    else if ( action == wxACTION_LISTBOX_MOVEUP )
        ChangeCurrent(-1);
    else if ( action == wxACTION_LISTBOX_PAGEDOWN )
        ChangeCurrent(GetItemsPerPage());
    else if ( action == wxACTION_LISTBOX_PAGEUP )
        ChangeCurrent(-GetItemsPerPage());
    else if ( action == wxACTION_LISTBOX_START )
        SetCurrentItem(0);
    else if ( action == wxACTION_LISTBOX_END )
        SetCurrentItem(GetCount() - 1);
    else if ( action == wxACTION_LISTBOX_UNSELECTALL )
        DeselectAll(item);
    else if ( action == wxACTION_LISTBOX_EXTENDSEL )
        ExtendSelection(item);
    else if ( action == wxACTION_LISTBOX_FIND )
        FindNextItem(strArg);
    else if ( action == wxACTION_LISTBOX_ANCHOR )
        AnchorSelection(item == -1 ? m_current : item);
    else if ( action == wxACTION_LISTBOX_SELECTALL ||
              action == wxACTION_LISTBOX_SELTOGGLE )
        wxFAIL_MSG(_T("unimplemented yet"));
    else
        return wxControl::PerformAction(action, numArg, strArg);

    return true;
}
开发者ID:project-renard-survey,项目名称:chandler,代码行数:78,代码来源:listbox.cpp

示例15: Activate

void TBWindow::OnAdded()
{
	// If we was added last, call Activate to update status etc.
	if (GetParent()->GetLastChild() == this)
		Activate();
}
开发者ID:rongzhou,项目名称:turbobadger,代码行数:6,代码来源:tb_window.cpp


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