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


C++ CR_UNLOCK_PACKER_CONTEXT函数代码示例

本文整理汇总了C++中CR_UNLOCK_PACKER_CONTEXT函数的典型用法代码示例。如果您正苦于以下问题:C++ CR_UNLOCK_PACKER_CONTEXT函数的具体用法?C++ CR_UNLOCK_PACKER_CONTEXT怎么用?C++ CR_UNLOCK_PACKER_CONTEXT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: crPackLoadTransposeMatrixfARB

void PACK_APIENTRY crPackLoadTransposeMatrixfARB( const GLfloat *m )
{
    CR_GET_PACKER_CONTEXT(pc);
    unsigned char *data_ptr;
    int packet_length = 16*sizeof( *m ) + sizeof(GLint) + sizeof(GLenum);
    CR_GET_BUFFERED_POINTER(pc, packet_length );
    WRITE_DATA( 0, GLint, packet_length );
    WRITE_DATA( 4, GLenum, CR_LOADTRANSPOSEMATRIXFARB_EXTEND_OPCODE );
    WRITE_DATA( 8 + 0*sizeof(GLfloat), GLfloat, m[ 0] );
    WRITE_DATA( 8 + 1*sizeof(GLfloat), GLfloat, m[ 1] );
    WRITE_DATA( 8 + 2*sizeof(GLfloat), GLfloat, m[ 2] );
    WRITE_DATA( 8 + 3*sizeof(GLfloat), GLfloat, m[ 3] );
    WRITE_DATA( 8 + 4*sizeof(GLfloat), GLfloat, m[ 4] );
    WRITE_DATA( 8 + 5*sizeof(GLfloat), GLfloat, m[ 5] );
    WRITE_DATA( 8 + 6*sizeof(GLfloat), GLfloat, m[ 6] );
    WRITE_DATA( 8 + 7*sizeof(GLfloat), GLfloat, m[ 7] );
    WRITE_DATA( 8 + 8*sizeof(GLfloat), GLfloat, m[ 8] );
    WRITE_DATA( 8 + 9*sizeof(GLfloat), GLfloat, m[ 9] );
    WRITE_DATA( 8 + 10*sizeof(GLfloat), GLfloat, m[10] );
    WRITE_DATA( 8 + 11*sizeof(GLfloat), GLfloat, m[11] );
    WRITE_DATA( 8 + 12*sizeof(GLfloat), GLfloat, m[12] );
    WRITE_DATA( 8 + 13*sizeof(GLfloat), GLfloat, m[13] );
    WRITE_DATA( 8 + 14*sizeof(GLfloat), GLfloat, m[14] );
    WRITE_DATA( 8 + 15*sizeof(GLfloat), GLfloat, m[15] );
    WRITE_OPCODE( pc, CR_EXTEND_OPCODE );
    CR_UNLOCK_PACKER_CONTEXT(pc);
}
开发者ID:MadHacker217,项目名称:VirtualBox-OSE,代码行数:27,代码来源:pack_matrices.c

示例2: crPackLightfvSWAP

void PACK_APIENTRY crPackLightfvSWAP (GLenum light, GLenum pname, const GLfloat *params)
{
    CR_GET_PACKER_CONTEXT(pc);
    if (__handleLightData( light, pname, params ))
        WRITE_OPCODE( pc, CR_LIGHTFV_OPCODE );
    CR_UNLOCK_PACKER_CONTEXT(pc);
}
开发者ID:bayasist,项目名称:vbox,代码行数:7,代码来源:pack_lights_swap.c

示例3: crPackCombinerParameterfvNV

void PACK_APIENTRY crPackCombinerParameterfvNV( GLenum pname, const GLfloat *params )
{
    CR_GET_PACKER_CONTEXT(pc);
    if (__handleCombinerParameterData( pname, params, CR_COMBINERPARAMETERFVNV_EXTEND_OPCODE ))
        WRITE_OPCODE( pc, CR_EXTEND_OPCODE );
    CR_UNLOCK_PACKER_CONTEXT(pc);
}
开发者ID:MadHacker217,项目名称:VirtualBox-OSE,代码行数:7,代码来源:pack_regcombiner.c

