本文整理汇总了C++中IOStream::alloc方法的典型用法代码示例。如果您正苦于以下问题:C++ IOStream::alloc方法的具体用法?C++ IOStream::alloc怎么用?C++ IOStream::alloc使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IOStream
的用法示例。
在下文中一共展示了IOStream::alloc方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: rcChooseConfig_enc
EGLint rcChooseConfig_enc(void *self , EGLint* attribs, uint32_t attribs_size, uint32_t* configs, uint32_t configs_size)
{
renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
IOStream *stream = ctx->m_stream;
const unsigned int __size_attribs = attribs_size;
const unsigned int __size_configs = ((configs != NULL) ? configs_size*sizeof(uint32_t) : 0);
unsigned char *ptr;
const size_t packetSize = 8 + __size_attribs + 4 + __size_configs + 4 + 2*4;
ptr = stream->alloc(packetSize);
int tmp = OP_rcChooseConfig;memcpy(ptr, &tmp, 4); ptr += 4;
memcpy(ptr, &packetSize, 4); ptr += 4;
*(unsigned int *)(ptr) = __size_attribs; ptr += 4;
memcpy(ptr, attribs, __size_attribs);ptr += __size_attribs;
memcpy(ptr, &attribs_size, 4); ptr += 4;
*(unsigned int *)(ptr) = __size_configs; ptr += 4;
memcpy(ptr, &configs_size, 4); ptr += 4;
if (configs != NULL) stream->readback(configs, __size_configs);
EGLint retval;
stream->readback(&retval, 4);
return retval;
}
示例2: 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;
}
示例3: rcBindRenderbuffer_enc
void rcBindRenderbuffer_enc(void *self , uint32_t colorBuffer)
{
renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
IOStream *stream = ctx->m_stream;
unsigned char *ptr;
const size_t packetSize = 8 + 4;
ptr = stream->alloc(packetSize);
int tmp = OP_rcBindRenderbuffer;memcpy(ptr, &tmp, 4); ptr += 4;
memcpy(ptr, &packetSize, 4); ptr += 4;
memcpy(ptr, &colorBuffer, 4); ptr += 4;
}
示例4: rcDestroyWindowSurface_enc
void rcDestroyWindowSurface_enc(void *self , uint32_t windowSurface)
{
renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
IOStream *stream = ctx->m_stream;
unsigned char *ptr;
const size_t packetSize = 8 + 4;
ptr = stream->alloc(packetSize);
int tmp = OP_rcDestroyWindowSurface;memcpy(ptr, &tmp, 4); ptr += 4;
memcpy(ptr, &packetSize, 4); ptr += 4;
memcpy(ptr, &windowSurface, 4); ptr += 4;
}
示例5: rcFBSetSwapInterval_enc
void rcFBSetSwapInterval_enc(void *self , EGLint interval)
{
renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
IOStream *stream = ctx->m_stream;
unsigned char *ptr;
const size_t packetSize = 8 + 4;
ptr = stream->alloc(packetSize);
int tmp = OP_rcFBSetSwapInterval;memcpy(ptr, &tmp, 4); ptr += 4;
memcpy(ptr, &packetSize, 4); ptr += 4;
memcpy(ptr, &interval, 4); ptr += 4;
}
示例6: rcGetRendererVersion_enc
GLint rcGetRendererVersion_enc(void *self )
{
renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
IOStream *stream = ctx->m_stream;
unsigned char *ptr;
const size_t packetSize = 8;
ptr = stream->alloc(packetSize);
int tmp = OP_rcGetRendererVersion;memcpy(ptr, &tmp, 4); ptr += 4;
memcpy(ptr, &packetSize, 4); ptr += 4;
GLint retval;
stream->readback(&retval, 4);
return retval;
}
示例7: rcFlushWindowColorBuffer_enc
int rcFlushWindowColorBuffer_enc(void *self , uint32_t windowSurface)
{
renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
IOStream *stream = ctx->m_stream;
unsigned char *ptr;
const size_t packetSize = 8 + 4;
ptr = stream->alloc(packetSize);
int tmp = OP_rcFlushWindowColorBuffer;memcpy(ptr, &tmp, 4); ptr += 4;
memcpy(ptr, &packetSize, 4); ptr += 4;
memcpy(ptr, &windowSurface, 4); ptr += 4;
int retval;
stream->readback(&retval, 4);
return retval;
}
示例8: rcOpenColorBuffer2_enc
int rcOpenColorBuffer2_enc(void *self , uint32_t colorbuffer)
{
renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
IOStream *stream = ctx->m_stream;
unsigned char *ptr;
const size_t packetSize = 8 + 4;
ptr = stream->alloc(packetSize);
int tmp = OP_rcOpenColorBuffer2;memcpy(ptr, &tmp, 4); ptr += 4;
memcpy(ptr, &packetSize, 4); ptr += 4;
memcpy(ptr, &colorbuffer, 4); ptr += 4;
int retval;
stream->readback(&retval, 4);
return retval;
}
示例9: rcMakeCurrent_enc
EGLint rcMakeCurrent_enc(void *self , uint32_t context, uint32_t drawSurf, uint32_t readSurf)
{
renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
IOStream *stream = ctx->m_stream;
unsigned char *ptr;
const size_t packetSize = 8 + 4 + 4 + 4;
ptr = stream->alloc(packetSize);
int tmp = OP_rcMakeCurrent;memcpy(ptr, &tmp, 4); ptr += 4;
memcpy(ptr, &packetSize, 4); ptr += 4;
memcpy(ptr, &context, 4); ptr += 4;
memcpy(ptr, &drawSurf, 4); ptr += 4;
memcpy(ptr, &readSurf, 4); ptr += 4;
EGLint retval;
stream->readback(&retval, 4);
return retval;
}
示例10: rcGetNumConfigs_enc
EGLint rcGetNumConfigs_enc(void *self , uint32_t* numAttribs)
{
renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
IOStream *stream = ctx->m_stream;
const unsigned int __size_numAttribs = sizeof(uint32_t);
unsigned char *ptr;
const size_t packetSize = 8 + __size_numAttribs + 1*4;
ptr = stream->alloc(packetSize);
int tmp = OP_rcGetNumConfigs;memcpy(ptr, &tmp, 4); ptr += 4;
memcpy(ptr, &packetSize, 4); ptr += 4;
*(unsigned int *)(ptr) = __size_numAttribs; ptr += 4;
stream->readback(numAttribs, __size_numAttribs);
EGLint retval;
stream->readback(&retval, 4);
return retval;
}
示例11: rcCreateWindowSurface_enc
uint32_t rcCreateWindowSurface_enc(void *self , uint32_t config, uint32_t width, uint32_t height)
{
renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
IOStream *stream = ctx->m_stream;
unsigned char *ptr;
const size_t packetSize = 8 + 4 + 4 + 4;
ptr = stream->alloc(packetSize);
int tmp = OP_rcCreateWindowSurface;memcpy(ptr, &tmp, 4); ptr += 4;
memcpy(ptr, &packetSize, 4); ptr += 4;
memcpy(ptr, &config, 4); ptr += 4;
memcpy(ptr, &width, 4); ptr += 4;
memcpy(ptr, &height, 4); ptr += 4;
uint32_t retval;
stream->readback(&retval, 4);
return retval;
}
示例12: rcCreateContext_enc
uint32_t rcCreateContext_enc(void *self , uint32_t config, uint32_t share, uint32_t glVersion)
{
renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
IOStream *stream = ctx->m_stream;
unsigned char *ptr;
const size_t packetSize = 8 + 4 + 4 + 4;
ptr = stream->alloc(packetSize);
int tmp = OP_rcCreateContext;memcpy(ptr, &tmp, 4); ptr += 4;
memcpy(ptr, &packetSize, 4); ptr += 4;
memcpy(ptr, &config, 4); ptr += 4;
memcpy(ptr, &share, 4); ptr += 4;
memcpy(ptr, &glVersion, 4); ptr += 4;
uint32_t retval;
stream->readback(&retval, 4);
return retval;
}
示例13: rcCreateColorBuffer_enc
uint32_t rcCreateColorBuffer_enc(void *self , uint32_t width, uint32_t height, GLenum internalFormat)
{
renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
IOStream *stream = ctx->m_stream;
unsigned char *ptr;
const size_t packetSize = 8 + 4 + 4 + 4;
ptr = stream->alloc(packetSize);
int tmp = OP_rcCreateColorBuffer;memcpy(ptr, &tmp, 4); ptr += 4;
memcpy(ptr, &packetSize, 4); ptr += 4;
memcpy(ptr, &width, 4); ptr += 4;
memcpy(ptr, &height, 4); ptr += 4;
memcpy(ptr, &internalFormat, 4); ptr += 4;
uint32_t retval;
stream->readback(&retval, 4);
return retval;
}
示例14: rcColorBufferCacheFlush_enc
EGLint rcColorBufferCacheFlush_enc(void *self , uint32_t colorbuffer, EGLint postCount, int forRead)
{
renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
IOStream *stream = ctx->m_stream;
unsigned char *ptr;
const size_t packetSize = 8 + 4 + 4 + 4;
ptr = stream->alloc(packetSize);
int tmp = OP_rcColorBufferCacheFlush;memcpy(ptr, &tmp, 4); ptr += 4;
memcpy(ptr, &packetSize, 4); ptr += 4;
memcpy(ptr, &colorbuffer, 4); ptr += 4;
memcpy(ptr, &postCount, 4); ptr += 4;
memcpy(ptr, &forRead, 4); ptr += 4;
EGLint retval;
stream->readback(&retval, 4);
return retval;
}
示例15: rcGetConfigs_enc
EGLint rcGetConfigs_enc(void *self , uint32_t bufSize, GLuint* buffer)
{
renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
IOStream *stream = ctx->m_stream;
const unsigned int __size_buffer = bufSize;
unsigned char *ptr;
const size_t packetSize = 8 + 4 + __size_buffer + 1*4;
ptr = stream->alloc(packetSize);
int tmp = OP_rcGetConfigs;memcpy(ptr, &tmp, 4); ptr += 4;
memcpy(ptr, &packetSize, 4); ptr += 4;
memcpy(ptr, &bufSize, 4); ptr += 4;
*(unsigned int *)(ptr) = __size_buffer; ptr += 4;
stream->readback(buffer, __size_buffer);
EGLint retval;
stream->readback(&retval, 4);
return retval;
}