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


C++ TextRenderer类代码示例

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


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

示例1: RedrawTextRenderer

static void RedrawTextRenderer(TextRenderer& txt_rndr, RectListRgn& r_lst, bool delayed)
{
    delayed ? 
        txt_rndr.DrawForRegionDelayed(r_lst) 
    :
        txt_rndr.DrawForRegion(r_lst);
}
开发者ID:cargabsj175,项目名称:bombono-dvd,代码行数:7,代码来源:text.cpp

示例2: UpdateScore

void UpdateScore(const unsigned int updated, TextRenderer &textRenderer,
                 std::vector<std::string> &strVec)
{
    textRenderer.RemoveText(*(strVec.begin() + 1));
    (*(strVec.begin() + 1)) = std::to_string(updated);

    textRenderer.AddTextVerticalAlign(strVec, TextRenderer::Alignment::Right,
                                      TextRenderer::Alignment::Top, 20);
}
开发者ID:Gooeybots,项目名称:Hackman,代码行数:9,代码来源:playgame.cpp

示例3: RedrawText

void RedrawText(TextRenderer& txt_rndr, bool delayed)
{
    RectListRgn r_lst;

    r_lst.push_back(txt_rndr.CalcCursorPlc());
    r_lst.push_back(txt_rndr.CalcTextPlc());

    //txt_rndr.DrawForRegion(r_lst);
    RedrawTextRenderer(txt_rndr, r_lst, delayed);
}
开发者ID:cargabsj175,项目名称:bombono-dvd,代码行数:10,代码来源:text.cpp

示例4: copySelectionOrAllToClipboard

void PediaMainForm::copySelectionOrAllToClipboard()
{
    TextRenderer* renderer = &infoRenderer_;
    if (showArticle == displayMode_)
        renderer = &articleRenderer_;
     
    if (renderer->empty())
        return;
    String text;
    renderer->copySelectionOrAll();
}
开发者ID:kjk,项目名称:ipedia-palm,代码行数:11,代码来源:MainForm.cpp

示例5: UpdateLives

bool UpdateLives(unsigned int &lives, TextRenderer &textRenderer,
                 std::vector<std::string> &strVec)
{
    textRenderer.RemoveText(*(strVec.begin() + 1));
    (*(strVec.begin() + 1)) = std::to_string(lives);
    textRenderer.AddTextHorizontalAlign(strVec, TextRenderer::Alignment::Right,
                                      TextRenderer::Alignment::Bottom, 20);
    if(lives == 0)
        return true;
    return false;
}
开发者ID:Gooeybots,项目名称:Hackman,代码行数:11,代码来源:playgame.cpp

示例6: TextRenderer

//---------------------------------------------------------------------------
void Choice::addItem(const std::string& item)
{
    choiceList.push_back(item);

    TextRenderer *t = new TextRenderer(item.c_str());
    choice_renders.push_back(t);

    int borderSpace = 12 * 2; // was border size

    rect.setSize(std::max( (t->getWidth() + borderSpace), rect.getWidth()),
                 TextRenderingSystem::line_height() );
}
开发者ID:BackupTheBerlios,项目名称:netpanzer-svn,代码行数:13,代码来源:Choice.cpp

示例7: QueryPerformanceCounter

void TestComponent::FixedUpdate()
{
  //m_transform.m_position += float2(time::GetDeltaTime(), time::GetDeltaTime()) * 100.0f;
  LARGE_INTEGER li = m_lastUpdate;
  QueryPerformanceCounter(&m_lastUpdate);
  float fups = 1.0f / ((float)(m_lastUpdate.QuadPart - li.QuadPart) / (float)(m_ticksPS.QuadPart));

  TextRenderer* t = (TextRenderer*)m_gameObject.GetComponent(TEXT_RENDERER);
  //m_transform.position = float2(10.f, 10.0f);

  char str[64];
  sprintf_s(str, "FUPS: %f ####", fups);
  t->SetString(str);
}
开发者ID:Lijmer,项目名称:Custom_Template,代码行数:14,代码来源:TestComponent.cpp

示例8: SetTimer