示例4: crPackLoadMatrixf

void PACK_APIENTRY crPackLoadMatrixf( const GLfloat *m )
{
    CR_GET_PACKER_CONTEXT(pc);
    unsigned char *data_ptr;
    int packet_length = 16*sizeof( *m );
    CR_GET_BUFFERED_POINTER(pc, packet_length );
    WRITE_DATA( 0*sizeof(GLfloat), GLfloat, m[ 0] );
    WRITE_DATA( 1*sizeof(GLfloat), GLfloat, m[ 1] );
    WRITE_DATA( 2*sizeof(GLfloat), GLfloat, m[ 2] );
    WRITE_DATA( 3*sizeof(GLfloat), GLfloat, m[ 3] );
    WRITE_DATA( 4*sizeof(GLfloat), GLfloat, m[ 4] );
    WRITE_DATA( 5*sizeof(GLfloat), GLfloat, m[ 5] );
    WRITE_DATA( 6*sizeof(GLfloat), GLfloat, m[ 6] );
    WRITE_DATA( 7*sizeof(GLfloat), GLfloat, m[ 7] );
    WRITE_DATA( 8*sizeof(GLfloat), GLfloat, m[ 8] );
    WRITE_DATA( 9*sizeof(GLfloat), GLfloat, m[ 9] );
    WRITE_DATA( 10*sizeof(GLfloat), GLfloat, m[10] );
    WRITE_DATA( 11*sizeof(GLfloat), GLfloat, m[11] );
    WRITE_DATA( 12*sizeof(GLfloat), GLfloat, m[12] );
    WRITE_DATA( 13*sizeof(GLfloat), GLfloat, m[13] );
    WRITE_DATA( 14*sizeof(GLfloat), GLfloat, m[14] );
    WRITE_DATA( 15*sizeof(GLfloat), GLfloat, m[15] );
    WRITE_OPCODE( pc, CR_LOADMATRIXF_OPCODE );
    CR_UNLOCK_PACKER_CONTEXT(pc);
}
开发者ID:MadHacker217,项目名称:VirtualBox-OSE,代码行数:25,代码来源:pack_matrices.c

示例5: crPackMultMatrixd

void PACK_APIENTRY crPackMultMatrixd( const GLdouble *m )
{
    CR_GET_PACKER_CONTEXT(pc);
    unsigned char *data_ptr;
    int packet_length = 16*sizeof( *m );
    CR_GET_BUFFERED_POINTER(pc, packet_length );
    WRITE_DOUBLE( 0*sizeof(double), m[ 0] );
    WRITE_DOUBLE( 1*sizeof(double), m[ 1] );
    WRITE_DOUBLE( 2*sizeof(double), m[ 2] );
    WRITE_DOUBLE( 3*sizeof(double), m[ 3] );
    WRITE_DOUBLE( 4*sizeof(double), m[ 4] );
    WRITE_DOUBLE( 5*sizeof(double), m[ 5] );
    WRITE_DOUBLE( 6*sizeof(double), m[ 6] );
    WRITE_DOUBLE( 7*sizeof(double), m[ 7] );
    WRITE_DOUBLE( 8*sizeof(double), m[ 8] );
    WRITE_DOUBLE( 9*sizeof(double), m[ 9] );
    WRITE_DOUBLE( 10*sizeof(double), m[10] );
    WRITE_DOUBLE( 11*sizeof(double), m[11] );
    WRITE_DOUBLE( 12*sizeof(double), m[12] );
    WRITE_DOUBLE( 13*sizeof(double), m[13] );
    WRITE_DOUBLE( 14*sizeof(double), m[14] );
    WRITE_DOUBLE( 15*sizeof(double), m[15] );
    WRITE_OPCODE( pc, CR_MULTMATRIXD_OPCODE );
    CR_UNLOCK_PACKER_CONTEXT(pc);
}
开发者ID:MadHacker217,项目名称:VirtualBox-OSE,代码行数:25,代码来源:pack_matrices.c

