rendered_textures(GLsizei tex_side)
	{

		for(GLuint i=0; i<2u; ++i)
		{
			texture_name tex = texs[i];

			gl.active_texture(GL.texture0+i);
			gl.bind(GL.texture_2d, tex);
			gl.texture_min_filter(GL.texture_2d, GL.linear);
			gl.texture_mag_filter(GL.texture_2d, GL.linear);
			gl.texture_image_2d(
				GL.texture_2d,
				0,
				GL.rgb, 
				tex_side, tex_side,
				0,
				GL.rgb,
				GL.unsigned_byte,
				const_memory_block()
			);

			renderbuffer_name rbo = rbos[i];

			gl.bind(GL.renderbuffer, rbo);
			gl.renderbuffer_storage(
				GL.renderbuffer,
				GL.depth_component,
				tex_side, tex_side
			);

			framebuffer_name fbo = fbos[i];

			gl.bind(GL.draw_framebuffer, fbo);
			gl.framebuffer_texture_2d(
				GL.draw_framebuffer,
				GL.color_attachment0,
				GL.texture_2d,
				tex, 0
			);
			gl.framebuffer_renderbuffer(
				GL.draw_framebuffer,
				GL.depth_attachment,
				GL.renderbuffer,
				rbo
			);

			gl.viewport(tex_side, tex_side);
			gl.clear(GL.color_buffer_bit);
		}

		gl.bind(GL.draw_framebuffer, default_framebuffer);
		gl.bind(GL.renderbuffer, no_renderbuffer);
	}
示例#2
0
	void init(const texture_image_file& image_data)
	{
		gl.bind(GL.texture_2d, *this);
		gl.texture_min_filter(GL.texture_2d, GL.nearest);
		gl.texture_mag_filter(GL.texture_2d, GL.nearest);
		gl.texture_wrap(
			GL.texture_2d,
			GL.texture_wrap_s,
			GL.repeat
		);
		gl.texture_image_2d(GL.texture_2d, image_data.spec());
	}