summaryrefslogtreecommitdiff
path: root/src/dispatch_common.h
Commit message (Collapse)AuthorAgeFilesLines
* Add API to allow for platform detectionEmmanuele Bassi2017-02-061-0/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | On Linux and other Unix variants we may not have access to GLX and EGL at run time. Dependent libraries can only discover this by using dlsym() on various symbols, because as soon as they attempt to call those symbols through Epoxy, Epoxy will abort. This means that a bunch of code needs to be copy-pasted between projects, with the high chance of somebody getting it wrong. Epoxy already has all the internals needed to detect whether GLX and EGL are available, so exposing a simple API is a better alternative. Fixes #73
| * Add conservative functions for checking platform symbolsEmmanuele Bassi2017-02-031-0/+2
| | | | | | | | | | | | | | | | | | | | When checking whether GLX or EGL are available on the system, we don't want to use the internal API that forces an exit() on missing libraries and symbols — as that would defeat the point. Instead, we should have safe functions to call internally that simply return a NULL pointer, so we can bail out ourselves in a controlled fashion.
| * Drop additional stdbool.h include directivesEmmanuele Bassi2017-02-031-2/+0
| |
* | Allow enabling and disabling GLX supportEmmanuele Bassi2017-02-061-5/+3
|/ | | | | | | | | | | | | | | | | Currently, GLX support in libepoxy at build time is hard coded, but various platforms have expressed their preference for having a configure-time option for it. For instance: - various embedded distributors do not ship with X11, but wish to use libraries that depend on libepoxy now that Wayland is available - distributors for macOS still wish to retain the ability to ship their software with X11 enabled By default, we want epoxy to build with GLX enabled pretty much everywhere it makes sense, since it's only a build-time option and it's not a run-time dependency.
* Improve consistency of the symbol visibilityEmmanuele Bassi2017-01-251-14/+2
| | | | | | | | | | | | | | | | | | | | | | | | To avoid a symbols file on Windows, Epoxy annotates all the publicly visible symbols directly in the source, but uses the default symbol visibility everywhere else. This means that only some symbols are annotated as `EPOXY_IMPORTEXPORT`, and generally only on Windows. Additionally, Epoxy has a private 'PUBLIC' pre-processor macro for internal use, which duplicates the `EPOXY_IMPORTEXPORT` but contains more logic to detect GCC, in case we're building with GCC on Windows. This would be enough, except that EGL is also available on Windows, which means we'd have to annotate the exported `epoxy_*` API inside epoxy/egl.h as well. At that point, though, we should probably avoid any confusion, and adopt a single symbol visibility policy across the board. This requires some surgery of the generated and common dispatch sources, but cuts down the overall complexity: - there is only one annotation, `EPOXY_PUBLIC`, used everywhere - the annotation detection is done at Epoxy configuration time - only annotated symbols are public, on every platform - annotated symbols are immediately visible from the header
* MSVC Builds: Support PACKEDChun-wei Fan2017-01-251-0/+5
| | | | | | | | | Define PACKED for Visual Studio builds, so that we can try to reduce our library size for Visual Studio builds. Add a ENDPACKED macro that is currently defined only for Visual Studio builds as packing is done via __pragma(pack(push,n), that should be popped when done. Signed-off-by: Emmanuele Bassi <ebassi@gnome.org>
* Revert all changes since 8bbc0d40Emmanuele Bassi2016-12-071-12/+37
| | | | | | | | | | | | | | | Most of the changes that happened after commit 8bbc0d40 broke epoxy pretty much irreparably because of the CMake build and the attempt at making libepoxy a static library that can be copy-pasted into another project without generating files. Since all the commits are entangled, and are full of unrelated changes, we cannot simply do a localized set of reverts; instead, we need to hit the reset button. From this point forward, we're going to improve libepoxy's build while attempting to keep the existing build system working. This may mean reinstating the CMake build system at a later date.
* Fix support for a static build of Epoxy. Add support building and running ↵Yaron Cohen-Tal2015-09-031-0/+0
| | | | tests with CMake. Add support for linking with the static run-time library with MSVC.
* Fix a bug in which "DllMain" isn't called when using the static version of ↵Yaron Cohen-Tal2015-08-301-1/+5
| | | | Epoxy in Windows.
* Add support for building static libs with CMake. Fix file permissions. ↵Yaron Cohen-Tal2015-08-271-2/+2
| | | | Update documentation about building static libs and about using OpenGL ES / EGL.
* Add some files to the repo so that it's possible to build without running ↵Yaron Cohen-Tal2015-08-261-2/+0
| | | | "autogen.sh".
* Add support for CMake (no support for building/running the tests yet). Fix ↵Yaron Cohen-Tal2015-08-261-20/+7
| | | | 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).
* Unite defenitions "PUBLIC" and "EPOXY_IMPORTEXPORT" and add it where ↵Yaron Cohen-Tal2015-07-191-14/+0
| | | | appropriate. Fix tests build errors.
* Added makefiles to build with MSVC 2013, and fixed errors and warnings.Yaron Cohen-Tal2015-07-181-12/+12
|
* Use __attribute__((packed)) to reduce our data size.Eric Anholt2015-07-151-3/+6
| | | | | | 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.
* Put the callspec after the return type for MSVC.Chun-wei Fan2015-06-051-7/+7
| | | | | Visual Studio does not like __stdcall before the return type, which is what GLAPIENTRY and EPOXY_CALLSPEC expands to on Windows.
* Merge remote-tracking branch 'sonicadvance/OSX-NoX11Support'Eric Anholt2015-01-101-1/+1
|\ | | | | | | | | | | I've come around to the various contributors' positions: X11 on OSX is basically dead, and we're not serving our users by trying to support it.
| * Adds support for OS X without X11.Ryan Houdek2014-05-281-1/+1
| | | | | | | | | | OS X support shouldn't depend on X11 being installed on the host. Removes the X11 dependency.
* | Adds support for Android.Ryan Houdek2014-05-281-0/+5
|/ | | | | | | | 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.
* Move __stdcall into the parens for function pointer definitions.Eric Anholt2014-04-101-10/+9
| | | | MSVC 2010 appears to require that it be located there.
* win32: Delay using dispatch tables until the second MakeCurrent.Eric Anholt2014-03-281-19/+20
| | | | Fixes #11.
* Use #defines to shrink the size of gl_generated_dispatch.cEric Anholt2014-03-281-7/+86
| | | | I was running into file size limits with win32 debug symbols.
* Add support for looking up GLES3 functions using dlsym().Eric Anholt2014-03-171-0/+1
| | | | | | | ARM and Mesa disagreed on how to look up the functions, so support both ways. Fixes #21
* Fix using epoxy on systems with only EGL and GLES1 or GLES2.Eric Anholt2014-01-311-0/+1
| | | | Fixes #19
* win32: Convert the API to being based on function pointers, like Linux.Eric Anholt2013-12-171-7/+5
| | | | | | | | | | 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-0/+8
|
* win32: Use thread local storage to get us a dispatch table per thread.Eric Anholt2013-12-171-0/+7
|
* Don't forget to tell our users that the epoxy GL functions are __dllimport.Eric Anholt2013-12-171-0/+1
| | | | | | This lets the compiler generate faster function calls (call through function pointer, instead of call into a linker-generated stub func containing jump to function pointer).
* Fix declaration of glBegin/End_unwrapped.Eric Anholt2013-12-151-2/+2
| | | | | On non-win32, it was declaring a new function pointer variable on every #include, and OS X's linker got angry.
* Abandon ifuncs and go with the traditional global function pointers.Eric Anholt2013-12-151-2/+14
| | | | | | | | 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.
* Disable EGL on OS X.Eric Anholt2013-12-111-0/+4
| | | | | It doesn't exist. There's EAGL, but that's not something we're covering.
* Add dispatch generation for wgl.Eric Anholt2013-12-101-0/+6
| | | | This is very poorly tested at this point, but survives a simple testcase.
* Move the check for whether to dlsym or GPA on linux to the common C code.Eric Anholt2013-12-091-0/+1
| | | | | | 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.
* Start porting the GL dispatch code to win32.Eric Anholt2013-12-061-1/+3
| | | | | It now builds successfully builds a .dll file. Not that it's usable or anything yet.
* Move GLX/EGL dispatch code using those API types to separate files.Eric Anholt2013-12-061-0/+2
| | | | | | The dlopen bits are left in place, but the functions required the types, and in the case of EGL, the types require that the platform header actually exists.
* Conditionalize building the EGL and GLX dispatch code.Eric Anholt2013-12-061-1/+14
|
* Fix calling new entrypoints from within glBegin()/glEnd().Eric Anholt2013-12-051-0/+5
|
* Add support for EGL.Eric Anholt2013-12-051-18/+9
| | | | | | | This totally replaces the getprocaddress and dlsym code, which was basically just stubs up until now. The is_glx/is_egl() is also dropped -- they weren't doing anything, and the only false answer they could give is if the dlopen were to fail.
* Drop the installed _common.h headers.Eric Anholt2013-12-051-2/+2
| | | | | | | I was thinking at one point that part of the build was going to require not including the #defines from the generated code, but would want these prototypes. It turns out that's not the case (and if it is, I'll just wrap the #defines in an ifdef).
* Fix a similar bug to HEAD~2, this time in epoxy_has_glx_extension().Eric Anholt2013-12-041-0/+1
|
* Fix bug in public entrypoint for epoxy_glx_version()Eric Anholt2013-12-041-0/+1
| | | | | | | Unfortunately, for GLX 1.4+ entrypoints (just glxGetProcAddress currently) or extensions, if there isn't a context bound then we don't have a dpy and screen available to provide useful debug messages. Oh well.
* Make a table full of strings describing our providers.Eric Anholt2013-12-021-0/+3
| | | | | | By having shared code to print the names and a shared table of what the names are, this reduces the built stripped size of the library by 80k.
* Make a few more public functions actually public.Eric Anholt2013-11-141-1/+0
|
* Add the generator and build infrastructure.Eric Anholt2013-10-161-0/+55
Not actually working yet, but it's a snapshot to start from.