示例6: crPackWindowVisibleRegion

void PACK_APIENTRY crPackWindowVisibleRegion( CR_PACKER_CONTEXT_ARGDECL GLint window, GLint cRects, const GLint * pRects )
{
    GLint i, size, cnt;

    CR_GET_PACKER_CONTEXT(pc);
    unsigned char *data_ptr;
    (void) pc;
    size = 16 + cRects * 4 * sizeof(GLint);
    CR_GET_BUFFERED_POINTER( pc, size );
    WRITE_DATA( 0, GLint, size );
    WRITE_DATA( 4, GLenum, CR_WINDOWVISIBLEREGION_EXTEND_OPCODE );
    WRITE_DATA( 8, GLint, window );
    WRITE_DATA( 12, GLint, cRects );

    cnt = 16;
    for (i=0; i<cRects; ++i)
    {
        WRITE_DATA(cnt, GLint, (GLint) pRects[4*i+0]);
        WRITE_DATA(cnt+4, GLint, (GLint) pRects[4*i+1]);
        WRITE_DATA(cnt+8, GLint, (GLint) pRects[4*i+2]);
        WRITE_DATA(cnt+12, GLint, (GLint) pRects[4*i+3]);
        cnt += 16;
    }
    WRITE_OPCODE( pc, CR_EXTEND_OPCODE );
    CR_UNLOCK_PACKER_CONTEXT(pc);
}
开发者ID:svn2github,项目名称:virtualbox,代码行数:26,代码来源:pack_visibleregion.c

示例7: crPackAreProgramsResidentNV

void PACK_APIENTRY
crPackAreProgramsResidentNV(GLsizei n, const GLuint * programs,
                                                        GLboolean *residences, GLboolean *return_val,
                                                        int *writeback)
{
    CR_GET_PACKER_CONTEXT(pc);
    unsigned char *data_ptr;
    int packet_length;

    (void) return_val; /* Caller must compute this from residences!!! */

    packet_length = sizeof(int) +   /* packet length */
        sizeof(GLenum) +                        /* extend opcode */
        sizeof(n) +                                 /* num programs */
        n * sizeof(*programs) +         /* programs */
        8 + 8;

    CR_GET_BUFFERED_POINTER(pc, packet_length);
    WRITE_DATA(0, int, packet_length);
    WRITE_DATA(4, GLenum, CR_AREPROGRAMSRESIDENTNV_EXTEND_OPCODE);
    WRITE_DATA(8, GLsizei, n);
    crMemcpy(data_ptr + 12, programs, n * sizeof(*programs));
    WRITE_NETWORK_POINTER(12 + n * sizeof(*programs),   (void *) residences);
    WRITE_NETWORK_POINTER(20 + n * sizeof(*programs), (void *) writeback);
    WRITE_OPCODE(pc, CR_EXTEND_OPCODE);
    CR_CMDBLOCK_CHECK_FLUSH(pc);
    CR_UNLOCK_PACKER_CONTEXT(pc);
}
开发者ID:svn2github,项目名称:virtualbox,代码行数:28,代码来源:pack_program.c

示例8: crPackPolygonStipple

