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


C++ FTPoint类代码示例

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


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

示例1: ftglGetGlyphBBox

void ftglGetGlyphBBox(FTGLglyph *g, float bounds[6])
{
    FTBBox ret = _ftglGetGlyphBBox(g);
    FTPoint lower = ret.Lower(), upper = ret.Upper();
    bounds[0] = lower.Xf(); bounds[1] = lower.Yf(); bounds[2] = lower.Zf();
    bounds[3] = upper.Xf(); bounds[4] = upper.Yf(); bounds[5] = upper.Zf();
}
开发者ID:Felipeasg,项目名称:workbench,代码行数:7,代码来源:FTGlyphGlue.cpp

示例2: ftgGetlLayoutBBox

void ftgGetlLayoutBBox(FTGLlayout *l, const char * s, float c[6])
{
    FTBBox ret = _ftgGetlLayoutBBox(l, s);
    FTPoint lower = ret.Lower(), upper = ret.Upper();
    c[0] = lower.Xf(); c[1] = lower.Yf(); c[2] = lower.Zf();
    c[3] = upper.Xf(); c[4] = upper.Yf(); c[5] = upper.Zf();
}
开发者ID:hsmith,项目名称:ftgl,代码行数:7,代码来源:FTLayoutGlue.cpp

示例3: glGetFloatv

void FTPolygonGlyphImpl::DoRender()
{
    GLfloat colors[4];
    
    const FTMesh *mesh = vectoriser->GetMesh();

    for(unsigned int t = 0; t < mesh->TesselationCount(); ++t)
    {
        const FTTesselation* subMesh = mesh->Tesselation(t);
        unsigned int polygonType = subMesh->PolygonType();
        
        glGetFloatv(GL_CURRENT_COLOR, colors);
        glBindTexture(GL_TEXTURE_2D, 0);
        
        ftglBegin(polygonType);
        ftglColor4f(colors[0], colors[1], colors[2], colors[3]);
        for(unsigned int i = 0; i < subMesh->PointCount(); ++i)
        {
            FTPoint point = subMesh->Point(i);
            ftglTexCoord2f(point.Xf() / hscale, point.Yf() / vscale);
            ftglVertex3f(point.Xf() / 64.0f, point.Yf() / 64.0f, 0.0f);
        }
        ftglEnd();
    }
}
开发者ID:xahgo,项目名称:tama,代码行数:25,代码来源:FTPolygonGlyph.cpp

示例4: glNormal3f

void FTExtrudeGlyphImpl::RenderFront()
{
    vectoriser->MakeMesh(1.0, 1, frontOutset);
    glNormal3f(0.0, 0.0, 1.0);
    
    GLfloat colors[4];
    
    const FTMesh *mesh = vectoriser->GetMesh();
    for(unsigned int j = 0; j < mesh->TesselationCount(); ++j)
    {
        const FTTesselation* subMesh = mesh->Tesselation(j);
        unsigned int polygonType = subMesh->PolygonType();

        glGetFloatv(GL_CURRENT_COLOR, colors);
        glBindTexture(GL_TEXTURE_2D, 0);
        
        ftglBegin(polygonType);
        
        ftglColor4f(colors[0], colors[1], colors[2], colors[3]);
            for(unsigned int i = 0; i < subMesh->PointCount(); ++i)
            {
                FTPoint pt = subMesh->Point(i);

                ftglTexCoord2f(pt.Xf() / hscale,
                             pt.Yf() / vscale);

                ftglVertex3f(pt.Xf() / 64.0f,
                           pt.Yf() / 64.0f,
                           0.0f);
            }
        ftglEnd();
    }
}
开发者ID:JackFan-Z,项目名称:ftgles,代码行数:33,代码来源:FTExtrudeGlyph.cpp

示例5: glNormal3d

void FTExtrudeGlyphImpl::RenderFront()
{
    vectoriser->MakeMesh(1.0, 1, frontOutset);
    glNormal3d(0.0, 0.0, 1.0);

    const FTMesh *mesh = vectoriser->GetMesh();
    for(unsigned int j = 0; j < mesh->TesselationCount(); ++j)
    {
        const FTTesselation* subMesh = mesh->Tesselation(j);
        unsigned int polygonType = subMesh->PolygonType();

        glBegin(polygonType);
            for(unsigned int i = 0; i < subMesh->PointCount(); ++i)
            {
                FTPoint pt = subMesh->Point(i);

                glTexCoord2f(pt.Xf() / hscale,
                             pt.Yf() / vscale);

                glVertex3f(pt.Xf() / 64.0f,
                           pt.Yf() / 64.0f,
                           0.0f);
            }
        glEnd();
    }
}
开发者ID:CombustibleLemonade,项目名称:AI,代码行数:26,代码来源:FTExtrudeGlyph.cpp

示例6: ftglGetFontBBox