void PendingCursor::SetTimer(TextRenderer& txt_rndr)
{
    Data& dat = (Data&)txt_rndr;

    BoolFnr fnr = bb::bind(&PendingCursor::OnTimeout, this, &txt_rndr);
    dat.timer.Connect( fnr, int(CURSOR_PEND_PART*txt_rndr.CursBlinkTime()) );
}
开发者ID:cargabsj175,项目名称:bombono-dvd,代码行数:7,代码来源:text.cpp

示例9: yei_tareSensors

void PrioVR::renderCalibrationCountdown() {
#ifdef HAVE_PRIOVR
    const int COUNTDOWN_SECONDS = 3;
    int secondsRemaining = COUNTDOWN_SECONDS - _calibrationCountdownStarted.secsTo(QDateTime::currentDateTime());
    if (secondsRemaining == 0) {
        yei_tareSensors(_skeletalDevice);
        Application::getInstance()->disconnect(this);
        return;
    }
    static TextRenderer textRenderer(MONO_FONT_FAMILY, 18, QFont::Bold, false, TextRenderer::OUTLINE_EFFECT, 2);
    QByteArray text = "Assume T-Pose in " + QByteArray::number(secondsRemaining) + "...";
    textRenderer.draw((Application::getInstance()->getGLWidget()->width() - textRenderer.computeWidth(text.constData())) / 2,
        Application::getInstance()->getGLWidget()->height() / 2,
        text);
#endif  
}
开发者ID:Barnold1953,项目名称:hifi,代码行数:16,代码来源:PrioVR.cpp

示例10: InitGUI

//--------------------------------------------------------------------------------------
//
//--------------------------------------------------------------------------------------
void InitGUI()
{
    // Initialize dialogs
    g_SettingsDlg.Init(&g_DialogResourceManager);
    g_HUD.Init(&g_DialogResourceManager);
    g_HUD.SetCallback(OnGUIEvent);
    g_TextRenderer.Init(&g_DialogResourceManager);
    
    int iY = 10; 
    g_HUD.AddButton  (IDC_TOGGLEFULLSCREEN,   L"Toggle full screen" ,   35, iY, 160, 22);
    g_HUD.AddButton  (IDC_TOGGLEREF,          L"Toggle REF (F3)"    ,   35, iY += 24, 160, 22, VK_F3);
    g_HUD.AddButton  (IDC_CHANGEDEVICE,       L"Change device (F2)" ,   35, iY += 24, 160, 22, VK_F2);
    iY += 20;

    g_HUD.AddCheckBox(IDC_DEINTERLEAVE,     L"Deinterleaved Texturing", 35, iY += 28, 125, 22, g_UseDeinterleavedTexturing);
    g_HUD.AddCheckBox(IDC_RANDOMIZE,        L"Randomize Samples",       35, iY += 28, 125, 22, g_RandomizeSamples);
    g_HUD.AddCheckBox(IDC_BLUR_AO,          L"Blur AO",                 35, iY += 28, 125, 22, g_BlurAO);
    iY += 24;

    CDXUTComboBox *pComboBox;
    g_HUD.AddComboBox(IDC_CHANGESCENE,    35, iY += 24, 160, 22, 'M', false, &pComboBox);
    for (int i = 0; i < ARRAYSIZE(g_MeshDesc); i++)
    {
        pComboBox->AddItem(g_MeshDesc[i].Name, NULL);
    }
    iY += 24;

    WCHAR sz[100];
    int dy = 20;
    StringCchPrintf(sz, 100, UI_RADIUS_MULT L"%0.2f", g_AOParams.Radius); 
    g_HUD.AddStatic(IDC_RADIUS_STATIC, sz, 35, iY += dy, 125, 22);
    g_HUD.AddSlider(IDC_RADIUS_SLIDER, 50, iY += dy, 100, 22, 0, 100, int(g_AOParams.Radius / MAX_RADIUS_MULT * 100));

    StringCchPrintf(sz, 100, UI_AO_BIAS L"%g", g_AOParams.Bias); 
    g_HUD.AddStatic(IDC_BIAS_STATIC, sz, 35, iY += dy, 125, 22);
    g_HUD.AddSlider(IDC_BIAS_SLIDER, 50, iY += dy, 100, 22, 0, 500, int(g_AOParams.Bias * 1000));

    StringCchPrintf(sz, 100, UI_POW_EXPONENT L"%0.2f", g_AOParams.PowerExponent); 
    g_HUD.AddStatic(IDC_EXPONENT_STATIC, sz, 35, iY += dy, 125, 22);
    g_HUD.AddSlider(IDC_EXPONENT_SLIDER, 50, iY += dy, 100, 22, 0, 400, (int)(100.0f*g_AOParams.PowerExponent));

    StringCchPrintf(sz, 100, UI_BLUR_SHARPNESS L"%0.2f", g_AOParams.Blur.Sharpness); 
    g_HUD.AddStatic(IDC_BLUR_SHARPNESS_STATIC, sz, 35, iY += dy, 125, 22);
    g_HUD.AddSlider(IDC_BLUR_SHARPNESS_SLIDER, 50, iY += dy, 100, 22, 0, 1600, (int)(100.0f*g_AOParams.Blur.Sharpness));

    UINT ButtonGroup = 0;
    iY += 24;
    g_HUD.AddRadioButton( IDC_1xMSAA,       ButtonGroup, L"1X MSAA",                35, iY += 24, 125, 22,  (g_MSAACurrentSettings == MSAA_MODE_1X) );
    g_HUD.AddRadioButton( IDC_2xMSAA,       ButtonGroup, L"2X MSAA",                35, iY += 24, 125, 22,  (g_MSAACurrentSettings == MSAA_MODE_2X) );
    g_HUD.AddRadioButton( IDC_4xMSAA,       ButtonGroup, L"4X MSAA",                35, iY += 24, 125, 22,  (g_MSAACurrentSettings == MSAA_MODE_4X) );
    g_HUD.AddRadioButton( IDC_8xMSAA,       ButtonGroup, L"8X MSAA",                35, iY += 24, 125, 22,  (g_MSAACurrentSettings == MSAA_MODE_8X) );

    ++ButtonGroup;
    iY += 24;
    g_HUD.AddRadioButton( IDC_PER_PIXEL_AO,   ButtonGroup, L"PER_PIXEL_AO",         35, iY += 24, 125, 22,  (g_AOParams.Output.MSAAMode == GFSDK_SSAO_PER_PIXEL_AO) );
    g_HUD.AddRadioButton( IDC_PER_SAMPLE_AO,  ButtonGroup, L"PER_SAMPLE_AO",        35, iY += 24, 125, 22,  (g_AOParams.Output.MSAAMode == GFSDK_SSAO_PER_SAMPLE_AO) );
}
开发者ID:151706061,项目名称:D3DSamples,代码行数:60,代码来源:DeinterleavedTexturing.cpp