void PACK_APIENTRY crPackPolygonStipple( const GLubyte *mask )
{
    CR_GET_PACKER_CONTEXT(pc);
    unsigned char *data_ptr;
    int nodata = crStateIsBufferBound(GL_PIXEL_UNPACK_BUFFER_ARB);
    int packet_length = sizeof(int);

    if (nodata)
        packet_length += sizeof(GLint);
    else
        packet_length += 32*32/8;

    CR_GET_BUFFERED_POINTER(pc, packet_length );
    WRITE_DATA_AI(int, nodata);
    if (nodata)
    {
        WRITE_DATA_AI(GLint, (GLint)(uintptr_t)mask);
    }
    else
    {
       crMemcpy( data_ptr, mask, 32*32/8 );
    }
    WRITE_OPCODE( pc, CR_POLYGONSTIPPLE_OPCODE );
    CR_UNLOCK_PACKER_CONTEXT(pc);
}
开发者ID:MadHacker217,项目名称:VirtualBox-OSE,代码行数:25,代码来源:pack_stipple.c

示例9: crPackCombinerParameterivNV

void PACK_APIENTRY crPackCombinerParameterivNV( GLenum pname, const GLint *params )
{
    /* floats and ints are the same size, so the packing should be the same */
    CR_GET_PACKER_CONTEXT(pc);
    if (__handleCombinerParameterData( pname, (const GLfloat *) params, CR_COMBINERPARAMETERIVNV_EXTEND_OPCODE ))
        WRITE_OPCODE( pc, CR_EXTEND_OPCODE );
    CR_UNLOCK_PACKER_CONTEXT(pc);
}
开发者ID:MadHacker217,项目名称:VirtualBox-OSE,代码行数:8,代码来源:pack_regcombiner.c

示例10: crPackFree

void crPackFree( void *packet )
{
	CR_GET_PACKER_CONTEXT(pc);
    
	if ( IS_BUFFERED( packet ) )
    {
        CR_UNLOCK_PACKER_CONTEXT(pc);
		return;
    }

    CR_UNLOCK_PACKER_CONTEXT(pc);
	
	/* the pointer passed in doesn't include the space for the single
	 * opcode (4 bytes because of the alignment requirement) or the
	 * length field or the header */
	crFree( (unsigned char *) packet - 8 - sizeof(CRMessageOpcodes) );
}
开发者ID:LastRitter,项目名称:vbox-haiku,代码行数:17,代码来源:pack_buffer.c

示例11: crPackLightivSWAP

void PACK_APIENTRY crPackLightivSWAP (GLenum light, GLenum pname, const GLint *params)
{
    /* floats and ints are the same size, so the packing should be the same */
    CR_GET_PACKER_CONTEXT(pc);
    if (__handleLightData( light, pname, (const GLfloat *) params ))
        WRITE_OPCODE( pc, CR_LIGHTIV_OPCODE );
    CR_UNLOCK_PACKER_CONTEXT(pc);
}
开发者ID:bayasist,项目名称:vbox,代码行数:8,代码来源:pack_lights_swap.c

示例12: crPackAppendBuffer

void crPackAppendBuffer( const CRPackBuffer *src )
{
	CR_GET_PACKER_CONTEXT(pc);
	const int num_data = crPackNumData(src);
	const int num_opcode = crPackNumOpcodes(src);

	CRASSERT(num_data >= 0);
	CRASSERT(num_opcode >= 0);

    CR_LOCK_PACKER_CONTEXT(pc);

	/* don't append onto ourself! */
	CRASSERT(pc->currentBuffer);
	CRASSERT(pc->currentBuffer != src);

	if (!crPackCanHoldBuffer(src))
	{
		if (src->holds_BeginEnd)
		{
			crWarning( "crPackAppendBuffer: overflowed the destination!" );
            CR_UNLOCK_PACKER_CONTEXT(pc);
			return;
		}
		else
        {
			crError( "crPackAppendBuffer: overflowed the destination!" );
            CR_UNLOCK_PACKER_CONTEXT(pc);
        }
	}

	/* Copy the buffer data/operands which are at the head of the buffer */
	crMemcpy( pc->buffer.data_current, src->data_start, num_data );
	pc->buffer.data_current += num_data;

	/* Copy the buffer opcodes which are at the tail of the buffer */
	CRASSERT( pc->buffer.opcode_current - num_opcode >= pc->buffer.opcode_end );
	crMemcpy( pc->buffer.opcode_current + 1 - num_opcode, src->opcode_current + 1,
			num_opcode );
	pc->buffer.opcode_current -= num_opcode;
	pc->buffer.holds_BeginEnd |= src->holds_BeginEnd;
	pc->buffer.in_BeginEnd = src->in_BeginEnd;
	pc->buffer.holds_List |= src->holds_List;
    CR_UNLOCK_PACKER_CONTEXT(pc);
}
开发者ID:LastRitter,项目名称:vbox-haiku,代码行数:44,代码来源:pack_buffer.c