void ftglGetFontBBox(FTGLfont *f, const char* s, int len, float c[6])
{
    FTBBox ret = _ftglGetFontBBox(f, s, len);
    FTPoint lower = ret.Lower(), upper = ret.Upper();
    c[0] = lower.Xf(); c[1] = lower.Yf(); c[2] = lower.Zf();
    c[3] = upper.Xf(); c[4] = upper.Yf(); c[5] = upper.Zf();
}
开发者ID:mcodegeeks,项目名称:OpenKODE-Framework,代码行数:7,代码来源:FTFontGlue.cpp

示例7: ftglRenderGlyph

void ftglRenderGlyph(FTGLglyph *g, FTGL_DOUBLE penx, FTGL_DOUBLE peny,
                     int renderMode, FTGL_DOUBLE *advancex,
                     FTGL_DOUBLE *advancey)
{
    FTPoint pen(penx, peny);
    FTPoint ret = _ftglRenderGlyph(g, pen, renderMode);
    *advancex = ret.X();
    *advancey = ret.Y();
}
开发者ID:Felipeasg,项目名称:workbench,代码行数:9,代码来源:FTGlyphGlue.cpp

示例8: MeasureText

 Gwen::Point Chowdren::MeasureText( Gwen::Font* pFont,
     const Gwen::UnicodeString & text )
 {
     FTSimpleLayout layout;
     layout.SetLineLength(10000);
     layout.SetFont(get_font(pFont->size));
     FTBBox bbox = layout.BBox(text.c_str());
     FTPoint size = bbox.Upper() - bbox.Lower();
     return Gwen::Point((int)ceil(size.X()), (int)ceil(size.Y()));
 }
开发者ID:joaormatos,项目名称:anaconda,代码行数:10,代码来源:GwenChowdrenRender.cpp

示例9: switch

void OgreFTPolygonGlyphImpl::DoRender(const FTPoint& pen)
{    
    vectoriser->MakeMesh(1.0, 1, outset);

    const FTMesh *mesh = vectoriser->GetMesh();
    
    for(unsigned int t = 0; t < mesh->TesselationCount(); ++t)
    {
        const FTTesselation* subMesh = mesh->Tesselation(t);
        unsigned int polygonType = subMesh->PolygonType();
        
        Ogre::RenderOperation renderOperation;
        switch (polygonType) {
            case GL_TRIANGLE_STRIP:
                renderOperation.operationType = Ogre::RenderOperation::OT_TRIANGLE_STRIP;
                break;
            case GL_TRIANGLE_FAN:
                renderOperation.operationType = Ogre::RenderOperation::OT_TRIANGLE_FAN;
                break;
        }
        
        
        manualObject->begin("BaseWhite", renderOperation.operationType);
        for(unsigned int i = 0; i < subMesh->PointCount(); ++i)
        {
            FTPoint point = subMesh->Point(i);
            manualObject->index(i);
            manualObject->textureCoord(pen.Xf() + (point.Xf() / hscale), pen.Yf() + (point.Yf() / vscale));
            manualObject->position(pen.Xf() + (point.Xf() / 64.0f), pen.Yf() + (point.Yf() / 64.0f), 0.0f);   
        }
        manualObject->end();
    }
}
开发者ID:Ramedlaw,项目名称:ogreftgl,代码行数:33,代码来源:OgreFTPolygonGlyph.cpp

示例10: FTGlyph

FTPolyGlyph::FTPolyGlyph( FT_GlyphSlot glyph, bool useDisplayList)
:   FTGlyph( glyph),
    glList(0)
{
    if( ft_glyph_format_outline != glyph->format)
    {
        err = 0x14; // Invalid_Outline
        return;
    }

    FTVectoriser vectoriser( glyph);

    if(( vectoriser.ContourCount() < 1) || ( vectoriser.PointCount() < 3))
    {
        return;
    }
    
    unsigned int horizontalTextureScale = glyph->face->size->metrics.x_ppem * 64;
    unsigned int verticalTextureScale = glyph->face->size->metrics.y_ppem * 64;        
        
    vectoriser.MakeMesh( 1.0);
    
    if( useDisplayList)
    {
        glList = glGenLists( 1);
        glNewList( glList, GL_COMPILE);
    }

    const FTMesh* mesh = vectoriser.GetMesh();
    for( unsigned int index = 0; index < mesh->TesselationCount(); ++index)
    {
        const FTTesselation* subMesh = mesh->Tesselation( index);
        unsigned int polyonType = subMesh->PolygonType();

        glBegin( polyonType);
            for( unsigned int pointIndex = 0; pointIndex < subMesh->PointCount(); ++pointIndex)
            {
                FTPoint point = subMesh->Point(pointIndex);
                
                glTexCoord2f( point.X() / horizontalTextureScale,
                              point.Y() / verticalTextureScale);
                
                glVertex3f( point.X() / 64.0f,
                            point.Y() / 64.0f,
                            0.0f);
            }
        glEnd();
    }

    if(useDisplayList)
    {
        glEndList();
    }
}
开发者ID:Gi133,项目名称:NetworkingCoursework,代码行数:54,代码来源:FTPolyGlyph.cpp

