void RAS_OpenGLRasterizer::RenderText3D(
        int fontid, const char *text, int size, int dpi,
        const float color[4], const double mat[16], float aspect)
{
	/* gl prepping */
	DisableForText();

	/* the actual drawing */
	glColor4fv(color);

	/* multiply the text matrix by the object matrix */
	BLF_enable(fontid, BLF_MATRIX|BLF_ASPECT);
	BLF_matrix(fontid, mat);

	/* aspect is the inverse scale that allows you to increase */
	/* your resolution without sizing the final text size      */
	/* the bigger the size, the smaller the aspect	           */
	BLF_aspect(fontid, aspect, aspect, aspect);

	BLF_size(fontid, size, dpi);
	BLF_position(fontid, 0, 0, 0);
	BLF_draw(fontid, text, 65535);

	BLF_disable(fontid, BLF_MATRIX|BLF_ASPECT);
}
Ejemplo n.º 2
0
void GPC_RenderTools::RenderText3D(	int fontid,
									const char* text,
									int size,
									int dpi,
									float* color,
									double* mat,
									float aspect)
{
	/* the actual drawing */
	glColor3fv(color);
 
	/* multiply the text matrix by the object matrix */
	BLF_enable(fontid, BLF_MATRIX|BLF_ASPECT);
	BLF_matrix(fontid, mat);

	/* aspect is the inverse scale that allows you to increase */
	/* your resolution without sizing the final text size */
	/* the bigger the size, the smaller the aspect	*/
	BLF_aspect(fontid, aspect, aspect, aspect);

	BLF_size(fontid, size, dpi);
	BLF_position(fontid, 0, 0, 0);
	BLF_draw(fontid, (char *)text, strlen(text));

	BLF_disable(fontid, BLF_MATRIX|BLF_ASPECT);
	glEnable(GL_DEPTH_TEST);
}
Ejemplo n.º 3
0
void GPC_RenderTools::RenderText3D(	int fontid,
									const char* text,
									int size,
									int dpi,
									float* color,
									double* mat,
									float aspect)
{
	if(GLEW_ARB_multitexture) {
		for(int i=0; i<MAXTEX; i++) {
			glActiveTextureARB(GL_TEXTURE0_ARB+i);

			if(GLEW_ARB_texture_cube_map)
				if(glIsEnabled(GL_TEXTURE_CUBE_MAP_ARB))
					glDisable(GL_TEXTURE_CUBE_MAP_ARB);

			if(glIsEnabled(GL_TEXTURE_2D))
				glDisable(GL_TEXTURE_2D);
		}

		glActiveTextureARB(GL_TEXTURE0_ARB);
	}
	else {
		if(GLEW_ARB_texture_cube_map)
			if(glIsEnabled(GL_TEXTURE_CUBE_MAP_ARB))
				glDisable(GL_TEXTURE_CUBE_MAP_ARB);

		if(glIsEnabled(GL_TEXTURE_2D))
			glDisable(GL_TEXTURE_2D);
	}

	/* the actual drawing */
	glColor4fv(color);
 
	/* multiply the text matrix by the object matrix */
	BLF_enable(fontid, BLF_MATRIX|BLF_ASPECT);
	BLF_matrix(fontid, mat);

	/* aspect is the inverse scale that allows you to increase */
	/* your resolution without sizing the final text size */
	/* the bigger the size, the smaller the aspect	*/
	BLF_aspect(fontid, aspect, aspect, aspect);

	BLF_size(fontid, size, dpi);
	BLF_position(fontid, 0, 0, 0);
	BLF_draw(fontid, text, 65535);

	BLF_disable(fontid, BLF_MATRIX|BLF_ASPECT);
	glEnable(GL_DEPTH_TEST);
}
Ejemplo n.º 4
0
/* Print 3D text */
void BL_print_game_line(int fontid, const char *text, int size, int dpi, float *color, double *mat, float aspect)
{
	/* gl prepping */
	DisableForText();

	/* the actual drawing */
	glColor4fv(color);

	/* multiply the text matrix by the object matrix */
	BLF_enable(fontid, BLF_MATRIX|BLF_ASPECT);
	BLF_matrix(fontid, mat);

	/* aspect is the inverse scale that allows you to increase */
	/* your resolution without sizing the final text size      */
	/* the bigger the size, the smaller the aspect	           */
	BLF_aspect(fontid, aspect, aspect, aspect);

	BLF_size(fontid, size, dpi);
	BLF_position(fontid, 0, 0, 0);
	BLF_draw(fontid, (char *)text, 65535);

	BLF_disable(fontid, BLF_MATRIX|BLF_ASPECT);
}