当前位置: 首页>>代码示例>>C++>>正文


C++ IOStream::writeFully方法代码示例

本文整理汇总了C++中IOStream::writeFully方法的典型用法代码示例。如果您正苦于以下问题:C++ IOStream::writeFully方法的具体用法?C++ IOStream::writeFully怎么用?C++ IOStream::writeFully使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IOStream的用法示例。


在下文中一共展示了IOStream::writeFully方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: rcUpdateColorBuffer_enc

int rcUpdateColorBuffer_enc(void *self , uint32_t colorbuffer, GLint x, GLint y, GLint width, GLint height, GLenum format, GLenum type, void* pixels)
{

	renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
	IOStream *stream = ctx->m_stream;

	const unsigned int __size_pixels =  (((glUtilsPixelBitSize(format, type) * width) >> 3) * height);
	 unsigned char *ptr;
	 const size_t packetSize = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + __size_pixels + 1*4;
	ptr = stream->alloc(8 + 4 + 4 + 4 + 4 + 4 + 4 + 4);
	int tmp = OP_rcUpdateColorBuffer;memcpy(ptr, &tmp, 4); ptr += 4;
	memcpy(ptr, &packetSize, 4);  ptr += 4;

		memcpy(ptr, &colorbuffer, 4); ptr += 4;
		memcpy(ptr, &x, 4); ptr += 4;
		memcpy(ptr, &y, 4); ptr += 4;
		memcpy(ptr, &width, 4); ptr += 4;
		memcpy(ptr, &height, 4); ptr += 4;
		memcpy(ptr, &format, 4); ptr += 4;
		memcpy(ptr, &type, 4); ptr += 4;
	stream->flush();
	stream->writeFully(&__size_pixels,4);
	stream->writeFully(pixels, __size_pixels);

	int retval;
	stream->readback(&retval, 4);
	return retval;
}
开发者ID:0omega,项目名称:platform_development,代码行数:28,代码来源:renderControl_enc.cpp

示例2: glUtilsWritePackPointerData

void glUtilsWritePackPointerData(void* _stream, unsigned char *src,
                                 int size, GLenum type, unsigned int stride,
                                 unsigned int datalen)
{
    IOStream* stream = reinterpret_cast<IOStream*>(_stream);

    unsigned int  vsize = size * glSizeof(type);
    if (stride == 0) stride = vsize;

    if (stride == vsize) {
        stream->writeFully(src, datalen);
    } else {
        for (unsigned int i = 0; i < datalen; i += vsize) {
            stream->writeFully(src, (size_t)vsize);
            src += stride;
        }
    }
}
开发者ID:0omega,项目名称:platform_development,代码行数:18,代码来源:glUtils.cpp


注:本文中的IOStream::writeFully方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。