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


C++ MakeCurrent函数代码示例

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


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

示例1: InitCurrent

/*
================
idUsercmdGenLocal::UsercmdInterrupt

Called asyncronously
================
*/
void idUsercmdGenLocal::UsercmdInterrupt( void ) {
	// dedicated servers won't create usercmds
	if ( !initialized ) {
		return;
	}

	// init the usercmd for com_ticNumber+1
	InitCurrent();

	// process the system mouse events
	Mouse();

	// process the system keyboard events
	Keyboard();

	// process the system joystick events
	Joystick();

	// create the usercmd for com_ticNumber+1
	MakeCurrent();

	// save a number for debugging cmdDemos and networking
	cmd.sequence = com_ticNumber+1;

	buffered[(com_ticNumber+1) & (MAX_BUFFERED_USERCMD-1)] = cmd;
}
开发者ID:Justasic,项目名称:DOOM-3,代码行数:33,代码来源:UsercmdGen.cpp

示例2: MakeCurrent

void GLHelper::SwapToDummySurface()
{
    //if (false) LOGD("----SWAP BACK TO PBUFFER----");
    if (!_eglDummySurface) LOGD("The DummySurface has somehow been destroyed (or was not created)");
    MakeCurrent(_eglSurfaceContext, _eglDummySurface);
    //if (false) LOGD("---~SWAP BACK TO PBUFFER~---");
}
开发者ID:kstv,项目名称:BlackCode-Fuse,代码行数:7,代码来源:GLHelper.cpp

示例3: SetActive

bool GlContext::SetActive(bool active)
{
    if (active)
    {
        // Activate the context
        if (MakeCurrent())
        {
            // If this is the first context to be activated on this thread, make
            // it the reference context for the whole thread.
            // referenceContext must *not* be the threadContext of the main thread
            if (!threadContext && (this != &referenceContext))
                threadContext = this;

            return true;
        }
    }
    else
    {
        // Deactivate the context
        if (threadContext && (threadContext != this))
        {
            // To deactivate the context, we actually activate another one
            // so that we make sure that there is always an active context
            // for subsequent graphics operations
            return threadContext->SetActive(true);
        }
    }

    // If we got there then something failed
    return false;
}
开发者ID:vidjogamer,项目名称:ProjectTemplate,代码行数:31,代码来源:GlContext.cpp

示例4: ReadCurrentS

void    ReadCurrentS(void)
{
  ReadEnergyS();
  mpdwBaseDig[0] = coEnergy.dwBuff*mpdbPulseMnt[ibDig]/wDividerS;

  MakeCurrent();
}
开发者ID:ti-cortex-m4,项目名称:tm4c1294ncpdt,代码行数:7,代码来源:device_s.c

示例5: CloneSurface

void
CanvasClientSharedSurface::Update(gfx::IntSize aSize, ClientCanvasLayer* aLayer)
{
  if (mFront) {
    mPrevFront = mFront;
    mFront = nullptr;
  }

  auto gl = aLayer->mGLContext;
  gl->MakeCurrent();

  if (aLayer->mGLFrontbuffer) {
    mFront = CloneSurface(aLayer->mGLFrontbuffer.get(), aLayer->mFactory.get());
    if (mFront)
      mFront->Surf()->Fence();
  } else {
    mFront = gl->Screen()->Front();
    if (!mFront)
      return;
  }
  MOZ_ASSERT(mFront);

  // Alright, now sort out the IPC goop.
  SharedSurface* surf = mFront->Surf();
  auto forwarder = GetForwarder();
  auto flags = GetTextureFlags() | TextureFlags::IMMUTABLE;

  // Get a TexClient from our surf.
  RefPtr<TextureClient> newTex = TexClientFromShSurf(surf, flags);
  if (!newTex) {
    auto manager = aLayer->ClientManager();
    auto shadowForwarder = manager->AsShadowForwarder();
    auto layersBackend = shadowForwarder->GetCompositorBackendType();

    newTex = TexClientFromReadback(surf, forwarder, flags, layersBackend);
  }
  MOZ_ASSERT(newTex);

  // Add the new TexClient.
  MOZ_ALWAYS_TRUE( AddTextureClient(newTex) );

  // Remove the old TexClient.
  if (mFrontTex) {
    // remove old buffer from CompositableHost
    RefPtr<AsyncTransactionTracker> tracker = new RemoveTextureFromCompositableTracker();
    // Hold TextureClient until transaction complete.
    tracker->SetTextureClient(mFrontTex);
    mFrontTex->SetRemoveFromCompositableTracker(tracker);
    // RemoveTextureFromCompositableAsync() expects CompositorChild's presence.
    GetForwarder()->RemoveTextureFromCompositableAsync(tracker, this, mFrontTex);

    mFrontTex = nullptr;
  }

  // Use the new TexClient.
  mFrontTex = newTex;

  forwarder->UpdatedTexture(this, mFrontTex, nullptr);
  forwarder->UseTexture(this, mFrontTex);
}
开发者ID:marshall,项目名称:gecko-dev,代码行数:60,代码来源:CanvasClient.cpp

示例6: MakeCurrent

