Exemplo n.º 1
0
void draw_outlines(struct ft2_source *srcdata)
{
	// Horrible (hopefully temporary) solution for outlines.
	uint32_t *tmp;

	struct gs_vb_data *vdata = gs_vertexbuffer_get_data(srcdata->vbuf);

	if (!srcdata->text)
		return;

	tmp = vdata->colors;
	vdata->colors = srcdata->colorbuf;

	gs_matrix_push();
	for (int32_t i = 0; i < 8; i++) {
		gs_matrix_translate3f(offsets[i * 2], offsets[(i * 2) + 1],
			0.0f);
		draw_uv_vbuffer(srcdata->vbuf, srcdata->tex,
			srcdata->draw_effect,
			(uint32_t)wcslen(srcdata->text) * 6);
	}
	gs_matrix_identity();
	gs_matrix_pop();

	vdata->colors = tmp;
}
Exemplo n.º 2
0
static void ft2_source_render(void *data, gs_effect_t effect)
{
	struct ft2_source *srcdata = data;
	if (srcdata == NULL) return;

	if (srcdata->tex == NULL || srcdata->vbuf == NULL) return;

	gs_reset_blend_state();
	if (srcdata->outline_text) draw_outlines(srcdata);
	if (srcdata->drop_shadow) draw_drop_shadow(srcdata);

	draw_uv_vbuffer(srcdata->vbuf, srcdata->tex,
		srcdata->draw_effect, (uint32_t)wcslen(srcdata->text) * 6);

	UNUSED_PARAMETER(effect);
}
Exemplo n.º 3
0
void draw_drop_shadow(struct ft2_source *srcdata)
{
	// Horrible (hopefully temporary) solution for drop shadow.
	uint32_t *tmp;

	struct gs_vb_data *vdata = gs_vertexbuffer_get_data(srcdata->vbuf);
	tmp = vdata->colors;
	vdata->colors = srcdata->colorbuf;

	gs_matrix_push();
	gs_matrix_translate3f(4.0f, 4.0f, 0.0f);
	draw_uv_vbuffer(srcdata->vbuf, srcdata->tex,
		srcdata->draw_effect, (uint32_t)wcslen(srcdata->text) * 6);
	gs_matrix_identity();
	gs_matrix_pop();

	vdata->colors = tmp;
}