Commit Graph
21 Commits
Author SHA1 Message Date
Emmanuele Bassi 6af57b0745 Write the API reference
Now that we have Doxygen generating it, we should fill out the API
reference for Epoxy.
2017-02-03 11:13:30 +00:00
Emmanuele Bassi 6973dd5db3 Add a fallback for missing stdbool.h
Older versions of the Microsoft Visual C compiler do not support C99 and
do not have stdbool.h.

Additionally, Epoxy is pretty much C89 compliant, and stdbool.h is part
of C99.

We can add a simple fallback for MSVC, in case we end up getting built
with it.
2017-02-01 00:02:16 +00:00
Emmanuele Bassi 7a06803465 Improve consistency of the symbol visibility
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
2017-01-25 12:43:17 +00:00
Emmanuele Bassi 0625a74d69 Add common header
We're going to use this header to provide shared macros. Right now, we
can use it to replace the:

    #ifdef __cplusplus
    extern "C" {
    #endif

    …

    #ifdef __cplusplus
    }
    #endif

Stanzas for every installed header, with easier to read macros in the
same spirit of Cairo and GLib.
2017-01-25 12:43:17 +00:00
Emmanuele Bassi 8dead45cb3 Revert all changes since 8bbc0d40
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.
2016-12-07 14:45:14 +00:00
Yaron Cohen-Tal a4ead97cfd Make "epoxy_current_context_is_egl" visible. 2015-10-31 20:31:42 +02:00
Yaron Cohen-Tal 06fd4a271a Add support for CMake (no support for building/running the tests yet). Fix 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). 2015-08-26 19:41:51 +03:00
Yaron Cohen-Tal 90c6158d61 Unite defenitions "PUBLIC" and "EPOXY_IMPORTEXPORT" and add it where appropriate. Fix tests build errors. 2015-07-19 13:40:35 +03:00
Chun-wei Fan d88c639e63 Fix public headers for building in Visual Studio
Ensure that we also have import/export decorations for the prototypes, as
Visual Studio does not like such decorations on the function definitions
without the prototypes decorated as well, when the function prototypes
exist.
2015-06-05 17:50:45 -07:00
Eric Anholt 568533441f Move __stdcall into the parens for function pointer definitions.
MSVC 2010 appears to require that it be located there.
2014-04-10 13:37:47 -07:00
Eric Anholt 67a1ad4f6c Add limited support for the KHRONOS_* defines from khrplatform.h.
The only way these get used is when you choose to include epoxy/gl.h
but EGL/egl.h.  I'm not sure that's something I want to actually
support, but piglit happened to do so, and this gets things working.

There's not as much support here as in real khrplatform.h, but then
there's no EGL for windows.  And seriously, compilers support 64-bit
and float types, why would you even build this complexity?
2014-02-06 14:50:22 -08:00
Eric Anholt f10bff9bc0 Avoid polluting the compiler's namespace with our own stuff.
We can't completely avoid it, since gl's headers use these defines for
their header guards, and we really do need to stop the system GL
headers from doing anything.

Fixes #14
2014-01-22 01:00:56 -08:00
Eric Anholt 9bc909f5a7 win32: Convert the API to being based on function pointers, like Linux.
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.
2013-12-17 15:08:02 -08:00
Eric Anholt 8022cda75d Don't forget to tell our users that the epoxy GL functions are __dllimport.
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).
2013-12-17 12:10:34 -08:00
Eric Anholt 21f4346af0 Update header comments about how the implementation works. 2013-12-16 09:18:58 -08:00
Eric Anholt 982e39f188 Move the #defines into the main generated header.
I initially thought I was going to have two sets of defines you chose
from using #include, but that never ended up being necessary.
2013-12-15 20:16:01 -08:00
Eric Anholt 08101c5145 Add some more defines that are present in normal gl.h 2013-12-06 11:38:41 -08:00
Eric Anholt 111c54992b Drop the installed _common.h headers.
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).
2013-12-05 11:12:23 -08:00
Eric Anholt 2ba8d853b4 Add some more gl.h definitions that might be used by applications.
These in particular get used by software that was doing
GetProcAddress, and we want to be able to just drop in our gl.h
instead.
2013-12-04 23:10:13 -08:00
Eric Anholt 725b8cfc81 Add C++ guards. 2013-12-04 23:07:13 -08:00
Eric Anholt a909eb4a22 Add the generator and build infrastructure.
Not actually working yet, but it's a snapshot to start from.
2013-10-16 11:43:11 -07:00