本文整理汇总了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;
}
示例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;
}
}
}