コード例 #1
0
ファイル: glitz_egl_context.c プロジェクト: bonzini/glitz
static void
_glitz_egl_context_initialize (glitz_egl_screen_info_t *screen_info,
			       glitz_egl_context_t     *context)
{
    const char *version;

    glitz_backend_init (&context->backend,
			glitz_egl_get_proc_address,
			(void *) screen_info);

    glitz_initiate_state (&_glitz_egl_gl_proc_address);

    version = (const char *)
	context->backend.gl->get_string (GLITZ_GL_VERSION);
    if (version)
    {
	/* Having trouble with TexSubImage2D to NPOT GL_TEXTURE_2D textures
	   when using nvidia's binary driver. Seems like a driver issue, but
	   I'm not sure yet. Turning of NPOT GL_TEXTURE_2D textures until
	   this have been solved. */
	if (strstr (version, "NVIDIA 61.11") ||
	    strstr (version, "NVIDIA 66.29"))
	{
	    context->backend.feature_mask &=
		~GLITZ_FEATURE_TEXTURE_NON_POWER_OF_TWO_MASK;
	}
    }

    context->initialized = 1;
}
コード例 #2
0
static void
_glitz_agl_context_initialize (glitz_agl_thread_info_t *thread_info,
			       glitz_agl_context_t     *context)
{
    CFBundleRef bundle;

    bundle = _glitz_agl_get_bundle ("OpenGL.framework");

    glitz_backend_init (&context->backend,
			_glitz_agl_get_proc_address,
			(void *) bundle);

    _glitz_agl_release_bundle (bundle);

    glitz_initiate_state (&_glitz_agl_gl_proc_address);

    context->initialized = 1;
}