• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ MakeCurrent函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: MakeCurrent

wxGLContext::~wxGLContext()
{
    if ( !m_glContext )
        return;

    if ( m_glContext == glXGetCurrentContext() )
        MakeCurrent(None, NULL);

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


示例17: wglGetCurrentDC

bool               P3DGLMemoryContextPBuffer::Create
                                      (unsigned int        Width,
                                       unsigned int        Height,
                                       bool                NeedAlpha)
 {
  int              PixelFormat;
  UINT             FormatCount;
  HDC              CurrDeviceContext;

  CurrDeviceContext = wglGetCurrentDC();

  if (wglChoosePixelFormatARB( CurrDeviceContext,
                               NeedAlpha ? PBufferPixelFormatIntAttrsAlpha :
                                           PBufferPixelFormatIntAttrsNoAlpha,
                               NULL,
                               1,
                              &PixelFormat,
                              &FormatCount))
   {
    if (FormatCount == 0)
     {
      return(false);
     }
   }
  else
   {
    return(false);
   }

  PBufferHandle = wglCreatePbufferARB
                   (CurrDeviceContext,
                    PixelFormat, 
                    Width,
                    Height,
                    PBufferAttrs);

  if (PBufferHandle == NULL)
   {
    return(false);
   }

  PBufferDC = wglGetPbufferDCARB(PBufferHandle);
  GLContext = wglCreateContext(PBufferDC);

  if (MakeCurrent())
   {
    return(P3DGLExtInit());
   }
  else
   {
    return(false);
   }

  return(true);
 }
开发者ID:Benjamin-L,项目名称:Dinosauria,代码行数:55,代码来源:p3dglmemcntx.cpp


示例18: MakeCurrent

bool nglContext::BuildOpenGLFromExisting(WindowRef Win, AGLContext Ctx)
{
  mTargetAPI = eTargetAPI_OpenGL;
  
  mFullscreen = false;

  mCtx = Ctx;
    
  MakeCurrent(Win);
  return true;
}
开发者ID:YetToCome,项目名称:nui3,代码行数:11,代码来源:nglContext_Carbon.cpp


示例19: alcOpenDevice

static Context *CreateContext(MFDevice *pDevice)
{
	AudioDevice &device = *(AudioDevice*)pDevice->pInternal;

	if(!device.pDevice)
		device.pDevice = alcOpenDevice(pDevice->strings[MFDS_ID]);
	if(!device.pDevice)
		return NULL;

	Context *pContext = (Context*)MFHeap_Alloc(sizeof(Context));
	pContext->pContext = alcCreateContext(device.pDevice, NULL);
	pContext->pDevice = pDevice;
	pContext->pRender = &device;

	Context *pOld = MakeCurrent(pContext);

	const char *pVersion = alGetString(AL_VERSION);
	const char *pExtensions = alGetString(AL_EXTENSIONS);
	MFDebug_Log(0, MFStr("OpenAL Version: %s", pVersion));
	MFDebug_Log(0, MFStr("OpenAL Extensions: %s", pExtensions));

	pContext->ext.static_buffer = alIsExtensionPresent("ALC_EXT_STATIC_BUFFER") == AL_TRUE;
	pContext->ext.offset = alIsExtensionPresent("AL_EXT_OFFSET") == AL_TRUE;
	pContext->ext.float32 = alIsExtensionPresent("AL_EXT_float32") == AL_TRUE;
	pContext->ext.source_radius = alIsExtensionPresent("AL_EXT_SOURCE_RADIUS") == AL_TRUE;
	pContext->ext.buffer_sub_data = alIsExtensionPresent("AL_SOFT_buffer_sub_data") == AL_TRUE;
	pContext->ext.buffer_samples = alIsExtensionPresent("AL_SOFT_buffer_samples") == AL_TRUE;

	if(pContext->ext.static_buffer)
		alBufferDataStatic = (PFNALBUFFERDATASTATICPROC)alGetProcAddress("alBufferDataStatic");
	if(pContext->ext.buffer_sub_data)
		alBufferSubDataSOFT = (PFNALBUFFERSUBDATASOFTPROC)alGetProcAddress("alBufferSubDataSOFT");

	alListener3f(AL_POSITION, 0, 0, 0);
	alListener3f(AL_VELOCITY, 0, 0, 0);
	alListener3f(AL_ORIENTATION, 0, 0, -1);

	MakeCurrent(pOld);

	return pContext;
}
开发者ID:TurkeyMan,项目名称:fuji,代码行数:41,代码来源:MFSound_OpenAL.cpp


示例20: mutex

void EglDisplayImpl::Shutdown() {
  Mutex::Autolock mutex(&lock_);
  if (!initialized_) {
    return;
  }

  MakeCurrent(EGL_NO_CONTEXT, EGL_NO_SURFACE, EGL_NO_SURFACE);
  contexts_.Unregister(global_context_);
  global_context_ = NULL;
  Native::DestroyNativeWindow(window_);
  window_ = NULL;
}
开发者ID:epowers,项目名称:arc,代码行数:12,代码来源:egl_display_impl.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ MakeDelegate函数代码示例发布时间:2022-05-30
下一篇:
C++ MakeContextCurrent函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap