Commit 5cd06d2d authored by Rye Mutt's avatar Rye Mutt 🍞
Browse files

vendor source 1.5.4

parent 9e66c018
version: 1.0.{build}
image: Visual Studio 2015
configuration: Release
# Configure both 32-bit and 64-bit builds
environment:
matrix:
- platform: x86
config: Win32
pout: x86
- platform: x64
config: x64
pout: x64
shallow_clone: true
# Download Meson and Ninja, create install directory
before_build:
- mkdir build
- mkdir libepoxy-shared-%pout%
- cd build
- curl -LsSO https://github.com/mesonbuild/meson/releases/download/0.47.1/meson-0.47.1.tar.gz
- 7z x meson-0.47.1.tar.gz
- move dist\meson-0.47.1.tar .
- 7z x meson-0.47.1.tar
- rmdir dist
- del meson-0.47.1.tar meson-0.47.1.tar.gz
- curl -LsSO https://github.com/ninja-build/ninja/releases/download/v1.7.2/ninja-win.zip
- 7z x ninja-win.zip
- del ninja-win.zip
- cd ..
# Build and install
build_script:
- cd build
- call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" %PLATFORM%
- C:\Python36\python.exe meson-0.47.1\meson.py .. . --backend=ninja --prefix=%APPVEYOR_BUILD_FOLDER%\libepoxy-shared-%pout%
- ninja
- ninja install
- cd ..
# Copy license into install directory and create .zip file
after_build:
- copy COPYING libepoxy-shared-%pout%
- dir libepoxy-shared-%pout% /s /b
- 7z a -tzip libepoxy-shared-%pout%.zip libepoxy-shared-%pout%
artifacts:
- path: libepoxy-shared-%pout%.zip
name: libepoxy-shared-%pout%
test: off
# Upload .zip file to GitHub release
deploy:
release: $(APPVEYOR_REPO_TAG_NAME)
description: "Epoxy $(APPVEYOR_REPO_TAG_NAME)"
provider: GitHub
auth_token:
secure: X7Ro8Y2RWYo/M1AAn93f9X0dEQFvu7gPb6li2eKRtzPYLGj/JKm7MNWRw2cCcjm6
artifact: libepoxy-shared-$(pout)
draft: false
prerelease: false
on:
appveyor_repo_tag: true # deploy on tag push only
((nil
(indent-tabs-mode . nil)
(tab-width . 8)
(c-basic-offset . 4)
)
)
root = true
[*]
charset = utf-8
[*.{c,h}]
indent_style = space
indent_size = 4
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
[configure.ac]
indent_style = tab
indent_size = 8
[Makefile.am]
indent_style = tab
indent_size = 8
[.travis.yml]
indent_style = space
indent_size = 2
[*.md]
trim_trailing_whitespace = false
[meson.build]
indent_style = space
indent_size = 8
sudo: false
branches:
except:
- debian
- khronos-registry
os:
- linux
- osx
compiler:
- gcc
- clang
language:
- c
services:
- docker
matrix:
exclude:
- os: osx
compiler: gcc
before_install:
- |
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
brew update
brew install python@3 meson
# Use a Ninja with QuLogic's patch: https://github.com/ninja-build/ninja/issues/1219
mkdir -p $HOME/tools; curl -L http://nirbheek.in/files/binaries/ninja/macos/ninja -o $HOME/tools/ninja; chmod +x $HOME/tools/ninja
fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then docker pull ebassi/epoxyci ; fi
before_script:
- |
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
echo FROM ebassi/epoxyci > Dockerfile
echo ADD . /root >> Dockerfile
echo WORKDIR /root >> Dockerfile
docker build -t withgit .
fi
env:
- BUILD_OPTS=""
- BUILD_OPTS="-Dglx=no"
- BUILD_OPTS="-Degl=no"
- BUILD_OPTS="-Dx11=false"
script:
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then docker run withgit /bin/sh -c "CC=$CC .travis/epoxy-ci-linux.sh $BUILD_OPTS" ; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then /bin/sh -c "CC=$CC .travis/epoxy-ci-osx.sh $BUILD_OPTS" ; fi
FROM debian:stretch-slim
MAINTAINER Emmanuele Bassi <ebassi@gmail.com>
RUN apt-get update -qq && \
apt-get install --no-install-recommends -qq -y \
ca-certificates \
clang \
gcc \
libgl1-mesa-dev \
libegl1-mesa-dev \
libgles1-mesa-dev \
libgles2-mesa-dev \
libgl1-mesa-dri \
locales \
ninja-build \
pkg-config \
python3 \
python3-pip \
python3-setuptools \
python3-wheel \
xvfb && \
rm -rf /usr/share/doc/* /usr/share/man/*
RUN locale-gen C.UTF-8 && /usr/sbin/update-locale LANG=C.UTF-8
ENV LANG=C.UTF-8 LANGUAGE=C.UTF-8 LC_ALL=C.UTF-8
RUN pip3 install meson
WORKDIR /root
#!/bin/bash
dump_log_and_quit() {
local exitcode=$1
cat meson-logs/testlog.txt
exit $exitcode
}
# Start Xvfb
XVFB_WHD=${XVFB_WHD:-1280x720x16}
Xvfb :99 -ac -screen 0 $XVFB_WHD -nolisten tcp &
xvfb=$!
export DISPLAY=:99
srcdir=$( pwd )
builddir=$( mktemp -d build_XXXXXX )
meson --prefix /usr "$@" $builddir $srcdir || exit $?
cd $builddir
ninja || exit $?
meson test || dump_log_and_quit $?
cd ..
# Stop Xvfb
kill -9 ${xvfb}
#!/bin/sh
dump_log_and_quit() {
local exitcode=$1
cat meson-logs/testlog.txt
exit $exitcode
}
export SDKROOT=$( xcodebuild -version -sdk macosx Path )
export CPPFLAGS=-I/usr/local/include
export LDFLAGS=-L/usr/local/lib
export OBJC=$CC
export PATH=$HOME/tools:$PATH
srcdir=$( pwd )
builddir=$( mktemp -d build_XXXXXX )
meson ${BUILDOPTS} $builddir $srcdir || exit $?
cd $builddir
ninja || exit $?
meson test || dump_log_and_quit $?
cd ..
#!/bin/bash
set -xe
srcdir="$(pwd)/.."
sudo docker build \
--tag "epoxyci" \
--file "Dockerfile" .
sudo docker run --rm \
--volume "${srcdir}:/root/epoxy" \
--tty --interactive "epoxyci" bash
The libepoxy project code is covered by the MIT license:
/*
* Copyright © 2013-2014 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*/
The generated code is derived from Khronos's xml files, which appear
under the following license:
/*
* Copyright (c) 2013 The Khronos Group Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and/or associated documentation files (the
* "Materials"), to deal in the Materials without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Materials, and to
* permit persons to whom the Materials are furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
*
* THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/
# Copyright © 2013 Intel Corporation
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice (including the next
# paragraph) shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = include/epoxy src
SUBDIRS += test
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = epoxy.pc
registry_files = \
registry/egl.xml \
registry/gl.xml \
registry/glx.xml \
registry/wgl.xml \
$()
meson_build_files = \
meson_options.txt \
meson.build \
include/epoxy/meson.build \
src/meson.build \
test/meson.build \
doc/meson.build \
doc/Doxyfile.in \
cross/fedora-mingw64.txt \
$()
EXTRA_DIST = \
.dir-locals.el \
README.md \
autogen.sh \
epoxy.pc.in \
$(registry_files) \
$(meson_build_files) \
$()
dist-hook:
@if test -d "$(top_srcdir)/.git"; then \
echo Generating ChangeLog... ; \
( $(top_srcdir)/missing --run git log --stat ) > "$(top_srcdir)/ChangeLog.tmp" \
&& mv -f "$(top_srcdir)/ChangeLog.tmp" "$(top_distdir)/ChangeLog" \
|| ( rm -f "$(top_srcdir)/ChangeLog.tmp"; \
echo Failed to generate ChangeLog >&2 ); \
else \
echo A git checkout is required to generate a ChangeLog >&2; \
fi
[![Build Status](https://travis-ci.org/anholt/libepoxy.svg?branch=master)](https://travis-ci.org/anholt/libepoxy)
[![Build status](https://ci.appveyor.com/api/projects/status/xv6y5jurt5v5ngjx/branch/master?svg=true)](https://ci.appveyor.com/project/ebassi/libepoxy/branch/master)
Epoxy is a library for handling OpenGL function pointer management for
you.
It hides the complexity of `dlopen()`, `dlsym()`, `glXGetProcAddress()`,
`eglGetProcAddress()`, etc. from the app developer, with very little
knowledge needed on their part. They get to read GL specs and write
code using undecorated function names like `glCompileShader()`.
Don't forget to check for your extensions or versions being present
before you use them, just like before! We'll tell you what you forgot
to check for instead of just segfaulting, though.
Features
--------
* Automatically initializes as new GL functions are used.
* GL 4.6 core and compatibility context support.
* GLES 1/2/3 context support.
* Knows about function aliases so (e.g.) `glBufferData()` can be
used with `GL_ARB_vertex_buffer_object` implementations, along
with GL 1.5+ implementations.
* EGL, GLX, and WGL support.
* Can be mixed with non-epoxy GL usage.
Building
--------
```sh
mkdir _build && cd _build
meson
ninja
sudo ninja install
```
Dependencies for Debian:
* meson
* libegl1-mesa-dev
Dependencies for macOS (using MacPorts):
* pkgconfig
* meson
The test suite has additional dependencies depending on the platform.
(X11, EGL, a running X Server).
Switching your code to using epoxy
----------------------------------
It should be as easy as replacing:
```cpp
#include <GL/gl.h>
#include <GL/glx.h>
#include <GL/glext.h>
```
with:
```cpp
#include <epoxy/gl.h>
#include <epoxy/glx.h>
```
As long as epoxy's headers appear first, you should be ready to go.
Additionally, some new helpers become available, so you don't have to
write them:
`int epoxy_gl_version()` returns the GL version:
* 12 for GL 1.2
* 20 for GL 2.0
* 44 for GL 4.4
`bool epoxy_has_gl_extension()` returns whether a GL extension is
available (`GL_ARB_texture_buffer_object`, for example).
Note that this is not terribly fast, so keep it out of your hot paths,
ok?
Why not use libGLEW?
--------------------
GLEW has several issues:
* Doesn't know about aliases of functions (There are 5 providers of
`glPointParameterfv()`, for example, and you don't want to have to
choose which one to call when they're all the same).
* Doesn't support OpenGL ES.
* Has a hard-to-maintain parser of extension specification text
instead of using the old .spec file or the new .xml.
* Has significant startup time overhead when `glewInit()`
autodetects the world.
* User-visible multithreading support choice for win32.
The motivation for this project came out of previous use of libGLEW in
[piglit](http://piglit.freedesktop.org/). Other GL dispatch code
generation projects had similar failures. Ideally, piglit wants to be
able to build a single binary for a test that can run on whatever
context or window system it chooses, not based on link time choices.
We had to solve some of GLEW's problems for piglit and solving them
meant replacing every single piece of GLEW, so we built
piglit-dispatch from scratch. And since we wanted to reuse it in
other GL-related projects, this is the result.
Known issues when running on Windows
------------------------------------
The automatic per-context symbol resolution for win32 requires that
epoxy knows when `wglMakeCurrent()` is called, because `wglGetProcAddress()`
returns values depend on the context's device and pixel format. If
`wglMakeCurrent()` is called from outside of epoxy (in a way that might
change the device or pixel format), then epoxy needs to be notified of
the change using the `epoxy_handle_external_wglMakeCurrent()` function.
The win32 `wglMakeCurrent()` variants are slower than they should be,
because they should be caching the resolved dispatch tables instead of
resetting an entire thread-local dispatch table every time.
#! /bin/sh
srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.
ORIGDIR=`pwd`
cd "$srcdir"
mkdir m4 || exit 1
autoreconf -v --install || exit $?
cd "$ORIGDIR" || exit $?
if test -z "$NOCONFIGURE"; then
exec "$srcdir/configure" "$@"
fi
# Copyright © 2013 Intel Corporation
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice (including the next
# paragraph) shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
# Initialize Autoconf
AC_PREREQ([2.60])
AC_INIT([libepoxy],
[1.5.4],
[https://github.com/anholt/libepoxy],
[libepoxy])
AC_CONFIG_SRCDIR([Makefile.am])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
# Initialize Automake
AM_INIT_AUTOMAKE([foreign -Wno-portability dist-xz no-dist-gzip tar-ustar subdir-objects])
# Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS
m4_ifndef([XORG_MACROS_VERSION],
[m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen.
Hint: either install from source, git://anongit.freedesktop.org/xorg/util/macros or,
depending on you distribution, try package 'xutils-dev' or 'xorg-x11-util-macros'])])
XORG_MACROS_VERSION(1.8)
XORG_DEFAULT_OPTIONS
AC_CHECK_PROGS([PYTHON], [python3 python2 python])
# Initialize libtool
AC_DISABLE_STATIC
AC_LIBTOOL_WIN32_DLL
AC_PROG_LIBTOOL
AC_SYS_LARGEFILE
AC_CHECK_HEADER([KHR/khrplatform.h],
[AC_DEFINE([HAVE_KHRPLATFORM_H], [1],
[Define to 1 if you have <KHR/khrplatform.h> (used for tests)]
)]
)
# OS X defaults to having -Wint-conversion ("warn when passing
# uintptr_t to a void *") by default. Kill that.
XORG_TESTSET_CFLAG(CWARNFLAGS, [-Wno-int-conversion])
AC_ARG_ENABLE([x11],
[AC_HELP_STRING([--enable-x11=@<:@yes,no@:>@], [Enable X11 support @<:@default=yes@:>@])],
[enable_x11=$enableval],
[enable_x11=yes])
AC_ARG_ENABLE([glx],
[AC_HELP_STRING([--enable-glx=@<:@auto,yes,no@:>@], [Enable GLX support @<:@default=auto@:>@])],
[enable_glx=$enableval],
[enable_glx=auto])
# GLX can be used on different platforms, so we expose a
# configure time switch to enable or disable it; in case
# the "auto" default value is set, we only enable GLX
# support on Linux and Unix
AS_CASE([$enable_glx],
[auto], [
AS_CASE([$host_os],
[mingw*], [build_glx=no],
[darwin*], [build_glx=no],
[android*], [build_glx=no],
[build_glx=yes])
],
[yes], [
build_glx=yes
],
[no], [
build_glx=no
],
[AC_MSG_ERROR([Invalid value "$enable_glx" for option "--enable-glx"])]
])
AC_ARG_ENABLE([egl],
[AC_HELP_STRING([--enable-egl=@<:@auto,yes,no@:>@], [Enable EGL support @<:@default=auto@:>@])],
[enable_egl=$enableval],
[enable_egl=auto])
AS_CASE([$enable_egl],
[auto], [
AS_CASE([$host_os],
[mingw*], [build_egl=no],
[darwin*], [build_egl=no],
[build_egl=yes])
],
[yes], [
build_egl=yes
],