Ejemplo n.º 1
0
HGLRC APIENTRY DrvCreateContext(HDC hdc)
{
    char dpyName[MAX_DPY_NAME];
    ContextInfo *context;

    CR_DDI_PROLOGUE();

    crDebug( "DrvCreateContext(0x%x) called.", hdc);

    stubInit();

    CRASSERT(stub.contextTable);

    sprintf(dpyName, "%d", hdc);
#ifndef VBOX_CROGL_USE_VBITS_SUPERSET
    if (stub.haveNativeOpenGL)
        desiredVisual |= ComputeVisBits( hdc );
#endif

    context = stubNewContext(dpyName, desiredVisual, UNDECIDED, 0
#if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST)
                             , NULL
#endif
                            );
    if (!context)
        return 0;

    return (HGLRC) context->id;
}
Ejemplo n.º 2
0
DECLEXPORT(HGLRC) WINAPI VBoxCreateContext( HDC hdc, struct VBOXUHGSMI *pHgsmi )
{
    char dpyName[MAX_DPY_NAME];
    ContextInfo *context;

    CR_DDI_PROLOGUE();

    stubInit();

    CRASSERT(stub.contextTable);

    sprintf(dpyName, "%d", hdc);
#ifndef VBOX_CROGL_USE_VBITS_SUPERSET
    if (stub.haveNativeOpenGL)
        desiredVisual |= ComputeVisBits( hdc );
#endif

    context = stubNewContext(dpyName, desiredVisual, UNDECIDED, 0
#if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST)
        , pHgsmi
#else
        , NULL
#endif
            );
    if (!context)
        return 0;

    return (HGLRC) context->id;
}
Ejemplo n.º 3
0
/**
 * Returns -1 on error
 */
GLint APIENTRY crCreateContext( const char *dpyName, GLint visBits )
{
    ContextInfo *context;
    stubInit();
    /* XXX in Chromium 1.5 and earlier, the last parameter was UNDECIDED.
     * That didn't seem right so it was changed to CHROMIUM. (Brian)
     */
    context = stubNewContext(dpyName, visBits, CHROMIUM, 0);
    return context ? (int) context->id : -1;
}
Ejemplo n.º 4
0
HGLRC WINAPI wglCreateContext_prox( HDC hdc )
{
	char dpyName[MAX_DPY_NAME];
	ContextInfo *context;

	stubInit();

	CRASSERT(stub.contextTable);

	sprintf(dpyName, "%d", hdc);
	if (stub.haveNativeOpenGL)
		desiredVisual |= ComputeVisBits( hdc );

	context = stubNewContext(dpyName, desiredVisual, UNDECIDED, 0);
	if (!context)
		return 0;

	return (HGLRC) context->id;
}