示例13: crPackAppendBoundedBuffer

void
crPackAppendBoundedBuffer( const CRPackBuffer *src, const CRrecti *bounds )
{
	CR_GET_PACKER_CONTEXT(pc);
	const GLbyte *payload = (const GLbyte *) src->opcode_current + 1;
	const int num_opcodes = crPackNumOpcodes(src);
	const int length = src->data_current - src->opcode_current - 1;

	CRASSERT(pc);
    CR_LOCK_PACKER_CONTEXT(pc);
	CRASSERT(pc->currentBuffer);
	CRASSERT(pc->currentBuffer != src);

	/*
	 * payload points to the block of opcodes immediately followed by operands.
	 */

	if ( !crPackCanHoldBoundedBuffer( src ) )
	{
		if (src->holds_BeginEnd)
		{
			crWarning( "crPackAppendBoundedBuffer: overflowed the destination!" );
            CR_UNLOCK_PACKER_CONTEXT(pc);
			return;
		}
		else
        {
			crError( "crPackAppendBoundedBuffer: overflowed the destination!" );
            CR_UNLOCK_PACKER_CONTEXT(pc);
        }
	}

	if (pc->swapping)
		crPackBoundsInfoCRSWAP( bounds, payload, length, num_opcodes );
	else
		crPackBoundsInfoCR( bounds, payload, length, num_opcodes );

	pc->buffer.holds_BeginEnd |= src->holds_BeginEnd;
	pc->buffer.in_BeginEnd = src->in_BeginEnd;
	pc->buffer.holds_List |= src->holds_List;
    CR_UNLOCK_PACKER_CONTEXT(pc);
}
开发者ID:LastRitter,项目名称:vbox-haiku,代码行数:42,代码来源:pack_buffer.c

示例14: crPackCanHoldBuffer

int crPackCanHoldBuffer( const CRPackBuffer *src )
{
	const int num_data = crPackNumData(src);
	const int num_opcode = crPackNumOpcodes(src);
    int res;
	CR_GET_PACKER_CONTEXT(pc);
    CR_LOCK_PACKER_CONTEXT(pc);
	res = crPackCanHoldOpcode( pc, num_opcode, num_data );
    CR_UNLOCK_PACKER_CONTEXT(pc);
    return res;
}
开发者ID:LastRitter,项目名称:vbox-haiku,代码行数:11,代码来源:pack_buffer.c

示例15: crPackEndListSWAP

void PACK_APIENTRY crPackEndListSWAP( void )
{
    CR_GET_PACKER_CONTEXT(pc);
    unsigned char *data_ptr;
    (void) pc;
    CR_GET_BUFFERED_POINTER( pc, 8 );
    WRITE_DATA( 0, GLint, SWAP32(8) );
    WRITE_DATA( 4, GLenum, SWAP32(CR_ENDLIST_EXTEND_OPCODE) );
    WRITE_OPCODE( pc, CR_EXTEND_OPCODE );
    pc->buffer.in_List = GL_FALSE;
    CR_UNLOCK_PACKER_CONTEXT(pc);
}
开发者ID:MadHacker217,项目名称:VirtualBox-OSE,代码行数:12,代码来源:pack_swap_lists.c


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