示例#1
0
文件: egl_st.c 项目: CSRedRat/mesa-1
struct st_api *
egl_st_create_api(enum st_api_type api)
{
   struct st_api *stapi = NULL;

   switch (api) {
   case ST_API_OPENGL:
#if FEATURE_GL || FEATURE_ES1 || FEATURE_ES2
#if _EGL_EXTERNAL_GL
      stapi = egl_st_load_gl();
#else
      stapi = st_gl_api_create();
#endif
#endif
      break;
   case ST_API_OPENVG:
#if FEATURE_VG
      stapi = (struct st_api *) vg_api_get();
#endif
      break;
   default:
      assert(!"Unknown API Type\n");
      break;
   }

   return stapi;
}
示例#2
0
static struct st_api *
get_st_api(enum st_api_type api)
{
   struct st_api *stapi;

   stapi = stapis[api];
   if (stapi)
      return stapi;

   switch (api) {
#if FEATURE_GL || FEATURE_ES1 || FEATURE_ES2
   case ST_API_OPENGL:
      stapi = st_gl_api_create();
      break;
#endif
#if FEATURE_VG
   case ST_API_OPENVG:
      stapi = (struct st_api *) vg_api_get();
      break;
#endif
   default:
      break;
   }

   stapis[api] = stapi;

   return stapi;
}