diff options
author | Jakob Bornecrantz <[email protected]> | 2010-04-24 01:05:49 +0100 |
---|---|---|
committer | Jakob Bornecrantz <[email protected]> | 2010-04-26 00:40:17 +0100 |
commit | 0c572c6828b6a338b07a6860280b3a314a81662e (patch) | |
tree | 749dc6f81128f7a1b16953fad240f53108b4f8a4 /src/gallium/state_trackers/egl/common | |
parent | 81ab19de04e623d24cb65ad1ed3b240bce78235b (diff) |
st_api: Remove st_module
The struct st_module isn't needed as it is the same thing as the st_api
struct. That is they both represent the API. Instead just use a single
function entry point to the the API.
Diffstat (limited to 'src/gallium/state_trackers/egl/common')
-rw-r--r-- | src/gallium/state_trackers/egl/common/egl_g3d_st.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/src/gallium/state_trackers/egl/common/egl_g3d_st.c b/src/gallium/state_trackers/egl/common/egl_g3d_st.c index 57a479f6bca..47ecc503eb7 100644 --- a/src/gallium/state_trackers/egl/common/egl_g3d_st.c +++ b/src/gallium/state_trackers/egl/common/egl_g3d_st.c @@ -49,41 +49,42 @@ egl_g3d_st_manager(struct st_manager *smapi) struct st_api * egl_g3d_create_st_api(enum st_api_type api) { - const char *stmod_name; struct util_dl_library *lib; - const struct st_module *mod; + const char *proc_name; + struct st_api * (*proc)(void) = NULL; switch (api) { case ST_API_OPENGL: - stmod_name = ST_MODULE_OPENGL_SYMBOL; + proc_name = ST_CREATE_OPENGL_SYMBOL; break; case ST_API_OPENGL_ES1: - stmod_name = ST_MODULE_OPENGL_ES1_SYMBOL; + proc_name = ST_CREATE_OPENGL_ES1_SYMBOL; break; case ST_API_OPENGL_ES2: - stmod_name = ST_MODULE_OPENGL_ES2_SYMBOL; + proc_name = ST_CREATE_OPENGL_ES2_SYMBOL; break; case ST_API_OPENVG: - stmod_name = ST_MODULE_OPENVG_SYMBOL; + proc_name = ST_CREATE_OPENVG_SYMBOL; break; default: - stmod_name = NULL; - break; + assert(!"Unknown API Type\n"); + return NULL; } - if (!stmod_name) + + if (!proc_name) return NULL; - mod = NULL; lib = util_dl_open(NULL); if (lib) { - mod = (const struct st_module *) - util_dl_get_proc_address(lib, stmod_name); + proc = util_dl_get_proc_address(lib, proc_name); + debug_printf("%s: %s %p\n", __func__, proc_name, proc); util_dl_close(lib); } - if (!mod || mod->api != api) + + if (!proc) return NULL; - return mod->create_api(); + return proc(); } static boolean |