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


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

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


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

示例1: scope

void
Canvas::DrawClippedText(int x, int y,
                        unsigned width, unsigned height,
                        const TCHAR *text)
{
  assert(text != nullptr);
  assert(ValidateUTF8(text));

#ifdef HAVE_GLES
  assert(offset == OpenGL::translate);
#endif

  if (font == nullptr)
    return;

  GLTexture *texture = TextCache::Get(*font, text);
  if (texture == nullptr)
    return;

  if (texture->GetHeight() < height)
    height = texture->GetHeight();
  if (texture->GetWidth() < width)
    width = texture->GetWidth();

  PrepareColoredAlphaTexture(text_color);

#ifndef USE_GLSL
  GLEnable scope(GL_TEXTURE_2D);
#endif

  const GLBlend blend(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

  texture->Bind();
  texture->Draw(x, y, width, height, 0, 0, width, height);
}
开发者ID:Adrien81,项目名称:XCSoar,代码行数:35,代码来源:Canvas.cpp

示例2: Stretch

void
Canvas::Stretch(int dest_x, int dest_y,
                unsigned dest_width, unsigned dest_height,
                const GLTexture &texture)
{
  Stretch(dest_x, dest_y, dest_width, dest_height,
          texture, 0, 0, texture.GetWidth(), texture.GetHeight());
}
开发者ID:Adrien81,项目名称:XCSoar,代码行数:8,代码来源:Canvas.cpp

示例3: Stretch

void
Canvas::Stretch(PixelScalar dest_x, PixelScalar dest_y,
                UPixelScalar dest_width, UPixelScalar dest_height,
                const GLTexture &texture)
{
  Stretch(dest_x, dest_y, dest_width, dest_height,
          texture, 0, 0, texture.GetWidth(), texture.GetHeight());
}
开发者ID:damianob,项目名称:xcsoar,代码行数:8,代码来源:Canvas.cpp

示例4: scope

void
Canvas::TextClipped(PixelScalar x, PixelScalar y,
                    UPixelScalar width, UPixelScalar height,
                    const TCHAR *text)
{
  assert(text != NULL);
  assert(ValidateUTF8(text));

#ifdef HAVE_GLES
  assert(x_offset == OpenGL::translate_x);
  assert(y_offset == OpenGL::translate_y);
#endif

  if (font == NULL)
    return;

  GLTexture *texture = TextCache::Get(font, text);
  if (texture == NULL)
    return;

  GLEnable scope(GL_TEXTURE_2D);
  texture->Bind();
  GLLogicOp logic_op(GL_AND_INVERTED);

  if (texture->GetHeight() < height)
    height = texture->GetHeight();
  if (texture->GetWidth() < width)
    width = texture->GetWidth();

  /* cut out the shape in black */
  OpenGL::glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
  texture->Draw(x, y, width, height, 0, 0, width, height);

  if (text_color != COLOR_BLACK) {
    /* draw the text color on top */
    OpenGL::glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
    logic_op.set(GL_OR);
    text_color.Set();
    texture->Draw(x, y, width, height, 0, 0, width, height);
  }
}
开发者ID:damianob,项目名称:xcsoar,代码行数:41,代码来源:Canvas.cpp

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