本文整理汇总了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();
}
//.........这里部分代码省略.........