コード例 #1
0
ファイル: r1_softz.cpp プロジェクト: pgrawehr/golgotha
	virtual void render_poly(int t_verts, r1_vert * verts)
	{
		render_lines(t_verts-1, verts);
		r1_vert l[2];
		l[0]=verts[0];
		l[1]=verts[t_verts-1];
		render_lines(1, l);
	}
コード例 #2
0
ファイル: HgeHelpers.cpp プロジェクト: treeman/Rejection
void hgeh::render_circle_slice( HGE *hge, float x, float y, float radius, int segments, float begin, float end, DWORD color )
{
	const float increment = ( end - begin ) / segments;
	float theta = begin;
	
	const Vec2D center( x, y );
	
	typedef std::vector<Vec2D> Positions;
	Positions positions;
	for( int i = 0; i < segments + 1; ++i )
	{
		Vec2D p = Vec2D( std::cos( theta ), std::sin( theta ) );
		p *= radius;
		p += center;
		positions.push_back( p );
		theta += increment;
	}
	
	render_lines( hge, positions, color );
	
	Vec2D first = Vec2D( std::cos( begin ), std::sin( begin ) ) * radius + center;
	Vec2D last = Vec2D( std::cos( end ), std::sin( end ) ) * radius + center;
	//-1 correct point
	hge->Gfx_RenderLine( center.x - 1, center.y, first.x, first.y, color );
	hge->Gfx_RenderLine( center.x, center.y, last.x, last.y, color );
}
コード例 #3
0
ファイル: TextRenderer.cpp プロジェクト: Makman2/CE3D2
    void
    TextRenderer::render()
    {
        if (!m_Target)
        {
            throw std::logic_error("No render target set! Use `set_target` to "
                                   "link a target surface to this renderer.");
        }

        render_points();
        render_lines();
    }
コード例 #4
0
ファイル: HgeHelpers.cpp プロジェクト: treeman/Rejection
void hgeh::render_circle( HGE *hge, float x, float y, float radius, int segments, DWORD color )
{
	const float increment = math::PI2 / segments;
	float theta = 0.0f;
	
	const Vec2D center( x, y );
	
	typedef std::vector<Vec2D> Positions;
	Positions positions;
	for( int i = 0; i < segments; ++i )
	{
		Vec2D p = Vec2D( std::cos( theta ), std::sin( theta ) );
		p *= radius;
		p += center;
		positions.push_back( p );
		theta += increment;
	}
	
	render_lines( hge, positions, color, true );
}