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


C++ GLTexture::GetTextureID方法代码示例

本文整理汇总了C++中GLTexture::GetTextureID方法的典型用法代码示例。如果您正苦于以下问题:C++ GLTexture::GetTextureID方法的具体用法?C++ GLTexture::GetTextureID怎么用?C++ GLTexture::GetTextureID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GLTexture的用法示例。


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

示例1: OnPaint

void CVideoControlSoft::OnPaint(wxPaintEvent& event)
{
#ifdef __WXGTK__
    double scale_factor = GetContentScaleFactor();
#else
    double scale_factor = 1.0f;
#endif
    GLTexture * glTexture = nullptr;
    //printf("OnPaint Soft Render begin \n"); 
#ifndef WIN32
    if(!renderBitmapOpenGL->IsInit())
    {
        renderBitmapOpenGL->Init(this);
        
    }
#endif
    
    std::clock_t start;
    start = std::clock();    
    

    int width = GetWindowWidth() * scale_factor;
    int height = GetWindowHeight() * scale_factor;
    if(width == 0 || height == 0)
        return;
	
	if (quitWindow)
        return;

#ifdef WIN32
    renderBitmapOpenGL->SetCurrent(*this);
#else
    if(updateContext)
    {
        renderBitmapOpenGL->SetCurrent(*this);
        updateContext = false;
    }   
#endif
    

    if (openCLEngine == nullptr)
    {
		openCLEngine = new COpenCLEngine();

		if (openCLEngine != nullptr)
			openclContext = openCLEngine->GetInstance();

		openclEffectYUV = new COpenCLEffectVideoYUV(openclContext);
    }

    nbFrame++;
    printf("Nb Frame per Seconds : %d \n",nbFrame);


    if (videoRenderStart && initStart)
    {
		//nbFrame = 0;
        if(!fpsTimer->IsRunning())
            fpsTimer->Start(1000);
	}

	if(videoRenderStart)
	{
        glTexture = RenderToGLTexture();
        if(glTexture != nullptr)
            printf("glTexture id : %d \n",glTexture->GetTextureID());
    }
    
    if(videoRenderStart && glTexture != nullptr)
    {       
        renderBitmapOpenGL->CreateScreenRender(width, height, CRgbaquad(0,0,0,0));

        if(glTexture != nullptr)
        {
            
            muVideoEffect.lock();
            int enableopenCL = videoEffectParameter.enableOpenCL;
            muVideoEffect.unlock();
            
            int inverted = 1;
            int x = (width - glTexture->GetWidth()) / 2;
            int y = (height  - glTexture->GetHeight()) / 2;
            if(openclContext->IsSharedContextCompatible())
                inverted = 0;
               
            if(!enableopenCL)
                inverted = 1;
                
            if(isffmpegDecode)
                inverted = 1;
                
            //printf("Inverted %d Enable OpenCL %d \n",inverted, enableopenCL);
            printf("flipH : %d flipV : %d inverted : %d \n", flipH, flipV, inverted);
            muVideoEffect.lock();
            renderBitmapOpenGL->RenderWithEffect(x,y, glTexture, &videoEffectParameter, flipH, flipV, inverted);
            printf("Rotation : %d \n",videoEffectParameter.rotation);
            muVideoEffect.unlock();
            
             
        }
//.........这里部分代码省略.........
开发者ID:jfiguinha,项目名称:Regards,代码行数:101,代码来源:VideoControl_soft.cpp


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