bool OpenGLRuntimeLinking::loadOpenGL3EntryPoints() { bool result = true; // Success by default // Load the entry points IMPORT_FUNC(glGetStringi); // Done return result; }
bool Direct3D9RuntimeLinking::loadD3D9EntryPoints() { bool result = true; // Success by default // Define a helper macro #define IMPORT_FUNC(funcName) \ if (result) \ { \ void *symbol = ::GetProcAddress(static_cast<HMODULE>(mD3D9SharedLibrary), #funcName); \ if (nullptr != symbol) \ { \ *(reinterpret_cast<void**>(&(funcName))) = symbol; \ } \ else \ { \ wchar_t moduleFilename[MAX_PATH]; \ moduleFilename[0] = '\0'; \ ::GetModuleFileNameW(static_cast<HMODULE>(mD3D9SharedLibrary), moduleFilename, MAX_PATH); \ RENDERER_OUTPUT_DEBUG_PRINTF("Direct3D 10 error: Failed to locate the entry point \"%s\" within the Direct3D 9 shared library \"%s\"", #funcName, moduleFilename) \ result = false; \ } \ } // Load the entry points IMPORT_FUNC(D3DPERF_GetStatus); IMPORT_FUNC(D3DPERF_SetOptions); IMPORT_FUNC(D3DPERF_SetMarker); IMPORT_FUNC(D3DPERF_BeginEvent); IMPORT_FUNC(D3DPERF_EndEvent); // Undefine the helper macro #undef IMPORT_FUNC // Done return result; }
/** Initialize libraries and driver's functions */ TuxDrvError TuxDriver_Initialize() { TuxLogger_Debug("TuxDriver_Initialize()",NULL); if(isInitialized) return E_TUXDRV_ALREADYINITIALIZED; TuxLogger_Debug("Initializing TuxDriver driver",NULL); #ifdef _WIN32 if(!file_exists("./libtuxdriver.dll")) { TuxLogger_Error("Driver not found !!",NULL); return E_TUXDRV_DRIVERNOTFOUND; } else DLLHANDLE = LoadLibrary("./libtuxdriver.dll"); #else if(!file_exists("./libtuxdriver.so")) { TuxLogger_Error("Driver not found !!",NULL); return E_TUXDRV_DRIVERNOTFOUND; } else DLLHANDLE = dlopen("./libtuxdriver.so", RTLD_NOW); #endif TuxLogger_Debug("Getting library functions",NULL); TuxDrv_Stop = (TuxDrv_Stop_t)(uintptr_t)IMPORT_FUNC(DLLHANDLE, "TuxDrv_Stop"); TuxDrv_Start = (TuxDrv_Start_t)(uintptr_t)IMPORT_FUNC(DLLHANDLE, "TuxDrv_Start"); TuxDrv_SetStatusCallback = (TuxDrv_SetStatusCallback_t)(uintptr_t)IMPORT_FUNC(DLLHANDLE,"TuxDrv_SetStatusCallback"); TuxDrv_SetEndCycleCallback = (TuxDrv_SetEndCycleCallback_t)(uintptr_t)IMPORT_FUNC(DLLHANDLE,"TuxDrv_SetEndCycleCallback"); TuxDrv_SetDongleConnectedCallback = (TuxDrv_SetDongleConnectedCallback_t)(uintptr_t)IMPORT_FUNC(DLLHANDLE,"TuxDrv_SetDongleConnectedCallback"); TuxDrv_SetDongleDisconnectedCallback = (TuxDrv_SetDongleDisconnectedCallback_t)(uintptr_t)IMPORT_FUNC(DLLHANDLE,"TuxDrv_SetDongleDisconnectedCallback"); TuxDrv_ResetDongle = (TuxDrv_ResetDongle_t)(uintptr_t)IMPORT_FUNC(DLLHANDLE,"TuxDrv_ResetDongle"); TuxDrv_PerformCommand = (TuxDrv_PerformCommand_t)(uintptr_t)IMPORT_FUNC(DLLHANDLE,"TuxDrv_PerformCommand"); TuxDrv_PerformMacroText = (TuxDrv_PerformMacroText_t)(uintptr_t)IMPORT_FUNC(DLLHANDLE,"TuxDrv_PerformMacroText"); TuxDrv_PerformMacroFile = (TuxDrv_PerformMacroFile_t)(uintptr_t)IMPORT_FUNC(DLLHANDLE,"TuxDrv_PerformMacroFile"); TuxDrv_ResetPositions = (TuxDrv_ResetPositions_t)(uintptr_t)IMPORT_FUNC(DLLHANDLE, "TuxDrv_ResetPositions"); TuxDrv_ClearCommandStack = (TuxDrv_ClearCommandStack_t)(uintptr_t)IMPORT_FUNC(DLLHANDLE,"TuxDrv_ClearCommandStack"); TuxDrv_SoundReflash = (TuxDrv_SoundReflash_t)(uintptr_t)IMPORT_FUNC(DLLHANDLE,"TuxDrv_SoundReflash"); TuxDrv_GetStatusName = (TuxDrv_GetStatusName_t)(uintptr_t)IMPORT_FUNC(DLLHANDLE,"TuxDrv_GetStatusName"); TuxDrv_GetStatusId = (TuxDrv_GetStatusId_t)(uintptr_t)IMPORT_FUNC(DLLHANDLE,"TuxDrv_GetStatusId"); TuxDrv_GetStatusState = (TuxDrv_GetStatusState_t)(uintptr_t)IMPORT_FUNC(DLLHANDLE,"TuxDrv_GetStatusState"); TuxDrv_GetStatusValue = (TuxDrv_GetStatusValue_t)(uintptr_t)IMPORT_FUNC(DLLHANDLE,"TuxDrv_GetStatusValue"); TuxDrv_GetAllStatusState = (TuxDrv_GetAllStatusState_t)(uintptr_t)IMPORT_FUNC(DLLHANDLE,"TuxDrv_GetAllStatusState"); TuxDrv_Eyes_Off = (TuxDrv_Eyes_Off_t)(uintptr_t)IMPORT_FUNC(DLLHANDLE,"TuxDrv_Eyes_cmd_off"); TuxDrv_Mouth_Off = (TuxDrv_Mouth_Off_t)(uintptr_t)IMPORT_FUNC(DLLHANDLE,"TuxDrv_Mouth_cmd_off"); TuxDrv_Spinning_Off = (TuxDrv_Spinning_Off_t)(uintptr_t)IMPORT_FUNC(DLLHANDLE,"TuxDrv_Spinning_cmd_off"); TuxDrv_Flippers_Off = (TuxDrv_Flippers_Off_t)(uintptr_t)IMPORT_FUNC(DLLHANDLE,"TuxDrv_Flippers_cmd_off"); TuxDrv_Update_Light = (TuxDrv_Update_Light_t)(uintptr_t)IMPORT_FUNC(DLLHANDLE,"TuxDrv_LightLevel_update"); TuxDrv_GetFlashSound_Infos = (TuxDrv_GetFlashSound_Infos_t)(uintptr_t)IMPORT_FUNC(DLLHANDLE,"TuxDrv_SoundFlash_dump_descriptor"); /* TuxDrv_SetLogLevel = (TuxDrv_SetLogLevel_t)(uintptr_t)IMPORT_FUNC(DLLHANDLE,"TuxDrv_SetLogLevel"); TuxDrv_SetLogTarget = (TuxDrv_SetLogTarget_t)(uintptr_t)IMPORT_FUNC(DLLHANDLE,"TuxDrv_SetLogTarget"); */ isInitialized=true; TuxLogger_Info("TuxDriver v%d.%d.%d initialized !",TUXDRIVER_MAJOR,TUXDRIVER_MINOR,TUXDRIVER_REVIS); return E_TUXDRV_NOERROR; }
AVS_T *initAVS(const char *filename) { AVS_T *AVS = malloc (sizeof(AVS_T)); AVS_Value arg0 = avs_new_value_string(filename); AVS_Value args = avs_new_value_array(&arg0, 1); memset(AVS, 0, sizeof(AVS_T)); #ifdef WIN32_LOADER AVS->ldt_fs = Setup_LDT_Keeper(); #endif AVS->dll = LoadLibraryA("avisynth.dll"); if(!AVS->dll) { mp_msg(MSGT_DEMUX ,MSGL_V, "AVS: failed to load avisynth.dll\n"); goto avs_err; } /* Dynamic import of needed stuff from avisynth.dll */ IMPORT_FUNC(avs_create_script_environment); IMPORT_FUNC(avs_invoke); IMPORT_FUNC(avs_get_video_info); IMPORT_FUNC(avs_take_clip); IMPORT_FUNC(avs_release_clip); IMPORT_FUNC(avs_get_frame); IMPORT_FUNC(avs_release_video_frame); IMPORT_FUNC(avs_get_audio); AVS->avs_env = AVS->avs_create_script_environment(AVISYNTH_INTERFACE_VERSION); if (!AVS->avs_env) { mp_msg(MSGT_DEMUX, MSGL_V, "AVS: avs_create_script_environment failed\n"); goto avs_err; } AVS->handler = AVS->avs_invoke(AVS->avs_env, "Import", args, 0); if (avs_is_error(AVS->handler)) { mp_msg(MSGT_DEMUX, MSGL_V, "AVS: Avisynth error: %s\n", avs_as_string(AVS->handler)); goto avs_err; } if (!avs_is_clip(AVS->handler)) { mp_msg(MSGT_DEMUX, MSGL_V, "AVS: Avisynth doesn't return a clip\n"); goto avs_err; } return AVS; avs_err: if (AVS->dll) FreeLibrary(AVS->dll); #ifdef WIN32_LOADER Restore_LDT_Keeper(AVS->ldt_fs); #endif free(AVS); return NULL; }
/* Imports function pointers to selected function calls in OpenGL ES Common * or Common Lite profile DLL or shared object. The function pointers are * stored as global symbols with equivalent function name but prefixed with * "funcPtr_". Standard gl/egl calls are redirected to the function pointers * with preprocessor macros (see importgl.h). */ int importGLInit() { int result = 1; #ifndef DISABLE_IMPORTGL #undef IMPORT_FUNC #ifdef WIN32 sGLESDLL = LoadLibrary(_T("libGLES_CM.dll")); if (sGLESDLL == NULL) sGLESDLL = LoadLibrary(_T("libGLES_CL.dll")); if (sGLESDLL == NULL) return 0; // Cannot find OpenGL ES Common or Common Lite DLL. /* The following fetches address to each egl & gl function call * and stores it to the related function pointer. Casting through * void * results in warnings with VC warning level 4, which * could be fixed by casting to the true type for each fetch. */ #define IMPORT_FUNC(funcName) do { \ void *procAddress = (void *)GetProcAddress(sGLESDLL, _T(#funcName)); \ if (procAddress == NULL) result = 0; \ *((void **)&FNPTR(funcName)) = procAddress; } while (0) #endif // WIN32 #ifdef LINUX #ifdef ANDROID_NDK sGLESSO = dlopen("libGLESv1_CM.so", RTLD_NOW); #else /* !ANDROID_NDK */ sGLESSO = dlopen("libGLES_CM.so", RTLD_NOW); if (sGLESSO == NULL) sGLESSO = dlopen("libGLES_CL.so", RTLD_NOW); #endif /* !ANDROID_NDK */ if (sGLESSO == NULL) return 0; // Cannot find OpenGL ES Common or Common Lite SO. #define IMPORT_FUNC(funcName) do { \ void *procAddress = (void *)dlsym(sGLESSO, #funcName); \ if (procAddress == NULL) result = 0; \ *((void **)&FNPTR(funcName)) = procAddress; } while (0) #endif // LINUX #ifndef ANDROID_NDK IMPORT_FUNC(eglChooseConfig); IMPORT_FUNC(eglCreateContext); IMPORT_FUNC(eglCreateWindowSurface); IMPORT_FUNC(eglDestroyContext); IMPORT_FUNC(eglDestroySurface); IMPORT_FUNC(eglGetConfigAttrib); IMPORT_FUNC(eglGetConfigs); IMPORT_FUNC(eglGetDisplay); IMPORT_FUNC(eglGetError); IMPORT_FUNC(eglInitialize); IMPORT_FUNC(eglMakeCurrent); IMPORT_FUNC(eglSwapBuffers); IMPORT_FUNC(eglTerminate); IMPORT_FUNC(eglGetProcAddress); #endif /* !ANDROID_NDK */ IMPORT_FUNC(glBlendFunc); IMPORT_FUNC(glClear); IMPORT_FUNC(glClearColorx); IMPORT_FUNC(glColor4x); IMPORT_FUNC(glColorPointer); IMPORT_FUNC(glDisable); IMPORT_FUNC(glDisableClientState); IMPORT_FUNC(glDrawArrays); IMPORT_FUNC(glEnable); IMPORT_FUNC(glEnableClientState); IMPORT_FUNC(glFrustumx); IMPORT_FUNC(glGetError); IMPORT_FUNC(glLightxv); IMPORT_FUNC(glLoadIdentity); IMPORT_FUNC(glMaterialx); IMPORT_FUNC(glMaterialxv); IMPORT_FUNC(glMatrixMode); IMPORT_FUNC(glMultMatrixx); IMPORT_FUNC(glNormalPointer); IMPORT_FUNC(glPopMatrix); IMPORT_FUNC(glPushMatrix); IMPORT_FUNC(glRotatex); IMPORT_FUNC(glScalex); IMPORT_FUNC(glShadeModel); IMPORT_FUNC(glTranslatex); IMPORT_FUNC(glVertexPointer); IMPORT_FUNC(glViewport); IMPORT_FUNC(glIsRenderbufferOES); IMPORT_FUNC(glBindRenderbufferOES); IMPORT_FUNC(glDeleteRenderbuffersOES); IMPORT_FUNC(glGenRenderbuffersOES); IMPORT_FUNC(glRenderbufferStorageOES); IMPORT_FUNC(glGetRenderbufferParameterivOES); IMPORT_FUNC(glIsFramebufferOES); IMPORT_FUNC(glBindFramebufferOES); IMPORT_FUNC(glDeleteFramebuffersOES); IMPORT_FUNC(glGenFramebuffersOES); IMPORT_FUNC(glCheckFramebufferStatusOES); IMPORT_FUNC(glFramebufferRenderbufferOES); IMPORT_FUNC(glFramebufferTexture2DOES); IMPORT_FUNC(glGetFramebufferAttachmentParameterivOES); IMPORT_FUNC(glGenerateMipmapOES); #endif /* DISABLE_IMPORTGL */ return result; }
//fonction de chargement des plugins Plugin loadPlugin(char *file) { void* DLLHANDLE; #ifdef _WIN32 DLLHANDLE = LoadLibrary(file); #else DLLHANDLE = dlopen(file, RTLD_NOW); #endif Plugin plg = (Plugin)malloc(sizeof(Plugin_t)); plg->setIsServerStarted = (setIsServerStarted_t)(uintptr_t)IMPORT_FUNC(DLLHANDLE,"setIsServerStarted"); plg->setCallback = (setCallback_t)(uintptr_t)IMPORT_FUNC(DLLHANDLE,"setCallback"); plg->setTux_Open = (setTux_Open_t)(uintptr_t)IMPORT_FUNC(DLLHANDLE,"setTux_Open"); plg->setTux_Close = (setTux_Close_t)(uintptr_t)IMPORT_FUNC(DLLHANDLE,"setTux_Close"); plg->setTux_OpenClose = (setTux_OpenClose_t)(uintptr_t)IMPORT_FUNC(DLLHANDLE,"setTux_OpenClose"); plg->setTux_Leds_OnOff = (setTux_Leds_OnOff_t)(uintptr_t)IMPORT_FUNC(DLLHANDLE,"setTux_Leds_OnOff"); plg->setTux_Leds_Blink = (setTux_Leds_Blink_t)(uintptr_t)IMPORT_FUNC(DLLHANDLE,"setTux_Leds_Blink"); plg->setTux_Leds_Pulse = (setTux_Leds_Pulse_t)(uintptr_t)IMPORT_FUNC(DLLHANDLE,"setTux_Leds_Pulse"); plg->setTux_Micro = (setTux_Micro_t)(uintptr_t)IMPORT_FUNC(DLLHANDLE,"setTux_Micro"); plg->setTux_Audio = (setTux_Audio_t)(uintptr_t)IMPORT_FUNC(DLLHANDLE,"setTux_Audio"); plg->setTux_Flippers = (setTux_Flippers_t)(uintptr_t)IMPORT_FUNC(DLLHANDLE,"setTux_Flippers"); plg->setTux_Rotate = (setTux_Rotate_t)(uintptr_t)IMPORT_FUNC(DLLHANDLE,"setTux_Rotate"); plg->setTux_Flash = (setTux_Flash_t)(uintptr_t)IMPORT_FUNC(DLLHANDLE,"setTux_Flash"); plg->setTux_Sleep = (setTux_Sleep_t)(uintptr_t)IMPORT_FUNC(DLLHANDLE,"setTux_Sleep"); plg->setTux_Wakeup = (setTux_Wakeup_t)(uintptr_t)IMPORT_FUNC(DLLHANDLE,"setTux_Wakeup"); plg->setTux_Off = (setTux_Off_t)(uintptr_t)IMPORT_FUNC(DLLHANDLE,"setTux_Off"); plg->setTux_Reset = (setTux_Reset_t)(uintptr_t)IMPORT_FUNC(DLLHANDLE,"setTux_Reset"); plg->setTux_TTS = (setTux_TTS_t)(uintptr_t)IMPORT_FUNC(DLLHANDLE,"setTux_TTS"); plg->setTux_State = (setTux_State_t)(uintptr_t)IMPORT_FUNC(DLLHANDLE,"setTux_State"); plg->onCommand = (onCommand_t)(uintptr_t)IMPORT_FUNC(DLLHANDLE,"onCommand"); plg->Initialize = (Initialize_t)(uintptr_t)IMPORT_FUNC(DLLHANDLE,"Initialize"); plg->onButtonPressed = (onButtonPressed_t)(uintptr_t)IMPORT_FUNC(DLLHANDLE,"onButtonPressed"); plg->onButtonReleased = (onButtonReleased_t)(uintptr_t)IMPORT_FUNC(DLLHANDLE,"onButtonReleased"); plg->onDongleConnected = (onDongleConnected_t)(uintptr_t)IMPORT_FUNC(DLLHANDLE,"onDongleConnected"); plg->onDongleDisconnected = (onDongleDisconnected_t)(uintptr_t)IMPORT_FUNC(DLLHANDLE,"onDongleDisconnected"); plg->onChargerPlugged = (onChargerPlugged_t)(uintptr_t)IMPORT_FUNC(DLLHANDLE,"onChargerPlugged"); plg->onChargerUnPlugged = (onChargerUnPlugged_t)(uintptr_t)IMPORT_FUNC(DLLHANDLE,"onChargerUnPlugged"); plg->addClient = (addClient_t)(uintptr_t)IMPORT_FUNC(DLLHANDLE,"addClient"); plg->delClient = (delClient_t)(uintptr_t)IMPORT_FUNC(DLLHANDLE,"delClient"); plg->setPriority = (setPriority_t)(uintptr_t)IMPORT_FUNC(DLLHANDLE,"setPriority"); plg->removePriority = (removePriority_t)(uintptr_t)IMPORT_FUNC(DLLHANDLE,"removePriority"); return plg; }
bool OpenGLRuntimeLinking::loadOpenGLEntryPoints() { bool result = true; // Success by default // Load the entry points IMPORT_FUNC(glGetString); IMPORT_FUNC(glGetIntegerv); IMPORT_FUNC(glBindTexture); IMPORT_FUNC(glClear); IMPORT_FUNC(glClearStencil); IMPORT_FUNC(glClearDepth); IMPORT_FUNC(glClearColor); IMPORT_FUNC(glDrawArrays); IMPORT_FUNC(glDrawElements); IMPORT_FUNC(glColor4f); IMPORT_FUNC(glEnable); IMPORT_FUNC(glDisable); IMPORT_FUNC(glBlendFunc); IMPORT_FUNC(glFrontFace); IMPORT_FUNC(glCullFace); IMPORT_FUNC(glPolygonMode); IMPORT_FUNC(glTexParameteri); IMPORT_FUNC(glGenTextures); IMPORT_FUNC(glDeleteTextures); IMPORT_FUNC(glTexImage2D); IMPORT_FUNC(glPixelStorei); IMPORT_FUNC(glDepthMask); IMPORT_FUNC(glViewport); IMPORT_FUNC(glDepthRange); IMPORT_FUNC(glScissor); IMPORT_FUNC(glFlush); IMPORT_FUNC(glFinish); #ifdef WIN32 IMPORT_FUNC(wglGetCurrentDC); IMPORT_FUNC(wglGetProcAddress); IMPORT_FUNC(wglCreateContext); IMPORT_FUNC(wglDeleteContext); IMPORT_FUNC(wglMakeCurrent); #elif LINUX IMPORT_FUNC(glXMakeCurrent); IMPORT_FUNC(glXGetProcAddress); IMPORT_FUNC(glXGetProcAddressARB); IMPORT_FUNC(glXChooseVisual); IMPORT_FUNC(glXCreateContext); IMPORT_FUNC(glXDestroyContext); IMPORT_FUNC(glXGetCurrentContext); IMPORT_FUNC(glXQueryExtensionsString); IMPORT_FUNC(glXChooseFBConfig); IMPORT_FUNC(glXSwapBuffers); IMPORT_FUNC(glXGetClientString); #endif // Done return result; }
MODULE(MODULE_CLASS_MISC, ndis, NULL); #define NDIS_DUMMY_PATH "\\\\some\\bogus\\path" __stdcall static void ndis_status_func(ndis_handle, ndis_status, void *, uint32_t); __stdcall static void ndis_statusdone_func(ndis_handle); __stdcall static void ndis_setdone_func(ndis_handle, ndis_status); __stdcall static void ndis_getdone_func(ndis_handle, ndis_status); __stdcall static void ndis_resetdone_func(ndis_handle, ndis_status, uint8_t); __stdcall static void ndis_sendrsrcavail_func(ndis_handle); __stdcall static void ndis_intrhand(kdpc *, device_object *, irp *, struct ndis_softc *); static image_patch_table kernndis_functbl[] = { IMPORT_FUNC(ndis_status_func), IMPORT_FUNC(ndis_statusdone_func), IMPORT_FUNC(ndis_setdone_func), IMPORT_FUNC(ndis_getdone_func), IMPORT_FUNC(ndis_resetdone_func), IMPORT_FUNC(ndis_sendrsrcavail_func), IMPORT_FUNC(ndis_intrhand), { NULL, NULL, NULL } }; struct nd_head ndis_devhead; struct ndis_req { void (*nr_func)(void *); void *nr_arg;
void ExtensionsRuntimeLinking::initialize() { // Define a helper macro #define IMPORT_FUNC(funcName) \ if (result) \ { \ void *symbol = eglGetProcAddress(#funcName); \ if (nullptr != symbol) \ { \ *(reinterpret_cast<void**>(&(funcName))) = symbol; \ } \ else \ { \ RENDERER_OUTPUT_DEBUG_PRINTF("OpenGL ES 2 error: Failed to locate the entry point \"%s\" within the GLES shared library", #funcName) \ result = false; \ } \ } // Get the extensions string const char *extensions = reinterpret_cast<const char*>(glGetString(GL_EXTENSIONS)); //[-------------------------------------------------------] //[ EXT ] //[-------------------------------------------------------] mGL_EXT_texture_compression_s3tc = (nullptr != strstr(extensions, "GL_EXT_texture_compression_s3tc")); mGL_EXT_texture_compression_dxt1 = (nullptr != strstr(extensions, "GL_EXT_texture_compression_dxt1")); mGL_EXT_texture_compression_latc = (nullptr != strstr(extensions, "GL_EXT_texture_compression_latc")); mGL_EXT_texture_filter_anisotropic = (nullptr != strstr(extensions, "GL_EXT_texture_filter_anisotropic")); mGL_EXT_texture_array = (nullptr != strstr(extensions, "GL_EXT_texture_array")); if (mGL_EXT_texture_array) { // A funny thing: Tegra 2 has support for the extension "GL_EXT_texture_array", but has no support // for the "GL_OES_texture_3D"-extension. At least it's not listed in the extension string. // "GL_EXT_texture_array" is reusing functions defined by "GL_OES_texture_3D"... and therefore we're // now getting the function pointers of "GL_OES_texture_3D" to be able to use "GL_EXT_texture_array". // Works even when "GL_OES_texture_3D" is not listed. Nice. // Load the entry points bool result = true; // Success by default IMPORT_FUNC(glTexImage3DOES) IMPORT_FUNC(glTexSubImage3DOES) IMPORT_FUNC(glCopyTexSubImage3DOES) IMPORT_FUNC(glCompressedTexImage3DOES) IMPORT_FUNC(glCompressedTexSubImage3DOES) IMPORT_FUNC(glFramebufferTexture3DOES) mGL_EXT_texture_array = result; } mGL_EXT_Cg_shader = (nullptr != strstr(extensions, "GL_EXT_Cg_shader")); //[-------------------------------------------------------] //[ AMD ] //[-------------------------------------------------------] mGL_AMD_compressed_3DC_texture = (nullptr != strstr(extensions, "GL_AMD_compressed_3DC_texture")); //[-------------------------------------------------------] //[ NV ] //[-------------------------------------------------------] mGL_NV_get_tex_image = (nullptr != strstr(extensions, "GL_NV_get_tex_image")); if (mGL_NV_get_tex_image) { // Load the entry points bool result = true; // Success by default IMPORT_FUNC(glGetTexImageNV) IMPORT_FUNC(glGetCompressedTexImageNV) IMPORT_FUNC(glGetTexLevelParameterfvNV) IMPORT_FUNC(glGetTexLevelParameterivNV) mGL_NV_get_tex_image = result; } mGL_NV_fbo_color_attachments = (nullptr != strstr(extensions, "GL_NV_fbo_color_attachments")); mGL_NV_draw_buffers = (nullptr != strstr(extensions, "GL_NV_draw_buffers")); if (mGL_NV_draw_buffers) { // Load the entry points bool result = true; // Success by default IMPORT_FUNC(glDrawBuffersNV) mGL_NV_draw_buffers = result; } mGL_NV_read_buffer = (nullptr != strstr(extensions, "GL_NV_read_buffer")); if (mGL_NV_read_buffer) { // Load the entry points bool result = true; // Success by default IMPORT_FUNC(glReadBufferNV) mGL_NV_read_buffer = result; } //[-------------------------------------------------------] //[ OES ] //[-------------------------------------------------------] mGL_OES_mapbuffer = (nullptr != strstr(extensions, "GL_OES_mapbuffer")); if (mGL_OES_mapbuffer) { // Load the entry points bool result = true; // Success by default IMPORT_FUNC(glGetBufferPointervOES) IMPORT_FUNC(glMapBufferOES) IMPORT_FUNC(glUnmapBufferOES) mGL_OES_mapbuffer = result; } mGL_OES_element_index_uint = (nullptr != strstr(extensions, "GL_OES_element_index_uint")); mGL_OES_texture_3D = (nullptr != strstr(extensions, "GL_OES_texture_3D")); if (mGL_OES_texture_3D && !mGL_EXT_texture_array) { // See "GL_EXT_texture_array"-comment above // Load the entry points bool result = true; // Success by default IMPORT_FUNC(glTexImage3DOES) IMPORT_FUNC(glTexSubImage3DOES) IMPORT_FUNC(glCopyTexSubImage3DOES) IMPORT_FUNC(glCompressedTexImage3DOES) IMPORT_FUNC(glCompressedTexSubImage3DOES) IMPORT_FUNC(glFramebufferTexture3DOES) mGL_OES_texture_3D = result; } mGL_OES_packed_depth_stencil = (nullptr != strstr(extensions, "GL_OES_packed_depth_stencil")); mGL_OES_depth24 = (nullptr != strstr(extensions, "GL_OES_depth24")); mGL_OES_depth32 = (nullptr != strstr(extensions, "GL_OES_depth32")); mGL_OES_vertex_half_float = (nullptr != strstr(extensions, "GL_OES_vertex_half_float")); mGL_OES_vertex_array_object = (nullptr != strstr(extensions, "GL_OES_vertex_array_object")); if (mGL_OES_vertex_array_object) { // Load the entry points bool result = true; // Success by default IMPORT_FUNC(glBindVertexArrayOES) IMPORT_FUNC(glDeleteVertexArraysOES) IMPORT_FUNC(glGenVertexArraysOES) mGL_OES_vertex_array_object = result; } //[-------------------------------------------------------] //[ ANGLE ] //[-------------------------------------------------------] mGL_ANGLE_framebuffer_blit = (nullptr != strstr(extensions, "GL_ANGLE_framebuffer_blit")); if (mGL_ANGLE_framebuffer_blit) { // Load the entry points bool result = true; // Success by default IMPORT_FUNC(glBlitFramebufferEXT) mGL_ANGLE_framebuffer_blit = result; } mGL_ANGLE_framebuffer_multisample = (nullptr != strstr(extensions, "GL_ANGLE_framebuffer_multisample")); if (mGL_ANGLE_framebuffer_multisample) { // Load the entry points bool result = true; // Success by default IMPORT_FUNC(glRenderbufferStorageMultisampleANGLE) mGL_ANGLE_framebuffer_multisample = result; } // Undefine the helper macro #undef IMPORT_FUNC }