static int changed(ggi_visual_t vis, int whatchanged) { GGIMESADPRINT_CORE("Entered ggimesa_genkgi_changed\n"); switch (whatchanged) { case GGI_CHG_APILIST: { char api[256]; char args[256]; int i; const char *fname; ggi_dlhandle *lib; for (i = 0; ggiGetAPI(vis, i, api, args) == 0; i++) { strcat(api, "-mesa"); GGIMESADPRINT_CORE("ggimesa_genkgi_changed: api=%s, i=%d\n", api, i); fname = ggMatchConfig(_configHandle, api, NULL); if (fname == NULL) { /* No special implementation for this sublib */ continue; } lib = ggiExtensionLoadDL(vis, fname, args, NULL); } } break; } return 0; }
static int changed(ggi_visual_t vis, int whatchanged) { GLcontext *ctx; ctx = _mesa_get_current_context(); GGIMESADPRINT_CORE("changed() called\n"); switch (whatchanged) { case GGI_CHG_APILIST: { char api[GGI_MAX_APILEN]; char args[GGI_MAX_APILEN]; int i; const char *fname; ggi_dlhandle *lib; GLvisual *gl_vis = &(LIBGGI_MESAEXT(vis)->mesa_visual.gl_visual); GLframebuffer *gl_fb = &(LIBGGI_MESAEXT(vis)->mesa_buffer); /* Initialize the framebuffer to provide all necessary buffers in software. The target libraries that are loaded next are free to modify this according to their capabilities. */ /* FIXME: if the target changes capabilities we'll leak swrast's memory !!! Need to deallocate first */ _mesa_initialize_framebuffer(gl_fb, gl_vis, gl_vis->depthBits > 0, gl_vis->stencilBits > 0, gl_vis->accumRedBits > 0, gl_vis->alphaBits > 0); for (i = 0; ggiGetAPI(vis, i, api, args) == 0; i++) { strcat(api, "-mesa"); GGIMESADPRINT_CORE("GGIMesa: looking for" "a sublib named %s\n", api); fname = ggMatchConfig(_ggimesaConfigHandle, api, NULL); if (fname == NULL) { /* No special implementation for this sublib */ continue; } lib = ggiExtensionLoadDL(vis, fname, args, NULL, SUBLIB_PREFIX); } /* The targets have cleared everything they can do from the framebuffer structure so we provide the rest in sw */ /*_swrast_alloc_buffers(gl_fb);*/ break; } } return 0; }