Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision

Target

Select target project
  • mesa/demos
  • skirk/demos
  • inequation/demos
  • kusma/mesa-demos
  • ajax/demos
  • ofourdan/demos
  • austriancoder/demos
  • eric/demos
  • jakogut/demos
  • frohlich/demos
  • dbaker/demos
  • challenzhou/demos
  • jrfonseca/demos
  • orbea/demos
  • mupuf/demos
  • xantares/demos
  • kevinoid/demos
  • theozzhh79/demos
  • EthanHsieh/demos
  • tantan/demos
  • baryluk/demos
  • siyueyinghua/demos
  • hch12907/mesa-demos
  • jljusten/mesa-demos
  • ydirson/demos
  • birdspider/demos
  • alex.kanavin/demos
  • airlied/demos
  • alanc/demos
  • lygstate/demos
  • vsyrjala/mesa-demos
  • stolk/demos
  • qyliss/demos
  • antonino/demos
  • ccawley2011/mesa-demos
  • psykose1/demos
  • dh/demos
  • robertfoss/demos
  • yselkowitz1/mesa-demos
  • Robin329/demos
  • blaztinn/demos
  • ella/demos
  • sima/mesa-demos
  • mstoeckl/demos
  • mildsunrise/mesa-demos
  • duncan.hopkins/demos
  • lucmann/demos
  • pleasurefish/demos
  • mattst88/demos
  • emendoz/mesa-demos
  • LDVSOFT/demos
  • zmike/demos
  • DDoSQc/demos
  • jadahl/mesa-demos
  • wujiansun/demos
  • StaticRocket/demos
56 results
Select Git revision
Show changes
Commits on Source (32)
Showing
with 454 additions and 231 deletions
# Shared editor configuration <https://editorconfig.org>
# This is the top-most EditorConfig file which should apply to files below
root = true
[*]
charset = utf-8
insert_final_newline = true
[*.cxx]
indent_size = 2
indent_style = space
[*.{c,cpp,h}]
indent_size = 3
indent_style = space
[{CMakeLists.txt,*.am,*.cmake,*.sh}]
indent_size = 8
indent_style = tab
...@@ -49,3 +49,5 @@ ltsugar.m4 ...@@ -49,3 +49,5 @@ ltsugar.m4
ltversion.m4 ltversion.m4
lt~obsolete.m4 lt~obsolete.m4
missing missing
wayland-xdg-shell-client-protocol.h
wayland-xdg-shell-protocol.c
variables: variables:
UPSTREAM_REPO: mesa/demos FDO_UPSTREAM_REPO: mesa/demos
include: include:
- project: 'wayland/ci-templates' - project: 'freedesktop/ci-templates'
ref: f69acac60d5dde0410124fd5674764600821b7a6 ref: 3f37cc0e461f5b0c815409bf6f55759f26a74e9c
file: '/templates/debian.yml' file: '/templates/debian.yml'
stages: stages:
...@@ -23,20 +23,20 @@ stages: ...@@ -23,20 +23,20 @@ stages:
# CONTAINERS # CONTAINERS
# Debian 10 based x86 build image # Debian 11 based x86 build image
x86_build: x86_build:
stage: container stage: container
extends: extends:
- .debian@container-ifnot-exists - .fdo.container-build@debian
- .ci-run-policy - .ci-run-policy
variables: variables:
DEBIAN_VERSION: buster-slim FDO_DISTRIBUTION_VERSION: bullseye-slim
REPO_SUFFIX: $CI_JOB_NAME FDO_REPO_SUFFIX: "debian/$CI_JOB_NAME"
# No need to pull the whole repo to build the container image # No need to pull the whole repo to build the container image
GIT_STRATEGY: none GIT_STRATEGY: none
# /!\ Bump the TAG when modifying the DEBS # /!\ Bump the TAG when modifying the DEBS
DEBIAN_TAG: &x86_build "2019-11-25" FDO_DISTRIBUTION_TAG: &x86_build "2022-04-30"
DEBIAN_DEBS: >- FDO_DISTRIBUTION_PACKAGES: >-
build-essential build-essential
autoconf autoconf
automake automake
...@@ -45,15 +45,21 @@ x86_build: ...@@ -45,15 +45,21 @@ x86_build:
pkg-config pkg-config
cmake cmake
ninja-build ninja-build
mingw-w64
extra-cmake-modules
freeglut3-dev freeglut3-dev
libegl1-mesa-dev libdrm-dev
libegl-dev
libgbm-dev libgbm-dev
libgl1-mesa-dev libgl-dev
libgles-dev
libudev-dev libudev-dev
libwayland-dev libwayland-dev
libx11-dev libx11-dev
libxcb1-dev libxcb1-dev
wayland-protocols
.use-x86_build: .use-x86_build:
variables: variables:
TAG: *x86_build TAG: *x86_build
...@@ -96,6 +102,13 @@ cmake: ...@@ -96,6 +102,13 @@ cmake:
- .use-x86_build - .use-x86_build
- .cmake-build - .cmake-build
cmake-mingw:
extends:
- .use-x86_build
- .build
script:
- .gitlab-ci/build-mingw.sh
autotools: autotools:
extends: extends:
- .use-x86_build - .use-x86_build
......
#!/bin/bash
if [ -d /usr/lib/ccache ]
then
export PATH="/usr/lib/ccache:$PATH"
fi
set -e -x -u
GLUT_INCLUDE_DIR="$PWD/external/freeglut/include"
GLUT_LIBRARY="$PWD/external/freeglut/lib/libfreeglut.a"
if [ ! -f "$GLUT_INCLUDE_DIR/GL/glut.h" ]
then
mkdir -p "$GLUT_INCLUDE_DIR/GL"
for header in GL/glut.h GL/freeglut.h GL/freeglut_std.h GL/freeglut_ext.h
do
cp -av "/usr/include/$header" "$GLUT_INCLUDE_DIR/$header"
done
fi
if [ ! -f "$GLUT_LIBRARY" ]
then
mkdir -p external/freeglut/lib
i686-w64-mingw32-dlltool --kill-at --def .gitlab-ci/freeglut.def --output-lib "$GLUT_LIBRARY"
fi
cmake \
-S . \
-B build/mingw32 \
-G "Ninja" \
-DCMAKE_TOOLCHAIN_FILE=.gitlab-ci/mingw32.cmake \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_INSTALL_PREFIX=publish/mingw32 \
-DGLUT_INCLUDE_DIR="$GLUT_INCLUDE_DIR" \
-DGLUT_glut_LIBRARY="$GLUT_LIBRARY" \
-DGLUT_glut_LIBRARY_DEBUG="$GLUT_LIBRARY" \
-DGLUT_glut_LIBRARY_RELEASE="$GLUT_LIBRARY"
cmake --build build/mingw32
cmake --build build/mingw32 --target install
LIBRARY "freeglut.dll"
EXPORTS
__glutCreateMenuWithExit@8
__glutCreateWindowWithExit@8
__glutInitWithExit@12
glutAddMenuEntry@8
glutAddSubMenu@8
glutAttachMenu@4
glutBitmapCharacter@8
glutBitmapHeight@4
glutBitmapLength@8
glutBitmapString@8
glutBitmapWidth@8
glutButtonBoxFunc@4
glutChangeToMenuEntry@12
glutChangeToSubMenu@12
glutCloseFunc@4
glutCopyColormap@4
glutCreateMenu@4
glutCreateSubWindow@20
glutCreateWindow@4
glutDestroyMenu@4
glutDestroyWindow@4
glutDetachMenu@4
glutDeviceGet@4
glutDialsFunc@4
glutDisplayFunc@4
glutEnterGameMode@0
glutEntryFunc@4
glutEstablishOverlay@0
glutExit@0
glutExtensionSupported@4
glutForceJoystickFunc@0
glutFullScreen@0
glutFullScreenToggle@0
glutGameModeGet@4
glutGameModeString@4
glutGet@4
glutGetColor@8
glutGetMenu@0
glutGetMenuData@0
glutGetModeValues@8
glutGetModifiers@0
glutGetProcAddress@4
glutGetWindow@0
glutGetWindowData@0
glutHideOverlay@0
glutHideWindow@0
glutIconifyWindow@0
glutIdleFunc@4
glutIgnoreKeyRepeat@4
glutInit@8
glutInitContextFlags@4
glutInitContextProfile@4
glutInitContextVersion@8
glutInitDisplayMode@4
glutInitDisplayString@4
glutInitErrorFunc@4
glutInitWarningFunc@4
glutInitWindowPosition@8
glutInitWindowSize@8
glutJoystickFunc@8
glutKeyboardFunc@4
glutKeyboardUpFunc@4
glutLayerGet@4
glutLeaveFullScreen@0
glutLeaveGameMode@0
glutLeaveMainLoop@0
glutMainLoop@0
glutMainLoopEvent@0
glutMenuDestroyFunc@4
glutMenuStateFunc@4
glutMenuStatusFunc@4
glutMotionFunc@4
glutMouseFunc@4
glutMouseWheelFunc@4
glutMultiButtonFunc@4
glutMultiEntryFunc@4
glutMultiMotionFunc@4
glutMultiPassiveFunc@4
glutOverlayDisplayFunc@4
glutPassiveMotionFunc@4
glutPopWindow@0
glutPositionWindow@8
glutPostOverlayRedisplay@0
glutPostRedisplay@0
glutPostWindowOverlayRedisplay@4
glutPostWindowRedisplay@4
glutPushWindow@0
glutRemoveMenuItem@4
glutRemoveOverlay@0
glutReportErrors@0
glutReshapeFunc@4
glutReshapeWindow@8
glutSetColor@16
glutSetCursor@4
glutSetIconTitle@4
glutSetKeyRepeat@4
glutSetMenu@4
glutSetMenuData@4
glutSetOption@8
glutSetWindow@4
glutSetWindowData@4
glutSetWindowTitle@4
glutSetupVideoResizing@0
glutShowOverlay@0
glutShowWindow@0
glutSolidCone@24
glutSolidCube@8
glutSolidCylinder@24
glutSolidDodecahedron@0
glutSolidIcosahedron@0
glutSolidOctahedron@0
glutSolidRhombicDodecahedron@0
glutSolidSierpinskiSponge@16
glutSolidSphere@16
glutSolidTeapot@8
glutSolidTetrahedron@0
glutSolidTorus@24
glutSpaceballButtonFunc@4
glutSpaceballMotionFunc@4
glutSpaceballRotateFunc@4
glutSpecialFunc@4
glutSpecialUpFunc@4
glutStopVideoResizing@0
glutStrokeCharacter@8
glutStrokeHeight@4
glutStrokeLength@8
glutStrokeString@8
glutStrokeWidth@8
glutSwapBuffers@0
glutTabletButtonFunc@4
glutTabletMotionFunc@4
glutTimerFunc@12
glutUseLayer@4
glutVideoPan@16
glutVideoResize@16
glutVideoResizeGet@4
glutVisibilityFunc@4
glutWMCloseFunc@4
glutWarpPointer@8
glutWindowStatusFunc@4
glutWireCone@24
glutWireCube@8
glutWireCylinder@24
glutWireDodecahedron@0
glutWireIcosahedron@0
glutWireOctahedron@0
glutWireRhombicDodecahedron@0
glutWireSierpinskiSponge@16
glutWireSphere@16
glutWireTeapot@8
glutWireTetrahedron@0
glutWireTorus@24
set (CMAKE_SYSTEM_NAME Windows)
set (CMAKE_C_COMPILER i686-w64-mingw32-gcc)
set (CMAKE_CXX_COMPILER i686-w64-mingw32-g++)
set (CMAKE_RC_COMPILER i686-w64-mingw32-windres)
set (CMAKE_FIND_ROOT_PATH /usr/i686-w64-mingw32)
set (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
cmake_minimum_required (VERSION 2.8) cmake_minimum_required (VERSION 2.8.12)
project (mesademos) project (mesademos)
...@@ -7,16 +7,32 @@ include (CheckCCompilerFlag) ...@@ -7,16 +7,32 @@ include (CheckCCompilerFlag)
include (CheckSymbolExists) include (CheckSymbolExists)
find_package (OpenGL REQUIRED) find_package (OpenGL REQUIRED)
find_package (GLUT REQUIRED) find_package (GLUT)
find_package (X11) find_package (X11)
if (NOT GLUT_FOUND)
message (WARNING "GLUT was not found, only platform specific demos will be built")
endif ()
set (GLAD_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/src/glad/include) set (GLAD_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/src/glad/include)
if (PKG_CONFIG_FOUND AND NOT WIN32) if (PKG_CONFIG_FOUND AND NOT WIN32)
find_package (ECM NO_MODULE)
if (ECM_FOUND)
set (CMAKE_MODULE_PATH ${ECM_FIND_MODULE_DIR})
find_package (Wayland)
find_package (WaylandProtocols)
find_package (WaylandScanner)
if (Wayland_FOUND AND WaylandProtocols_FOUND AND WaylandScanner_FOUND)
set(BUILD_WAYLAND ON)
endif ()
endif ()
pkg_check_modules (EGL egl) pkg_check_modules (EGL egl)
pkg_check_modules (GLESV1 glesv1_cm) pkg_check_modules (GLESV1 glesv1_cm)
pkg_check_modules (GLESV2 glesv2) pkg_check_modules (GLESV2 glesv2)
pkg_check_modules (VG vg)
pkg_check_modules (OSMESA osmesa) pkg_check_modules (OSMESA osmesa)
endif () endif ()
...@@ -75,27 +91,9 @@ if (CMAKE_COMPILER_IS_GNUCC) ...@@ -75,27 +91,9 @@ if (CMAKE_COMPILER_IS_GNUCC)
endif () endif ()
if (WIN32) if (WIN32)
# Nobody likes to include windows.h:
# - Microsoft's GL/gl.h header depends on windows.h but doesn't include it;
# - certain GLUT distributions don't include it;
# - most of our programs are meant to be portable so don't include it.
#
# We could try to replicate the windows.h definitions required by
# GL/gl.h, but the build time savings don't compensate the constant
# headaches that brings, so instead we force windows.h to be included
# on every file.
if (MSVC)
add_definitions (-FIwindows.h)
else (MSVC)
add_definitions (--include windows.h)
endif (MSVC)
# Don't define min/max macros # Don't define min/max macros
add_definitions (-DNOMINMAX) add_definitions (-DNOMINMAX)
# MSVC & MinGW only define & use APIENTRY
add_definitions (-DGLAPIENTRY=__stdcall)
link_libraries (winmm) link_libraries (winmm)
endif (WIN32) endif (WIN32)
......
...@@ -26,7 +26,7 @@ dnl Process this file with autoconf to create configure. ...@@ -26,7 +26,7 @@ dnl Process this file with autoconf to create configure.
AC_PREREQ([2.59]) AC_PREREQ([2.59])
AC_INIT([mesa-demos], [8.4.0], AC_INIT([mesa-demos], [8.4.0],
[https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa&component=Demos]) [https://gitlab.freedesktop.org/mesa/demos/-/issues])
AC_CANONICAL_HOST AC_CANONICAL_HOST
AM_INIT_AUTOMAKE([dist-bzip2]) AM_INIT_AUTOMAKE([dist-bzip2])
...@@ -131,14 +131,6 @@ AC_ARG_ENABLE([gles2], ...@@ -131,14 +131,6 @@ AC_ARG_ENABLE([gles2],
if test "x$glesv2_enabled" != "xno"; then if test "x$glesv2_enabled" != "xno"; then
PKG_CHECK_MODULES(GLESV2, [glesv2], [glesv2_enabled=yes], [glesv2_enabled=no]) PKG_CHECK_MODULES(GLESV2, [glesv2], [glesv2_enabled=yes], [glesv2_enabled=no])
fi fi
AC_ARG_ENABLE([vg],
[AS_HELP_STRING([--enable-vg],
[enable support for OpenVG API @<:@default=auto@:>@])],
[vg_enabled="$enableval"],
[vg_enabled=auto])
if test "x$vg_enabled" != "xno"; then
PKG_CHECK_MODULES(VG, [vg], [vg_enabled=yes], [vg_enabled=no])
fi
AC_ARG_ENABLE([osmesa], AC_ARG_ENABLE([osmesa],
[AS_HELP_STRING([--enable-osmesa], [AS_HELP_STRING([--enable-osmesa],
[enable OSMesa library @<:@default=auto@:>@])], [enable OSMesa library @<:@default=auto@:>@])],
...@@ -208,8 +200,18 @@ AC_ARG_ENABLE([wayland], ...@@ -208,8 +200,18 @@ AC_ARG_ENABLE([wayland],
[wayland_enabled=auto]) [wayland_enabled=auto])
if test "x$wayland_enabled" != "xno"; then if test "x$wayland_enabled" != "xno"; then
PKG_CHECK_MODULES(WAYLAND, [wayland-client wayland-egl], [wayland_enabled=yes], [wayland_enabled=no]) PKG_CHECK_MODULES(WAYLAND,
[wayland-client wayland-egl wayland-protocols],
[wayland_enabled=yes],
[wayland_enabled=no])
fi
if test "x$wayland_enabled" != "xno"; then
ac_wayland_scanner=`"$PKG_CONFIG" --variable=wayland_scanner wayland-scanner`
ac_wayland_protocols_pkgdatadir=`"$PKG_CONFIG" --variable=pkgdatadir wayland-protocols`
fi fi
AC_SUBST(WAYLAND_PROTOCOLS_DATADIR, $ac_wayland_protocols_pkgdatadir)
AC_SUBST(WAYLAND_SCANNER, $ac_wayland_scanner)
dnl GBM is needed for EGL on KMS dnl GBM is needed for EGL on KMS
AC_ARG_ENABLE([gbm], AC_ARG_ENABLE([gbm],
...@@ -221,31 +223,6 @@ if test "x$gbm_enabled" != "xno"; then ...@@ -221,31 +223,6 @@ if test "x$gbm_enabled" != "xno"; then
PKG_CHECK_MODULES(GBM, [gbm], [gbm_enabled=yes], [gbm_enabled=no]) PKG_CHECK_MODULES(GBM, [gbm], [gbm_enabled=yes], [gbm_enabled=no])
fi fi
dnl FreeType2 is needed by an OpenVG demo
AC_ARG_ENABLE([freetype2],
[AS_HELP_STRING([--enable-freetype2],
[enable support for FreeType2 @<:@default=auto@:>@])],
[freetype2_enabled="$enableval"],
[freetype2_enabled=auto])
if test "x$freetype2_enabled" != "xno"; then
PKG_CHECK_MODULES(FREETYPE2, [freetype2], [freetype2_enabled=yes], [freetype2_enabled=no])
fi
mesa_source_enabled=no
AC_ARG_WITH([mesa-source],
[AS_HELP_STRING([--with-mesa-source=DIR],
[Mesa source directory for finding gl_API.xml])],
[mesa_source_enabled="yes"
mesa_source_dir="$withval"],
[mesa_source_enabled="no"])
MESA_GLAPI="$mesa_source_dir/src/mapi/glapi/gen"
AC_ARG_ENABLE([rbug],
[AS_HELP_STRING([--enable-rbug],
[enable support for rbug @<:@default=no@:>@])],
[rbug_enabled="yes"],
[rbug_enabled="no"])
use_system_data=no use_system_data=no
AC_ARG_WITH([system-data-files], AC_ARG_WITH([system-data-files],
[AS_HELP_STRING([--with-system-data-files], [AS_HELP_STRING([--with-system-data-files],
...@@ -293,7 +270,6 @@ AC_SUBST([OSMESA_CFLAGS]) ...@@ -293,7 +270,6 @@ AC_SUBST([OSMESA_CFLAGS])
AC_SUBST([OSMESA_LIBS]) AC_SUBST([OSMESA_LIBS])
AC_SUBST([OSMESA16_LIBS]) AC_SUBST([OSMESA16_LIBS])
AC_SUBST([OSMESA32_LIBS]) AC_SUBST([OSMESA32_LIBS])
AC_SUBST([MESA_GLAPI])
AC_SUBST([WAYLAND_CFLAGS]) AC_SUBST([WAYLAND_CFLAGS])
AC_SUBST([WAYLAND_LIBS]) AC_SUBST([WAYLAND_LIBS])
...@@ -301,16 +277,12 @@ AC_SUBST([WAYLAND_LIBS]) ...@@ -301,16 +277,12 @@ AC_SUBST([WAYLAND_LIBS])
AM_CONDITIONAL(HAVE_EGL, test "x$egl_enabled" = "xyes") AM_CONDITIONAL(HAVE_EGL, test "x$egl_enabled" = "xyes")
AM_CONDITIONAL(HAVE_GLESV1, test "x$glesv1_enabled" = "xyes") AM_CONDITIONAL(HAVE_GLESV1, test "x$glesv1_enabled" = "xyes")
AM_CONDITIONAL(HAVE_GLESV2, test "x$glesv2_enabled" = "xyes") AM_CONDITIONAL(HAVE_GLESV2, test "x$glesv2_enabled" = "xyes")
AM_CONDITIONAL(HAVE_VG, test "x$vg_enabled" = "xyes")
AM_CONDITIONAL(HAVE_GLUT, test "x$glut_enabled" = "xyes") AM_CONDITIONAL(HAVE_GLUT, test "x$glut_enabled" = "xyes")
AM_CONDITIONAL(HAVE_X11, test "x$x11_enabled" = "xyes") AM_CONDITIONAL(HAVE_X11, test "x$x11_enabled" = "xyes")
AM_CONDITIONAL(HAVE_GBM, test "x$gbm_enabled" = "xyes") AM_CONDITIONAL(HAVE_GBM, test "x$gbm_enabled" = "xyes")
AM_CONDITIONAL(HAVE_FREETYPE2, test "x$freetype2_enabled" = "xyes")
AM_CONDITIONAL(HAVE_OSMESA, test "x$osmesa_enabled" = "xyes") AM_CONDITIONAL(HAVE_OSMESA, test "x$osmesa_enabled" = "xyes")
AM_CONDITIONAL(HAVE_DRM, test "x$drm_enabled" = "xyes") AM_CONDITIONAL(HAVE_DRM, test "x$drm_enabled" = "xyes")
AM_CONDITIONAL(HAVE_MESA_SOURCE, test "x$mesa_source_enabled" = "xyes")
AM_CONDITIONAL(HAVE_WAYLAND, test "x$wayland_enabled" = "xyes") AM_CONDITIONAL(HAVE_WAYLAND, test "x$wayland_enabled" = "xyes")
AM_CONDITIONAL(HAVE_RBUG, test "x$rbug_enabled" = "xyes")
AC_OUTPUT([ AC_OUTPUT([
Makefile Makefile
...@@ -321,9 +293,6 @@ AC_OUTPUT([ ...@@ -321,9 +293,6 @@ AC_OUTPUT([
src/egl/opengl/Makefile src/egl/opengl/Makefile
src/egl/opengles1/Makefile src/egl/opengles1/Makefile
src/egl/opengles2/Makefile src/egl/opengles2/Makefile
src/egl/openvg/Makefile
src/egl/openvg/trivial/Makefile
src/egl/oes_vg/Makefile
src/fp/Makefile src/fp/Makefile
src/fpglsl/Makefile src/fpglsl/Makefile
src/glad/Makefile src/glad/Makefile
...@@ -333,10 +302,8 @@ AC_OUTPUT([ ...@@ -333,10 +302,8 @@ AC_OUTPUT([
src/objviewer/Makefile src/objviewer/Makefile
src/osdemos/Makefile src/osdemos/Makefile
src/perf/Makefile src/perf/Makefile
src/rbug/Makefile
src/redbook/Makefile src/redbook/Makefile
src/samples/Makefile src/samples/Makefile
src/slang/Makefile
src/tests/Makefile src/tests/Makefile
src/tools/Makefile src/tools/Makefile
src/trivial/Makefile src/trivial/Makefile
......
...@@ -34,7 +34,7 @@ not just Mesa. ...@@ -34,7 +34,7 @@ not just Mesa.
<p> <p>
The latest version of the Mesa demos can be found on the The latest version of the Mesa demos can be found on the
<a href="ftp://ftp.freedesktop.org/pub/mesa/demos/">freedesktop.org FTP</a> <a href="https://archive.mesa3d.org/demos/">mesa3d.org archives</a>
site. site.
</p> </p>
...@@ -46,14 +46,7 @@ site. ...@@ -46,14 +46,7 @@ site.
The Mesa demos git repository can be obtained with: The Mesa demos git repository can be obtained with:
</p> </p>
<pre> <pre>
git clone git://anongit.freedesktop.org/git/mesa/demos git clone https://gitlab.freedesktop.org/mesa/demos.git
</pre>
<p>
Or, if you're a developer:
</p>
<pre>
git clone git+ssh://USERNAME@git.freedesktop.org/git/mesa/demos
</pre> </pre>
...@@ -84,6 +77,15 @@ And if you're using a Debian based Linux distro you can install these items with ...@@ -84,6 +77,15 @@ And if you're using a Debian based Linux distro you can install these items with
apt-get install freeglut3-dev apt-get install freeglut3-dev
</pre> </pre>
<p>
For <a href="https://wayland.freedesktop.org/">Wayland</a> support,
<a href="https://gitlab.freedesktop.org/wayland/wayland-protocols">wayland-protocols</a>
and
<a href="https://gitlab.freedesktop.org/wayland/wayland">wayland-scanner</a>
must be available. Additionally, to build for Wayland using CMake,
<a href="https://invent.kde.org/frameworks/extra-cmake-modules">Extra CMake
Modules</a> must be available.
</p>
<h2>Autoconf</h2> <h2>Autoconf</h2>
...@@ -217,9 +219,8 @@ Mesa dev</a> mailing list. ...@@ -217,9 +219,8 @@ Mesa dev</a> mailing list.
<p> <p>
Bugs in the demos can be reported to the Bugs in the demos can be reported to the
<a href="https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa"> <a href="https://gitlab.freedesktop.org/mesa/demos/-/issues">
Mesa bug database</a>. Mesa demos issue tracker</a>.
Choose Component="Demos" in the drop-down list.
</p> </p>
......
add_subdirectory (glad) add_subdirectory (glad)
add_subdirectory (util) if (GLUT_FOUND)
add_subdirectory (util)
add_subdirectory (demos)
add_subdirectory (tests) add_subdirectory (demos)
add_subdirectory (trivial) add_subdirectory (tests)
add_subdirectory (redbook) add_subdirectory (trivial)
add_subdirectory (samples) add_subdirectory (redbook)
add_subdirectory (perf) add_subdirectory (samples)
add_subdirectory (objviewer) add_subdirectory (perf)
add_subdirectory (objviewer)
add_subdirectory (glsl)
add_subdirectory (fp) add_subdirectory (glsl)
add_subdirectory (fpglsl) add_subdirectory (fp)
add_subdirectory (vp) add_subdirectory (fpglsl)
add_subdirectory (vpglsl) add_subdirectory (vp)
add_subdirectory (gs) add_subdirectory (vpglsl)
add_subdirectory (slang) add_subdirectory (gs)
add_subdirectory (tools) add_subdirectory (tools)
endif ()
if (EGL_FOUND) if (EGL_FOUND)
add_subdirectory(egl) add_subdirectory(egl)
......
...@@ -35,10 +35,8 @@ SUBDIRS = \ ...@@ -35,10 +35,8 @@ SUBDIRS = \
objviewer \ objviewer \
osdemos \ osdemos \
perf \ perf \
rbug \
redbook \ redbook \
samples \ samples \
slang \
tests \ tests \
tools \ tools \
trivial \ trivial \
......
# Mesa 3-D graphics library
# Version: 3.3
# Copyright (C) 1995-2000 Brian Paul
# Makefile for demo programs for cygnus
# Stephane Rehel (rehel@worldnet.fr) April 13 1997
##### MACROS #####
INCDIR = ../include
LIBDIR = ../lib
GL_LIBS = -L$(LIBDIR) -lglut -lMesaGLU -lMesaGL -lm $(WLIBS)
LIB_DEP = $(LIBDIR)/$(GL_LIB) $(LIBDIR)/$(GLU_LIB) $(LIBDIR)/$(GLUT_LIB)
PROGS = bounce \
clearspd \
cubemap \
drawpix \
fire \
gamma \
gears \
geartrain \
glinfo \
gloss \
gltestperf \
glutfx \
isosurf \
ipers \
lodbias \
morph3d \
multiarb \
osdemo \
paltex \
pixeltex \
pointblast \
ray \
readpix \
reflect \
renormal \
spectex \
stex3d \
teapot \
terrain \
tessdemo \
texcyl \
texdown \
texenv \
texobj \
trispd \
tunnel \
tunnel2 \
winpos
##### RULES #####
.SUFFIXES:
.SUFFIXES: .c
.c: $(LIB_DEP)
$(CC) -I$(INCDIR) -I../util $(CFLAGS) $< $(GL_LIBS) -o $@
##### TARGETS #####
default:
@echo "Specify a target configuration"
clean:
-rm *.o *~
realclean:
-rm $(PROGS:=.exe)
-rm *.o *~
targets: $(PROGS)
include ../Make-config
...@@ -10,11 +10,3 @@ endif () ...@@ -10,11 +10,3 @@ endif ()
if (GLESV2_FOUND) if (GLESV2_FOUND)
add_subdirectory(opengles2) add_subdirectory(opengles2)
endif () endif ()
if (VG_FOUND)
add_subdirectory(openvg)
endif ()
if (GLESV1_FOUND AND VG_FOUND)
add_subdirectory(oes_vg)
endif ()
...@@ -25,7 +25,5 @@ ...@@ -25,7 +25,5 @@
SUBDIRS = \ SUBDIRS = \
eglut \ eglut \
opengl \ opengl \
openvg \
opengles1 \ opengles1 \
opengles2 \ opengles2
oes_vg
...@@ -9,3 +9,20 @@ if (X11_FOUND) ...@@ -9,3 +9,20 @@ if (X11_FOUND)
install (TARGETS eglut_x11 DESTINATION ${LIBDIR}) install (TARGETS eglut_x11 DESTINATION ${LIBDIR})
endif (BUILD_SHARED_LIBS) endif (BUILD_SHARED_LIBS)
endif (X11_FOUND) endif (X11_FOUND)
if (BUILD_WAYLAND)
ecm_add_wayland_client_protocol (eglut_wayland_proto_SOURCES
PROTOCOL "${WaylandProtocols_DATADIR}/stable/xdg-shell/xdg-shell.xml"
BASENAME xdg-shell)
add_library (eglut_wayland
eglut.h eglut.c
eglutint.h eglut_wayland.c
${eglut_wayland_proto_SOURCES})
target_compile_options (eglut_wayland PRIVATE ${Wayland_DEFINITIONS})
target_include_directories (eglut_wayland PRIVATE ${Wayland_INCLUDE_DIRS})
target_link_libraries (eglut_wayland ${EGL_LIBRARIES} ${Wayland_LIBRARIES})
if (BUILD_SHARED_LIBS)
install (TARGETS eglut_wayland DESTINATION ${LIBDIR})
endif (BUILD_SHARED_LIBS)
endif (BUILD_WAYLAND)
...@@ -44,12 +44,30 @@ libeglut_x11_la_SOURCES = \ ...@@ -44,12 +44,30 @@ libeglut_x11_la_SOURCES = \
libeglut_x11_la_CFLAGS = $(X11_CFLAGS) $(EGL_CFLAGS) libeglut_x11_la_CFLAGS = $(X11_CFLAGS) $(EGL_CFLAGS)
libeglut_x11_la_LIBADD = $(X11_LIBS) $(EGL_LIBS) libeglut_x11_la_LIBADD = $(X11_LIBS) $(EGL_LIBS)
XDG_SHELL_XML = $(WAYLAND_PROTOCOLS_DATADIR)/stable/xdg-shell/xdg-shell.xml
wayland-xdg-shell-protocol.c: $(XDG_SHELL_XML)
$(MKDIR_GEN)
$(AM_V_GEN)$(WAYLAND_SCANNER) code < $< > $@
wayland-xdg-shell-client-protocol.h: $(XDG_SHELL_XML)
$(MKDIR_GEN)
$(AM_V_GEN)$(WAYLAND_SCANNER) client-header < $< > $@
if HAVE_WAYLAND
BUILT_SOURCES = \
wayland-xdg-shell-protocol.c \
wayland-xdg-shell-client-protocol.h
endif
libeglut_wayland_la_SOURCES = \ libeglut_wayland_la_SOURCES = \
eglut.c \ eglut.c \
eglut.h \ eglut.h \
eglutint.h \ eglutint.h \
eglut_wayland.c eglut_wayland.c
nodist_libeglut_wayland_la_SOURCES = \
wayland-xdg-shell-protocol.c \
wayland-xdg-shell-client-protocol.h
libeglut_wayland_la_CFLAGS = $(WAYLAND_CFLAGS) $(EGL_CFLAGS) libeglut_wayland_la_CFLAGS = $(WAYLAND_CFLAGS) $(EGL_CFLAGS)
libeglut_wayland_la_LIBADD = $(WAYLAND_LIBS) $(EGL_LIBS) libeglut_wayland_la_LIBADD = $(WAYLAND_LIBS) $(EGL_LIBS)
...@@ -112,8 +112,6 @@ _eglutChooseConfig(void) ...@@ -112,8 +112,6 @@ _eglutChooseConfig(void)
renderable_type |= EGL_OPENGL_ES_BIT; renderable_type |= EGL_OPENGL_ES_BIT;
if (_eglut->api_mask & EGLUT_OPENGL_ES2_BIT) if (_eglut->api_mask & EGLUT_OPENGL_ES2_BIT)
renderable_type |= EGL_OPENGL_ES2_BIT; renderable_type |= EGL_OPENGL_ES2_BIT;
if (_eglut->api_mask & EGLUT_OPENVG_BIT)
renderable_type |= EGL_OPENVG_BIT;
config_attribs[i++] = renderable_type; config_attribs[i++] = renderable_type;
config_attribs[i] = EGL_NONE; config_attribs[i] = EGL_NONE;
...@@ -147,9 +145,6 @@ _eglutCreateWindow(const char *title, int x, int y, int w, int h) ...@@ -147,9 +145,6 @@ _eglutCreateWindow(const char *title, int x, int y, int w, int h)
if (_eglut->api_mask & EGLUT_OPENGL_BIT) { if (_eglut->api_mask & EGLUT_OPENGL_BIT) {
api = EGL_OPENGL_API; api = EGL_OPENGL_API;
} }
else if (_eglut->api_mask & EGLUT_OPENVG_BIT) {
api = EGL_OPENVG_API;
}
else if (_eglut->api_mask & EGLUT_OPENGL_ES2_BIT) { else if (_eglut->api_mask & EGLUT_OPENGL_ES2_BIT) {
context_attribs[i++] = EGL_CONTEXT_CLIENT_VERSION; context_attribs[i++] = EGL_CONTEXT_CLIENT_VERSION;
context_attribs[i++] = 2; context_attribs[i++] = 2;
......
...@@ -31,7 +31,6 @@ enum { ...@@ -31,7 +31,6 @@ enum {
EGLUT_OPENGL_BIT = 0x1, EGLUT_OPENGL_BIT = 0x1,
EGLUT_OPENGL_ES1_BIT = 0x2, EGLUT_OPENGL_ES1_BIT = 0x2,
EGLUT_OPENGL_ES2_BIT = 0x4, EGLUT_OPENGL_ES2_BIT = 0x4,
EGLUT_OPENVG_BIT = 0x8
}; };
/* used by EGLUTspecialCB */ /* used by EGLUTspecialCB */
......
...@@ -4,36 +4,53 @@ ...@@ -4,36 +4,53 @@
#include <poll.h> #include <poll.h>
#include <errno.h> #include <errno.h>
#include <string.h> #include <string.h>
#include <stdbool.h>
#include "eglutint.h" #include "eglutint.h"
#include "wayland-xdg-shell-client-protocol.h"
struct display { struct display {
struct wl_display *display; struct wl_display *display;
struct wl_compositor *compositor; struct wl_compositor *compositor;
struct wl_shell *shell; struct xdg_wm_base *xdg_wm_base;
uint32_t mask; uint32_t mask;
}; };
struct window { struct window {
struct wl_surface *surface; struct wl_surface *surface;
struct wl_shell_surface *shell_surface; struct xdg_surface *xdg_surface;
struct xdg_toplevel *xdg_toplevel;
struct wl_callback *callback; struct wl_callback *callback;
bool opaque;
bool configured;
}; };
static struct display display = {0, }; static struct display display = {0, };
static struct window window = {0, }; static struct window window = {0, };
static void
xdg_wm_base_ping(void *data, struct xdg_wm_base *xdg_wm_base, uint32_t serial)
{
xdg_wm_base_pong(xdg_wm_base, serial);
}
static const struct xdg_wm_base_listener xdg_wm_base_listener = {
xdg_wm_base_ping
};
static void static void
registry_handle_global(void *data, struct wl_registry *registry, uint32_t id, registry_handle_global(void *data, struct wl_registry *registry, uint32_t id,
const char *interface, uint32_t version) const char *interface, uint32_t version)
{ {
struct display *d = data; struct display *d = data;
if (strcmp(interface, "wl_compositor") == 0) { if (strcmp(interface, wl_compositor_interface.name) == 0) {
d->compositor = d->compositor =
wl_registry_bind(registry, id, &wl_compositor_interface, 1); wl_registry_bind(registry, id, &wl_compositor_interface, 1);
} else if (strcmp(interface, "wl_shell") == 0) { } else if (strcmp(interface, xdg_wm_base_interface.name) == 0) {
d->shell = wl_registry_bind(registry, id, &wl_shell_interface, 1); d->xdg_wm_base =
wl_registry_bind(registry, id, &xdg_wm_base_interface, 1);
xdg_wm_base_add_listener(d->xdg_wm_base, &xdg_wm_base_listener, d);
} }
} }
...@@ -93,6 +110,9 @@ _eglutNativeInitDisplay(void) ...@@ -93,6 +110,9 @@ _eglutNativeInitDisplay(void)
wayland_roundtrip(_eglut->native_dpy); wayland_roundtrip(_eglut->native_dpy);
wl_registry_destroy(registry); wl_registry_destroy(registry);
if (!display.xdg_wm_base)
_eglutFatal("xdg-shell not supported");
_eglut->surface_type = EGL_WINDOW_BIT; _eglut->surface_type = EGL_WINDOW_BIT;
_eglut->redisplay = 1; _eglut->redisplay = 1;
} }
...@@ -100,29 +120,88 @@ _eglutNativeInitDisplay(void) ...@@ -100,29 +120,88 @@ _eglutNativeInitDisplay(void)
void void
_eglutNativeFiniDisplay(void) _eglutNativeFiniDisplay(void)
{ {
xdg_wm_base_destroy(display.xdg_wm_base);
wl_compositor_destroy(display.compositor);
wl_display_flush(_eglut->native_dpy); wl_display_flush(_eglut->native_dpy);
wl_display_disconnect(_eglut->native_dpy); wl_display_disconnect(_eglut->native_dpy);
} }
static void
xdg_toplevel_configure(void *data, struct xdg_toplevel *xdg_toplevel,
int32_t width, int32_t height,
struct wl_array *states)
{
struct eglut_window *win = data;
if (width == 0 || height == 0) {
/* Client should decide its own window dimensions.
* Keep whatever we have. */
return;
}
wl_egl_window_resize(win->native.u.window, width, height, 0, 0);
win->native.width = width;
win->native.height = height;
if (win->reshape_cb)
win->reshape_cb(win->native.width, win->native.height);
}
static void
xdg_toplevel_close(void *data, struct xdg_toplevel *toplevel)
{
struct eglut_window *win = data;
eglutDestroyWindow(win->index);
// FIXME: eglut does not terminate when all windows are closed.
// eglut_x11 dies due to "X connection to $DISPLAY broken".
// Since wl_display works fine with all windows closed, terminate ourselves.
eglTerminate(_eglut->dpy);
_eglutNativeFiniDisplay();
}
static const struct xdg_toplevel_listener xdg_toplevel_listener = {
xdg_toplevel_configure,
xdg_toplevel_close
};
static void
xdg_surface_configure(void *data, struct xdg_surface *xdg_surface,
uint32_t serial)
{
struct window *window = data;
xdg_surface_ack_configure(xdg_surface, serial);
window->configured = true;
}
static const struct xdg_surface_listener xdg_surface_listener = {
xdg_surface_configure
};
void void
_eglutNativeInitWindow(struct eglut_window *win, const char *title, _eglutNativeInitWindow(struct eglut_window *win, const char *title,
int x, int y, int w, int h) int x, int y, int w, int h)
{ {
struct wl_egl_window *native; struct wl_egl_window *native;
struct wl_region *region;
window.surface = wl_compositor_create_surface(display.compositor); window.surface = wl_compositor_create_surface(display.compositor);
region = wl_compositor_create_region(display.compositor); EGLint alpha_size;
wl_region_add(region, 0, 0, w, h); if (!eglGetConfigAttrib(_eglut->dpy,
wl_surface_set_opaque_region(window.surface, region); win->config, EGL_ALPHA_SIZE, &alpha_size))
wl_region_destroy(region); _eglutFatal("failed to get alpha size");
window.opaque = !alpha_size;
window.shell_surface = wl_shell_get_shell_surface(display.shell, window.xdg_surface =
window.surface); xdg_wm_base_get_xdg_surface(display.xdg_wm_base, window.surface);
native = wl_egl_window_create(window.surface, w, h); xdg_surface_add_listener(window.xdg_surface, &xdg_surface_listener, &window);
window.xdg_toplevel = xdg_surface_get_toplevel(window.xdg_surface);
xdg_toplevel_add_listener(window.xdg_toplevel, &xdg_toplevel_listener, win);
xdg_toplevel_set_title(window.xdg_toplevel, title);
xdg_toplevel_set_app_id(window.xdg_toplevel, title);
wl_surface_commit(window.surface);
wl_shell_surface_set_toplevel(window.shell_surface); native = wl_egl_window_create(window.surface, w, h);
win->native.u.window = native; win->native.u.window = native;
win->native.width = w; win->native.width = w;
...@@ -134,8 +213,8 @@ _eglutNativeFiniWindow(struct eglut_window *win) ...@@ -134,8 +213,8 @@ _eglutNativeFiniWindow(struct eglut_window *win)
{ {
wl_egl_window_destroy(win->native.u.window); wl_egl_window_destroy(win->native.u.window);
wl_shell_surface_destroy(window.shell_surface); xdg_toplevel_destroy(window.xdg_toplevel);
wl_surface_destroy(window.surface); xdg_surface_destroy(window.xdg_surface);
if (window.callback) if (window.callback)
wl_callback_destroy(window.callback); wl_callback_destroy(window.callback);
...@@ -170,6 +249,14 @@ draw(void *data, struct wl_callback *callback, uint32_t time) ...@@ -170,6 +249,14 @@ draw(void *data, struct wl_callback *callback, uint32_t time)
window->callback = wl_surface_frame(window->surface); window->callback = wl_surface_frame(window->surface);
wl_callback_add_listener(window->callback, &frame_listener, window); wl_callback_add_listener(window->callback, &frame_listener, window);
if (window->opaque) {
struct wl_region *region =
wl_compositor_create_region(display.compositor);
wl_region_add(region, 0, 0, win->native.width, win->native.height);
wl_surface_set_opaque_region(window->surface, region);
wl_region_destroy(region);
}
eglSwapBuffers(_eglut->dpy, win->surface); eglSwapBuffers(_eglut->dpy, win->surface);
} }
...@@ -183,6 +270,9 @@ _eglutNativeEventLoop(void) ...@@ -183,6 +270,9 @@ _eglutNativeEventLoop(void)
pollfd.events = POLLIN; pollfd.events = POLLIN;
pollfd.revents = 0; pollfd.revents = 0;
while (!window.configured)
wl_display_dispatch(display.display);
while (1) { while (1) {
/* If we need to flush but can't, don't do anything at all which could /* If we need to flush but can't, don't do anything at all which could
* push further events into the socket. */ * push further events into the socket. */
...@@ -209,7 +299,7 @@ _eglutNativeEventLoop(void) ...@@ -209,7 +299,7 @@ _eglutNativeEventLoop(void)
if (poll(&pollfd, 1, -1) == -1) if (poll(&pollfd, 1, -1) == -1)
break; break;
if (pollfd.revents & (POLLERR | POLLHUP)) if (pollfd.revents & (POLLERR | POLLHUP | POLLNVAL))
break; break;
if (pollfd.events & POLLOUT) { if (pollfd.events & POLLOUT) {
......
tex2vgimage
vgimage2tex