示例11: testSetters

        void testSetters()
        {
            FTPoint point;
            FTPoint point1(1, 2, 3);

            point.X(1);
            point.Y(2);
            point.Z(3);

            CPPUNIT_ASSERT(point == point1);
        }
开发者ID:pjohalloran,项目名称:gameframework,代码行数:11,代码来源:FTPoint-Test.cpp

示例12: printText

void cFont::printText(LPCSTR text, FTPoint textPos, colour3f textColour)
{
	glPushMatrix();

	glTranslatef(textPos.X(), textPos.Y(), 0);
	glScalef(1, -1, 1);
	glColor3f(textColour.r, textColour.g, textColour.b);
	theFont->Render(text);

	glPopMatrix();
}
开发者ID:Baranzo94,项目名称:GP3-Coursework,代码行数:11,代码来源:cFont.cpp

示例13: switch

/**\brief Internal rendering function.*/
int Font::RenderInternal( int x, int y, const string& text, int h, XPos xpos, YPos ypos) {
    int xn = 0;
    int yn = 0;

    switch( xpos ) {
    case LEFT:
        xn = x;
        break;
    case CENTER:
        xn = x - this->TextWidth(text) / 2;
        break;
    case RIGHT:
        xn=x-this->TextWidth(text);
        break;
    default:
        LogMsg(ERR, "Invalid xpos");
        assert(0);
    }

    // Y coordinates are flipped
    switch( ypos ) {
    case TOP:
        yn = -y - h - TO_INT(floor(this->font->Descender()));
        break;
    case MIDDLE:
        yn = -y - h / 2 - TO_INT(floor(this->font->Descender()));
        break;
    case BOTTOM:
        yn = -y - TO_INT(floor(this->font->Descender()));
        break;
    default:
        LogMsg(ERR, "Invalid ypos");
        assert(0);
    }

    glColor4f( r, g, b, a );
    glEnable(GL_TEXTURE_2D);
    glEnable(GL_BLEND);
    glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
    glPushMatrix(); // to save the current matrix
    glScalef(1, -1, 1);
    FTPoint newpoint = this->font->Render( text.c_str(), -1, FTPoint( xn, yn, 1) );
    glPopMatrix(); // restore the previous matrix
    glDisable(GL_TEXTURE_2D);
    glDisable(GL_BLEND);

    return TO_INT(ceil(newpoint.Xf())) - x;
}
开发者ID:knowknowledge,项目名称:Epiar,代码行数:49,代码来源:font.cpp

示例14: FTGlyph

FTOutlineGlyph::FTOutlineGlyph( FT_GlyphSlot glyph, bool useDisplayList)
:   FTGlyph( glyph),
    glList(0)
{
  if( ft_glyph_format_outline != glyph->format)
  {
    err = 0x14; // Invalid_Outline
    return;
  }

  FTVectoriser vectoriser( glyph);

  size_t numContours = vectoriser.ContourCount();
  if ( ( numContours < 1) || ( vectoriser.PointCount() < 3))
  {
    return;
  }

  if(useDisplayList)
  {
    // Check if we are out of display lists
    if (glList == 0)
    {
      useDisplayList = false;
    }
    else
      glNewList( glList, GL_COMPILE);
  }

  for( unsigned int c = 0; c < numContours; ++c)
  {
    const FTContour* contour = vectoriser.Contour(c);

    glBegin( GL_LINE_LOOP);
    for( unsigned int pointIndex = 0; pointIndex < contour->PointCount(); ++pointIndex)
    {
      FTPoint point = contour->Point(pointIndex);
      glVertex2f( point.X() / 64.0f, point.Y() / 64.0f);
    }
    glEnd();
  }

  if(useDisplayList)
  {
    glEndList();
  }
}
开发者ID:f2re,项目名称:diana_mod,代码行数:47,代码来源:FTOutlineGlyph.cpp

示例15: glBegin

void FTOutlineGlyphImpl::DoRender()
{
    for(unsigned int c = 0; c < vectoriser->ContourCount(); ++c)
    {
        const FTContour* contour = vectoriser->Contour(c);

        glBegin(GL_LINE_LOOP);
        for(unsigned int i = 0; i < contour->PointCount(); ++i)
        {
            FTPoint point = FTPoint(contour->Point(i).X() + contour->Outset(i).X() * outset,
                                    contour->Point(i).Y() + contour->Outset(i).Y() * outset,
                                    0);
            glVertex2f(point.Xf() / 64.0f, point.Yf() / 64.0f);
        }
        glEnd();
    }
}
开发者ID:joaocc,项目名称:ta3d-git,代码行数:17,代码来源:FTOutlineGlyph.cpp


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