示例11: getBackgroundColor

void TextOverlay::render(RenderArgs* args) {
    if (!_visible) {
        return; // do nothing if we're not visible
    }

    const float MAX_COLOR = 255.0f;
    xColor backgroundColor = getBackgroundColor();
    glColor4f(backgroundColor.red / MAX_COLOR, backgroundColor.green / MAX_COLOR, backgroundColor.blue / MAX_COLOR, 
        getBackgroundAlpha());

    int left = _bounds.left();
    int right = _bounds.right() + 1;
    int top = _bounds.top();
    int bottom = _bounds.bottom() + 1;

    glm::vec2 topLeft(left, top);
    glm::vec2 bottomRight(right, bottom);
    DependencyManager::get<GeometryCache>()->renderQuad(topLeft, bottomRight);

    // Same font properties as textSize()
    TextRenderer* textRenderer = TextRenderer::getInstance(SANS_FONT_FAMILY, _fontSize, DEFAULT_FONT_WEIGHT);
    
    const int leftAdjust = -1; // required to make text render relative to left edge of bounds
    const int topAdjust = -2; // required to make text render relative to top edge of bounds
    int x = _bounds.left() + _leftMargin + leftAdjust;
    int y = _bounds.top() + _topMargin + topAdjust;
    
    glColor3f(_color.red / MAX_COLOR, _color.green / MAX_COLOR, _color.blue / MAX_COLOR);
    float alpha = getAlpha();
    QStringList lines = _text.split("\n");
    int lineOffset = 0;
    foreach(QString thisLine, lines) {
        if (lineOffset == 0) {
            lineOffset = textRenderer->calculateHeight(qPrintable(thisLine));
        }
        lineOffset += textRenderer->draw(x, y + lineOffset, qPrintable(thisLine), alpha);

        const int lineGap = 2;
        lineOffset += lineGap;
    }
}
开发者ID:ey6es,项目名称:hifi,代码行数:41,代码来源:TextOverlay.cpp