//---------------------------------------------------------------------------------------
void  z_ed3View::Project3D(int iWidth, int iHeight)
{
	MakeCurrent(_hdc, m_hRC); 

    if(iHeight == 0)
        iHeight = 1;

    if(DOC()->b_whitebk)
    {
        glClearColor(.8f, .8f, .8f, 0.0f);
    }
    else
    {
        if(DOC()->_bShowCsg)
            glClearColor(0.11f, 0.11f, 0.11f, 0.0f);
        else
            glClearColor(.02f, .02f, .04f, 0.0f);
    }
    REAL farCam = _ffar;
/*
    if(SCENE()._si.fogFar)
        farCam = SCENE()._si.fogFar*_ffar;
*/
    
    glViewport(0, 0, iWidth, iHeight);
    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
    gluPerspective(_fov,(GLfloat)iWidth/(GLfloat)iHeight, _fnear, farCam);
    glMatrixMode(GL_MODELVIEW);
    glLoadIdentity();

//	MakeCurrent(_hdc, 0); 
}
开发者ID:comarius,项目名称:getic3d,代码行数:34,代码来源:z_ed3View.cpp

示例7: MakeCurrent

GLX::~GLX()
{
  if (mDisplay) {
    MakeCurrent(mDisplay, 0, 0);
  }

  if (mContext) {
    DestroyContext(mDisplay, mContext);
  }

  if (mGLXPixmap) {
    DestroyGLXPixmap(mDisplay, mGLXPixmap);
  }

  if (mPixmap) {
    XFreePixmap(mDisplay, mPixmap);
  }

  if (mDisplay) {
    XCloseDisplay(mDisplay);
  }

  if (mLibGL) {
    dlclose(mLibGL);
  }
}
开发者ID:CODECOMMUNITY,项目名称:rust-azure,代码行数:26,代码来源:GLX.cpp

示例8: int

void GlSpectrumAnalyzerWindow::FrameResized(float fwidth, float fheight)
{
	int width = int(fwidth);
	int height = int(fheight);
	
	fprintf(stderr, "GlSpectrumAnalyzerWindow::FrameResized(%f, %f)\n", fwidth, fheight);

	MakeCurrent();

	// The OpenGL view has been resized, so we have to reconfigure our
	// OpenGL context to reflect that.

	if( height <= 0 ) height = 1;	// prevent divide-by-zero
	
	glViewport( 0, 0, width, height );
	glMatrixMode( GL_PROJECTION );
	glLoadIdentity();
	gluPerspective( 45.0, (float)width/(float)height, 0.1, 100.0 );
	glMatrixMode( GL_MODELVIEW );
	glLoadIdentity();

	ReleaseCurrent();

	Sync(); // not sure it does anything
	needResize = false;
}
开发者ID:HaikuArchives,项目名称:UselessSoundplayPlugins,代码行数:26,代码来源:glSpectrumAnalyzer.cpp

示例9: ContextMadeCurrent

	/**
	 *  @alsymbols
	 *  @alcfunref{CreateContext}
	 *  @alcfunref{MakeContextCurrent}
	 */
	ContextMadeCurrent(
		const Device& device,
		const FinishedContextAttribs& attribs
	): Context(device, attribs)
	{
		MakeCurrent();
	}
开发者ID:AdamSimpson,项目名称:oglplus,代码行数:12,代码来源:context.hpp

示例10: ReleaseThread

EGLBoolean EGLAPIENTRY ReleaseThread(void)
{
    EVENT("()");

    MakeCurrent(EGL_NO_DISPLAY, EGL_NO_CONTEXT, EGL_NO_SURFACE, EGL_NO_SURFACE);

    SetGlobalError(Error(EGL_SUCCESS));
    return EGL_TRUE;
}
开发者ID:MoonchildProductions,项目名称:Pale-Moon,代码行数:9,代码来源:entry_points_egl.cpp

示例11: Init

    PRBool Init()
    {
        if (!mDC || !mContext)
            return PR_FALSE;

        MakeCurrent();
        SetupLookupFunction();
        return InitWithPrefix("gl", PR_TRUE);
    }
开发者ID:lofter2011,项目名称:Icefox,代码行数:9,代码来源:GLContextProviderWGL.cpp

示例12: wxCHECK2_MSG

bool wxGLContext::SetCurrent(const wxGLCanvas& win) const
{
    if ( !m_glContext )
        return false;

    const Window xid = win.GetXWindow();
    wxCHECK2_MSG( xid, return false, wxT("window must be shown") );

    return MakeCurrent(xid, m_glContext);
}
开发者ID:beanhome,项目名称:dev,代码行数:10,代码来源:glx11.cpp

示例13: Init

    PRBool Init()
    {
        MakeCurrent();
        SetupLookupFunction();
        if (!InitWithPrefix("gl", PR_TRUE)) {
            return PR_FALSE;
        }

        return IsExtensionSupported("GL_EXT_framebuffer_object");
    }
开发者ID:lofter2011,项目名称:Icefox,代码行数:10,代码来源:GLContextProviderGLX.cpp

示例14: ReadCurrentQ

void    ReadCurrentQ(void)
{
  uchar i;
  for (i=0; i<MAX_LINE_Q; i++)
  {
    mpdwBaseDig[i] = mpdbChannelsC[i] * mpdbPulseMnt[ibDig];
  }

  MakeCurrent();
}
开发者ID:ti-cortex-m4,项目名称:tm4c1294ncpdt,代码行数:10,代码来源:device_q.c

示例15: ReleaseThread

EGLBoolean EGLAPIENTRY ReleaseThread(void)
{
    EVENT("()");
    Thread *thread = GetCurrentThread();

    MakeCurrent(EGL_NO_DISPLAY, EGL_NO_CONTEXT, EGL_NO_SURFACE, EGL_NO_SURFACE);

    thread->setError(NoError());
    return EGL_TRUE;
}
开发者ID:wolfviking0,项目名称:webcl-webkit,代码行数:10,代码来源:entry_points_egl.cpp


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