Пример #1
0
int rpcudp::sendto(const void* buf, size_t bufsize,
	int flag, const udpaddr& addr)
{
	_spinlock.lock();
	auto& client = _get_client(addr);
	_spinlock.unlock();

	const_shared_memory memory(
		deep_copy(const_memory_block(buf, bufsize)));
	return client.sendto(memory, addr);
}
Пример #2
0
	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);
	}
Пример #3
0
	const_memory_block block(void) const
	noexcept
	{
		return bool(_pimpl)?_pimpl->block():const_memory_block();
	}