示例12: _maketextures

void NumberLabel::_maketextures()
{

    if(_num_objects==0) {
        cout << "make tex" << endl;

        _textures = new Texture[NUMBERLABEL_NUM_TEX];

        const char chars[] = NUMBERLABEL_CHARS;

        TextRenderer render;
        for( int i=0; i<NUMBERLABEL_NUM_TEX; ++i ) {
            stringstream s;
            s << chars[i];
            render.Text2Texture( _textures[i], s.str());
        }

    }
    _num_objects++;

}
开发者ID:A2-Collaboration,项目名称:PiGLET,代码行数:21,代码来源:NumberLabel.cpp

示例13: glViewport

/*static*/ status_t Overlay::drawInfoPage(
        const sp<IGraphicBufferProducer>& outputSurface) {
    status_t err;

    EglWindow window;
    err = window.createWindow(outputSurface);
    if (err != NO_ERROR) {
        return err;
    }
    window.makeCurrent();

    int width = window.getWidth();
    int height = window.getHeight();
    glViewport(0, 0, width, height);
    glDisable(GL_DEPTH_TEST);
    glDisable(GL_CULL_FACE);

    // Shaders for rendering.
    Program texProgram;
    err = texProgram.setup(Program::PROGRAM_TEXTURE_2D);
    if (err != NO_ERROR) {
        return err;
    }
    TextRenderer textRenderer;
    err = textRenderer.loadIntoTexture();
    if (err != NO_ERROR) {
        return err;
    }
    textRenderer.setScreenSize(width, height);

    doDrawInfoPage(window, texProgram, textRenderer);

    // Destroy the surface.  This causes a disconnect.
    texProgram.release();
    window.release();

    return NO_ERROR;
}
开发者ID:IllusionRom-deprecated,项目名称:android_platform_frameworks_av,代码行数:38,代码来源:Overlay.cpp

示例14: OnD3D11FrameRender

//--------------------------------------------------------------------------------------
// Callback function that renders the frame.  This function sets up the rendering 
// matrices and renders the scene and UI.
//--------------------------------------------------------------------------------------
void CALLBACK OnD3D11FrameRender(ID3D11Device* pd3dDevice, ID3D11DeviceContext* pd3dImmediateContext, 
                                 double fTime, float fElapsedTime, void* pUserContext)
{
    // If the settings dialog is being shown, then render it instead of rendering the app's scene
    if (g_SettingsDlg.IsActive())
    {
        g_SettingsDlg.OnRender(fElapsedTime);
        return;
    }

    // Reallocate the render targets and depth buffer if the MSAA mode has been changed in the GUI.
    if (g_RenderTargetsDirty)
    {
        g_RenderTargetsDirty = false;
        ResizeScreenSizedBuffers(pd3dDevice);
    }

    SceneMesh *pMesh = g_Scenes[g_CurrentSceneId].pMesh;

    g_AOParams.UseDeinterleavedTexturing = g_UseDeinterleavedTexturing;
    g_AOParams.RandomizeSamples = g_RandomizeSamples;
    g_AOParams.Blur.Enable = g_BlurAO;

    ID3D11RenderTargetView* pBackBufferRTV = DXUTGetD3D11RenderTargetView(); // does not addref

    if (pMesh)
    {
        RenderAOFromMesh(pd3dDevice, 
                         pd3dImmediateContext,
                         pBackBufferRTV,
                         pMesh);
    }

    //--------------------------------------------------------------------------------------
    // Render the GUI
    //--------------------------------------------------------------------------------------
    if (g_DrawUI)
    {
        g_HUD.OnRender(fElapsedTime);
        g_TextRenderer.OnRender(fElapsedTime);
    }
}
开发者ID:151706061,项目名称:D3DSamples,代码行数:46,代码来源:DeinterleavedTexturing.cpp

示例15: QuickMenuButtonRenderer

 explicit QuickMenuButtonRenderer(const DialogLook &_look,
                                  const TCHAR *_caption)
   :look(_look), caption(_caption) {
   text_renderer.SetCenter();
   text_renderer.SetVCenter();
   text_renderer.SetControl();
 }
开发者ID:Exadios,项目名称:xcsoar-exp,代码行数:7,代码来源:dlgQuickMenu.cpp


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