summaryrefslogtreecommitdiff
path: root/src/dispatch_common.c
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix support for a static build of Epoxy. Add support building and running ↵Yaron Cohen-Tal2015-09-031-1/+2
| | | | tests with CMake. Add support for linking with the static run-time library with MSVC.
* Remove redundant code in "epoxy_get_bootstrap_proc_address".Yaron Cohen-Tal2015-08-301-9/+1
|
* Add support for CMake (no support for building/running the tests yet). Fix ↵Yaron Cohen-Tal2015-08-261-15/+27
| | | | support for Android. Add built-in support for building with EGL support (using "khrplatform.h" and "eglplatform.h" which are distributed together with Epoxy, and should work with any platform).
* Fix support of some OpenGL ES and EGL implementations, specifically on Windows.Yaron Cohen-Tal2015-08-241-86/+40
|
* Unite defenitions "PUBLIC" and "EPOXY_IMPORTEXPORT" and add it where ↵Yaron Cohen-Tal2015-07-191-5/+5
| | | | appropriate. Fix tests build errors.
* Use __attribute__((packed)) to reduce our data size.Eric Anholt2015-07-151-19/+0
| | | | | | Since our provider enums are small, we can store them as bytes or shorts if we just let the compiler know that it's OK. Saves 20kb in the compiled library.
* Fix epoxy_egl_get_current_gl_context_api() on non-conformant ES.Yaron Cohen-Tal2015-07-151-0/+20
| | | | | | | | According to the OpenGL ES standard, "glGetString(GL_VERSION)" should return a string starting with "OpenGL ES". However, PowerVR's OpenGL ES implementation (and perhaps others) don't comply with the standard here. If our context happend to be bound using EGL, then we can just ask EGL what kind of context it was, avoiding the glGetString() check.
* Look for GL 1.1 functions in win32's OpenGL32.dll.Eric Anholt2015-07-151-1/+1
| | | | | The windows ABI is GL 1.1, not 1.0. You get NULL pointers for 1.1 functions when calling wglGetProcAddress(). Fixes #47.
* src/dispatch_common.c: Remove Unneeded PUBLIC AnnotationChun-wei Fan2015-06-171-1/+1
| | | | | | | Don't mark epoxy_conservative_gl_version() for export, as it is meant to be a private API to be used within libepoxy only. Reviewed-by: Eric Anholt <eric@anholt.net>
* Put the callspec after the return type for MSVC.Chun-wei Fan2015-06-051-2/+2
| | | | | Visual Studio does not like __stdcall before the return type, which is what GLAPIENTRY and EPOXY_CALLSPEC expands to on Windows.
* Avoid empty struct intializer on MSVC.Chun-wei Fan2015-06-051-0/+2
| | | | | It is a C99 feature that is not supported (nor will it probably be at any point) on Visual Studio.
* Port the library_init() constructor to MSVC.Chun-wei Fan2015-06-051-2/+21
|
* Fix context type detection if we find eglGetCurrentContext().Eric Anholt2014-06-131-1/+1
| | | | Fixes #29.
* Remove a C99ism from dispatch.Eric Anholt2014-06-131-1/+2
| | | | | I've decided it's time to accept that building with MSVC 2010 is a way that people want to use this software.
* Adds support for Android.Ryan Houdek2014-05-281-7/+25
| | | | | | | | This has been tested with both OpenGL and OpenGL ES on Android. We can't use dlsym on Android to get all the function pointers since Android's libGLES* libraries are just shim libraries that pass everything through to the real vendor specific libraries. Due to this we must grab function pointers entirely through eglGetProcAddress instead of dlsym.
* Fix EGL context detection for non-GLES2-core functions.Eric Anholt2014-04-081-10/+8
| | | | | | | Fixes failure of the X Server with glamor using desktop GL on EGL, and the associated testcase in the tree. This was clearly just copy-and-paste failure on my part in b251e3ae337cecda3cbede6fde8cc8f7cef942c9.
* Clean up epoxy_current_context_is_glx().Eric Anholt2014-03-271-16/+20
| | | | | | | Now that it's split out from epoxy_get_core_proc_address(), the particular symbols we were testing for before calling GetCurrentContext() didn't make much sense, plus we were leaking dlerror()s still.
* Ask glXGetProcAddress for ES symbols when we're on a GLX context.Eric Anholt2014-03-271-6/+18
| | | | Fixes #24
* Factor out the GLX versus EGL current context detection code.Eric Anholt2014-03-271-43/+70
| | | | | It turns out I need to reuse this for GLES symbols when using GLX_EXT_create_context_es2_profile.
* Don't leak dlerror()s while we're trying to probe libraries.Eric Anholt2014-03-271-4/+11
| | | | Again, no known bugs, but it seems like a bad idea.
* Don't dlsym() if we failed to dlopen().Eric Anholt2014-03-271-3/+6
| | | | No reported bugs I'm fixing here, just cleanup.
* Remove a debug printf that slipped in.Eric Anholt2014-03-271-2/+0
|
* Avoid using eglGPA() for core funcs when the current context is GLX.Eric Anholt2014-03-191-2/+7
| | | | | | If you already had GLX loaded by epoxy, this wouldn't happen, but on the first call, fallback cases might have taken the EGL path if EGL was loaded.
* Refactor dispatch_common's EGL context detection code.Eric Anholt2014-03-191-30/+46
| | | | I want to reuse this from get_core_proc_address().
* Try to use glXGPA() for core funcs if the current context is GLX.Eric Anholt2014-03-191-17/+13
| | | | | | | Fixes the GLX-only subtest of egl_and_glx_different_pointers. Now what remains is dispatch tables for when you're actively using both. Fixes #23
* Try to avoid looking up bootstrap functions in the wrong library.Eric Anholt2014-03-191-5/+3
| | | | Fixes the EGL-only subtest of egl_and_glx_different_pointers.
* Add a test for EGL and GLX returning different function pointers.Eric Anholt2014-03-191-0/+2
| | | | | This is the case on the nvidia binary driver's GL, or when you've got a system mixing nvidia binary GL and Mesa EGL.
* Add support for looking up GLES3 functions using dlsym().Eric Anholt2014-03-171-1/+22
| | | | | | | ARM and Mesa disagreed on how to look up the functions, so support both ways. Fixes #21
* Catch eglBindAPI() failures in looking up bootstrap functions.Eric Anholt2014-03-171-19/+24
| | | | | | | | | | | | | This fixes crashes on ARM's Mali drivers, where desktop GL isn't supported, and epoxy didn't notice the error and tried to dlsym() on libGL.so.1. An alternative would have been to look at the response from eglQueryAPI() first, but that would have meant that we still need to BindAPI in the case that eglQueryAPI returns something like VG or CL, and so we needed to handle these errors regardless. Fixes #22
* Fix some silly line-wrapping in a printf.Eric Anholt2014-02-061-2/+1
|
* Add a missing \n on an error message.Eric Anholt2014-02-061-1/+1
|
* Fix a missing \n on printing out failure to dlsym().Eric Anholt2014-01-311-1/+1
|
* Fix using epoxy on systems with only EGL and GLES1 or GLES2.Eric Anholt2014-01-311-1/+69
| | | | Fixes #19
* Fix typo in gles2 dlsym setupEric Anholt2014-01-311-1/+1
| | | | | | If you happened to do both GLES2 and GLES1 in a process, it meant that you'd try to look up v1 procs in the v2 API, and lose. Caught by piglit oes_fixed_point-attribute-arrays.
* Add support for Mesa's GLES1 implementation.Eric Anholt2014-01-221-1/+1
| | | | | Mesa reports "OpenGL ES-CM 1.1", so we need to not look for a space after "ES", and 1.1 is still a 1.0-compatible implementation.
* win32: Convert the API to being based on function pointers, like Linux.Eric Anholt2013-12-171-2/+0
| | | | | | | | | | For performance, I want to be able to make single-context (well, single-pixel-format-and-device) apps be able to directly call GL functions through function pointers. Bake that into the ABI now so I can get a release out the door and fix this up later. This also fixes the lack of __stdcall annotation on the PFNWHATEVERPROC typedefs.
* win32: Reset all dispatch tables to re-resolve on any wglMakeCurrent.Eric Anholt2013-12-171-8/+0
|
* Drop the PLATFORM_HAS_EGL check in epoxy_egl_dlsym().Eric Anholt2013-12-171-4/+0
| | | | | If you accidentally call it on a non-egl platform, better to get an informative error message.
* win32: Move dynamic symbol loading to do_dlsym().Eric Anholt2013-12-171-12/+13
| | | | | This should help get us better error handling when we accidentally call the wrong loader path.
* Fix printout of missing versions/extensions.Eric Anholt2013-12-151-1/+1
| | | | Not sure how I misplaced the \n in the previous fix.
* Fix loading of extension functions on OS X.Eric Anholt2013-12-151-0/+2
| | | | | | For a non-GLX application, at least, we need to pull our extensions using dlsym, not glXGetProcAddress(). The symptom was a segfault in glXGetProcAddress().
* Abandon ifuncs and go with the traditional global function pointers.Eric Anholt2013-12-151-4/+17
| | | | | | | | In addition to the failing testcase, there were a couple of regressions in piglit's attribs test: one from glBegin_unwrapped vs glBegin confusion in the __asm__ directives we were generating, and one where the function pointers apparently were just getting mixed up at application runtime.
* Add a check that we've made it into the C runtime when doing dlopen().Eric Anholt2013-12-131-0/+17
| | | | | This should give us a more informative failure mode than the one mentioned in the README.
* Fix infinite loop in extension detection when the needle is a substring.Eric Anholt2013-12-121-3/+7
| | | | We could keep examining the same ptr value over and over.
* Use the right library name for GLX on OS X.Eric Anholt2013-12-121-2/+8
|
* Fix the path to the GL library on OS X.Eric Anholt2013-12-111-0/+11
|
* Disable EGL on OS X.Eric Anholt2013-12-111-1/+13
| | | | | It doesn't exist. There's EAGL, but that's not something we're covering.
* Add dispatch generation for wgl.Eric Anholt2013-12-101-1/+11
| | | | This is very poorly tested at this point, but survives a simple testcase.
* Fill in the begin/end counting on win32.Eric Anholt2013-12-101-3/+3
|
* Move the check for whether to dlsym or GPA on linux to the common C code.Eric Anholt2013-12-091-0/+10
| | | | | | This is going to change for macos and win32, and this will be easier than trying to spread that logic through the python code and into the generated code.