Ejemplo n.º 1
0
static void toggle_debugstates(float* modelview)
{
	if (modelview){
		float white[3] = {1.0, 1.0, 1.0};
		glDepthMask(GL_FALSE);
		glDisable(GL_DEPTH_TEST);
		glEnableVertexAttribArray(ATTRIBUTE_VERTEX);
		agp_shader_activate(agp_default_shader(COLOR_2D));
		agp_shader_envv(MODELVIEW_MATR, modelview, sizeof(float) * 16);
		agp_shader_forceunif("obj_col", shdrvec3, (void*) white, false);
	}
	else{
		agp_shader_activate(agp_default_shader(COLOR_2D));
		glEnable(GL_DEPTH_TEST);
		glDepthMask(GL_TRUE);
		glDisableVertexAttribArray(ATTRIBUTE_VERTEX);
	}
}
Ejemplo n.º 2
0
static void toggle_debugstates(float* modelview)
{
	struct agp_fenv* env = agp_env();
	if (modelview){
		float white[3] = {1.0, 1.0, 1.0};
		env->depth_mask(GL_FALSE);
		env->disable(GL_DEPTH_TEST);
		env->enable_vertex_attrarray(ATTRIBUTE_VERTEX);
		agp_shader_activate(agp_default_shader(COLOR_2D));
		agp_shader_envv(MODELVIEW_MATR, modelview, sizeof(float) * 16);
		agp_shader_forceunif("obj_col", shdrvec3, (void*) white);
	}
	else{
		agp_shader_activate(agp_default_shader(COLOR_2D));
		env->enable(GL_DEPTH_TEST);
		env->depth_mask(GL_TRUE);
		env->disable_vertex_attrarray(ATTRIBUTE_VERTEX);
	}
}
Ejemplo n.º 3
0
void agp_activate_vstore_multi(struct storage_info_t** backing, size_t n)
{
	char buf[] = {'m', 'a', 'p', '_', 't', 'u', 0, 0, 0};
	struct agp_fenv* env = agp_env();

	for (int i = 0; i < n && i < 99; i++){
		env->active_texture(GL_TEXTURE0 + i);
		env->bind_texture(GL_TEXTURE_2D, backing[i]->vinf.text.glid);
		if (i < 10)
			buf[6] = '0' + i;
		else{
			buf[6] = '0' + (i / 10);
			buf[7] = '0' + (i % 10);
		}
		agp_shader_forceunif(buf, shdrint, &i);
	}

	env->active_texture(GL_TEXTURE0);
}
Ejemplo n.º 4
0
void agp_activate_vstore_multi(struct storage_info_t** backing, size_t n)
{
	char buf[] = "map_tu99";

	for (int i = 0; i < n && i < 99; i++){
		glActiveTexture(GL_TEXTURE0 + i);
		glBindTexture(GL_TEXTURE_2D, backing[i]->vinf.text.glid);
		if (i > 10){
			buf[6] = '0' + (i / 10);
			buf[7] = '0' + (i % 10);
			buf[8] = '\0';
		}
		else {
			buf[6] = '0' + i;
			buf[7] = '\0';
		}
		agp_shader_forceunif(buf, shdrint, &i, false);
	}

	glActiveTexture(GL_TEXTURE0);
}