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


C++ color::getD3DCOLOR方法代码示例

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


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

示例1:

	void CDX9Renderer::Line(point p1, point p2, const color& c1, const color& c2)
	{
		// No support for textured lines
		SetTexture(NULL);

		BeginBatch(batch_lines);
		CBatch_Draw* draw_op = reinterpret_cast<CBatch_Draw*>(batch.back());

		AddVertex(c1.getD3DCOLOR(), p1, 0.0f, 0.0f);
		AddVertex(c2.getD3DCOLOR(), p2, 1.0f, 1.0f);
		draw_op->vertex_count += 2;
	}
开发者ID:segafan,项目名称:Construct-classic,代码行数:12,代码来源:CDX9Renderer_Batch.cpp

示例2: q

	void CDX9Renderer::Box(const rect& r, cr_float angle, point hotspot, const color& c)
	{
		// No support for textured lines
		SetTexture(NULL);

		quad q((r - hotspot).rotate_to_quad(angle, r.topleft()));

		BeginBatch(batch_linestrip);
		CBatch_Draw* draw_op = reinterpret_cast<CBatch_Draw*>(batch.back());

		D3DCOLOR color = c.getD3DCOLOR();

		// 4 vertices and use 5th index to repeat first vertex closing the strip as a box
		AddVertex(color, q.tl, 0.0f, 0.0f);
		AddVertex(color, q.tr, 0.0f, 0.0f);
		AddVertex(color, q.br, 0.0f, 0.0f);
		AddVertex(color, q.bl, 0.0f, 0.0f);

		unsigned short index = draw_op->vertex_count;
		AddIndex(index);
		AddIndex(index + 1);
		AddIndex(index + 2);
		AddIndex(index + 3);
		AddIndex(index);

		draw_op->vertex_count += 4;
		draw_op->index_count += 5;
	}
开发者ID:segafan,项目名称:Construct-classic,代码行数:28,代码来源:CDX9Renderer_Batch.cpp

示例3: error

	// Draw quad
	void CDX9Renderer::Quad(const quad& q, const color& filter, const rect* _uv)
	{
		if (current_texture != NULL && current_texture == current_rendertarget)
			throw error(_T("Illegal rendering operation attempted"), E_FAIL);	// Not allowed to draw with texture being the render target

		BeginBatch(batch_quads);

		CBatch_Draw* draw_op = reinterpret_cast<CBatch_Draw*>(batch.back());

		rect uv;

		// No texture: UV coords don't matter
		if (current_texture == NULL)
			uv = zero_rect;
		else {
			
			// Texture supplied but no UV given: draw entire texture
			if (_uv == NULL)
				uv = point(current_texture->xf, current_texture->yf).make_rect();
			else
				uv = (*_uv) * point(current_texture->xf, current_texture->yf);
	
		}

		D3DCOLOR c = filter.getD3DCOLOR();

		AddVertex(c, q.tl + point(state.x_skew, 0.0),			uv.topleft());
		AddVertex(c, q.tr + point(state.x_skew, state.y_skew),	uv.topright());
		AddVertex(c, q.bl,										uv.bottomleft());
		AddVertex(c, q.br + point(0.0, state.y_skew),			uv.bottomright());

		unsigned short index = draw_op->vertex_count;
		AddIndex(index);
		AddIndex(index + 1);
		AddIndex(index + 2);
		AddIndex(index + 2);
		AddIndex(index + 1);
		AddIndex(index + 3);

		draw_op->vertex_count += 4;
		draw_op->index_count += 6;
	}
开发者ID:segafan,项目名称:Construct-classic,代码行数:43,代码来源:CDX9Renderer_Batch.cpp


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