예제 #1
0
	void copy_from(buffer& source)
	{
		source.unmap();
		source.bind();
		GL(glBindTexture(GL_TEXTURE_2D, id_));
		GL(glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, width_, height_, FORMAT[stride_], TYPE[stride_], NULL));
		GL(glBindTexture(GL_TEXTURE_2D, 0));
		source.unbind();
		source.map(); // Just map it back since map will orphan buffer.
	}
예제 #2
0
	void copy_to(buffer& dest)
	{
		dest.unmap();
		dest.bind();
		GL(glBindTexture(GL_TEXTURE_2D, id_));
		GL(glReadBuffer(GL_COLOR_ATTACHMENT0));
		GL(glReadPixels(0, 0, width_, height_, FORMAT[stride_], TYPE[stride_], NULL));
		GL(glBindTexture(GL_TEXTURE_2D, 0));
		dest.unbind();
		GL(glFlush());
	}
예제 #3
0
파일: GLHelpers.cpp 프로젝트: AniLeo/rpcs3
	void fbo::draw_elements(const buffer& buffer_, rsx::primitive_type mode, GLsizei count, indices_type type, const buffer& indices, size_t indices_buffer_offset) const
	{
		buffer_.bind(buffer::target::array);
		draw_elements(mode, count, type, indices, indices_buffer_offset);
	}
예제 #4
0
파일: GLHelpers.cpp 프로젝트: AniLeo/rpcs3
	void fbo::draw_elements(rsx::primitive_type mode, GLsizei count, indices_type type, const buffer& indices, size_t indices_buffer_offset) const
	{
		indices.bind(buffer::target::element_array);
		glDrawElements(draw_mode(mode), count, (GLenum)type, (GLvoid*)indices_buffer_offset);
	}
예제 #5
0
파일: GLHelpers.cpp 프로젝트: AniLeo/rpcs3
	void fbo::draw_elements(const buffer& buffer, rsx::primitive_type mode, GLsizei count, indices_type type, const GLvoid *indices) const
	{
		buffer.bind(buffer::target::array);
		glDrawElements(draw_mode(mode), count, (GLenum)type, indices);
	}
예제 #6
0
파일: GLHelpers.cpp 프로젝트: AniLeo/rpcs3
	void fbo::draw_arrays(const buffer& buffer, rsx::primitive_type mode, GLsizei count, GLint first) const
	{
		buffer.bind(buffer::target::array);
		draw_arrays(mode, count, first);
	}