Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions BuildingOgre.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ For manually building the dependencies, please refer to the list below and get a
On linux you additionally need the following system headers to build the GL, GL3+, GLES2 & Vulkan RenderSystems:
* Ubuntu

sudo apt-get install libgles2-mesa-dev libvulkan-dev glslang-dev libxrandr-dev
sudo apt-get install libgles2-mesa-dev libvulkan-dev glslang-dev
# X11:
Comment thread
joakimono marked this conversation as resolved.
Outdated
sudo apt-get install libxrandr-dev
# Wayland:
sudo apt-get install libwayland-dev libwayland-egl pkg-config
Comment thread
joakimono marked this conversation as resolved.
Outdated

* Fedora

Expand All @@ -54,11 +58,15 @@ furthermore we recommend installing the following optional packages

* Ubuntu

sudo apt-get install libsdl2-dev libxt-dev libxaw7-dev doxygen
sudo apt-get install libsdl2-dev doxygen
# X11:
sudo apt-get install libxt-dev libxaw7-dev

* Fedora

sudo dnf install SDL2-devel libXt-devel libXaw-devel doxygen pugixml-devel
sudo dnf install SDL2-devel doxygen pugixml-devel
# X11:
sudo dnf install libXt-devel libXaw-devel

these will enable input handling in the SampleBrowser, the X11 ConfigDialog and allow building the documentation.

Expand Down
30 changes: 29 additions & 1 deletion CMake/Dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,36 @@ macro_log_feature(FREETYPE_FOUND "freetype" "Portable font engine" "http://www.f

# Find X11
if (UNIX AND NOT APPLE AND NOT ANDROID AND NOT EMSCRIPTEN)
find_package(X11 REQUIRED)
find_package(PkgConfig)
if (PKG_CONFIG_FOUND)
pkg_check_modules(waylands IMPORTED_TARGET wayland-client wayland-egl egl)
pkg_check_modules(wayland-scanner REQUIRED IMPORTED_TARGET wayland-scanner)
pkg_check_modules(wayland-protocols REQUIRED IMPORTED_TARGET wayland-protocols)
pkg_get_variable(_WAYLAND_SCANNER wayland-scanner wayland_scanner)
pkg_get_variable(_WAYLAND_PROTOCOLS_DIR wayland-protocols pkgdatadir)
set(_XDG_SHELL_XML ${_WAYLAND_PROTOCOLS_DIR}/stable/xdg-shell/xdg-shell.xml)

add_custom_command(
OUTPUT ${CMAKE_BINARY_DIR}/xdg_shell/xdg-shell-client-protocol.h ${CMAKE_BINARY_DIR}/xdg_shell/xdg-shell-client-protocol.c
COMMAND "${CMAKE_COMMAND}" "-E" "make_directory" ${CMAKE_BINARY_DIR}/xdg_shell
COMMAND ${_WAYLAND_SCANNER} client-header ${_XDG_SHELL_XML} ${CMAKE_BINARY_DIR}/xdg_shell/xdg-shell-client-protocol.h
COMMAND ${_WAYLAND_SCANNER} private-code ${_XDG_SHELL_XML} ${CMAKE_BINARY_DIR}/xdg_shell/xdg-shell-client-protocol.c
COMMENT "Generate wayland protocols implementation"
)
add_custom_target(xdg_shell
DEPENDS ${CMAKE_BINARY_DIR}/xdg_shell/xdg-shell-client-protocol.h ${CMAKE_BINARY_DIR}/xdg_shell/xdg-shell-client-protocol.c)

# perhaps need wayland-protocols as well
macro_log_feature(waylands_FOUND "Wayland" "Wayland window system" "https://wayland.freedesktop.org")
endif ()

if (NOT waylands_FOUND)
find_package(X11 REQUIRED)
else ()
find_package(X11)
endif ()
macro_log_feature(X11_FOUND "X11" "X Window system" "http://www.x.org")

endif ()


Expand Down
2 changes: 1 addition & 1 deletion CMake/Templates/OGREStatic.pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ Name: OGRE (static lib)
Description: Object-Oriented Graphics Rendering Engine
Version: @OGRE_VERSION@
URL: http://www.ogre3d.org
Requires: freetype2, zziplib, x11, xt, xaw7, gl
Requires: freetype2, zziplib, gl, x11, xt, xaw7, wayland
Libs: -L${libdir} -L${plugindir} -lOgreMain@OGRE_LIB_SUFFIX@ @OGRE_ADDITIONAL_LIBS@
Cflags: -I${includedir} -I${includedir}/OGRE @OGRE_CFLAGS@
17 changes: 12 additions & 5 deletions Components/Bites/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ elseif(ANDROID)
endif()

cmake_dependent_option(OGRE_BITES_NATIVE_DIALOG "Provide a platform specific ConfigDialog implementation"
ON "NOT ANDROID;NOT EMSCRIPTEN;NOT APPLE_IOS;NOT WINDOWS_STORE;NOT WINDOWS_PHONE;NOT UNIX OR APPLE OR XAW_LIBRARY" OFF)
ON "NOT OGRE_GLSUPPORT_USE_WAYLAND;NOT ANDROID;NOT EMSCRIPTEN;NOT APPLE_IOS;NOT WINDOWS_STORE;NOT WINDOWS_PHONE;NOT UNIX OR APPLE OR XAW_LIBRARY" OFF)

if(NOT OGRE_BITES_NATIVE_DIALOG)
set_source_files_properties(src/OgreBitesConfigDialog.cpp PROPERTIES COMPILE_DEFINITIONS DISABLE_NATIVE_DIALOG)
Expand All @@ -134,14 +134,13 @@ elseif(APPLE)
set(RESOURCE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/misc/ogrelogo.png")
source_group(Resources FILES ${RESOURCE_FILES})
set(DEPENDENCIES ${DEPENDENCIES} "-framework Cocoa")
elseif(UNIX AND XAW_LIBRARY)
elseif(UNIX AND XAW_LIBRARY AND NOT OGRE_GLSUPPORT_USE_WAYLAND)
list(APPEND SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src/OgreGLXConfigDialog.cpp")
list(APPEND DEPENDENCIES ${X11_Xt_LIB} ${XAW_LIBRARY})
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/misc/GLX_backdrop.png" DESTINATION "${OGRE_MEDIA_PATH}/../")
endif()

if(UNIX AND NOT APPLE)
# for WindowEventUtilities
if(UNIX AND NOT APPLE AND NOT OGRE_GLSUPPORT_USE_WAYLAND)
list(APPEND DEPENDENCIES ${X11_X11_LIB})
set(NATIVE_INCLUDES ${X11_Xlib_INCLUDE_PATH})
endif()
Expand Down Expand Up @@ -178,6 +177,10 @@ endif()

if(SDL2_FOUND)
target_link_libraries(OgreBites PRIVATE SDL2::SDL2)
if(OGRE_GLSUPPORT_USE_WAYLAND)
target_link_libraries(OgreBites PRIVATE PkgConfig::waylands)
target_compile_definitions(OgreBites PRIVATE OGRE_WAYLAND)
endif()
elseif(NOT EMSCRIPTEN)
message(WARNING "SDL2 not found - no input handling and reduced window creation capabilites")
endif()
Expand All @@ -196,10 +199,14 @@ if(Qt6_FOUND OR Qt5_FOUND)
add_library(OgreBitesQt ${OGRE_COMP_LIB_TYPE} ${MOC_SRC} "${CMAKE_CURRENT_SOURCE_DIR}/src/OgreApplicationContextQt.cpp")
set_target_properties(OgreBitesQt PROPERTIES VERSION ${OGRE_SOVERSION} SOVERSION ${OGRE_SOVERSION})
target_link_libraries(OgreBitesQt PUBLIC Qt${QT_VERSION_MAJOR}::Gui OgreBites)
if(OGRE_GLSUPPORT_USE_WAYLAND)
target_compile_definitions(OgreBitesQt PRIVATE OGRE_WAYLAND)
target_link_libraries(OgreBitesQt PRIVATE PkgConfig::waylands)
endif()
ogre_config_component(OgreBitesQt)
endif()

# install
# install
ogre_config_framework(OgreBites)
ogre_config_component(OgreBites)

Expand Down
37 changes: 37 additions & 0 deletions Components/Bites/src/OgreApplicationContextQt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,19 @@
#include <QResizeEvent>
#include <QKeyEvent>

#ifdef OGRE_WAYLAND
// This is a private, unstable header (package: qtbase5-private-dev)
// Since Qt 6.5 another stable native interface becomes available, QWaylandApplication
#include <5.15.8/QtGui/qpa/qplatformnativeinterface.h>
#include <wayland-client-protocol.h>
#include <wayland-egl.h>
#define EGL_NO_X11
#ifndef WL_EGL_PLATFORM
#define WL_EGL_PLATFORM 1
#endif
#include <EGL/egl.h>
#endif

namespace OgreBites
{
static Event convert(const QEvent* in)
Expand Down Expand Up @@ -131,6 +144,30 @@ namespace OgreBites

p.miscParams["externalWindowHandle"] = std::to_string(size_t(window->winId()));

#ifdef OGRE_WAYLAND
Comment thread
joakimono marked this conversation as resolved.
Outdated

QPlatformNativeInterface *nativeInterface = QGuiApplication::platformNativeInterface();

if (!nativeInterface){
Ogre::LogManager::getSingleton().logMessage("[Qt] Native interface is nullptr!");
}

auto display = static_cast<wl_display*>(nativeInterface->nativeResourceForWindow("display", nullptr));
auto surface = static_cast<wl_surface*>(nativeInterface->nativeResourceForWindow("surface", window));

// Is this needed?
auto egldisplay = static_cast<EGLDisplay>(nativeInterface->nativeResourceForWindow("egldisplay", nullptr));

// Is window (QWindow) actually an instance of wl_egl_window?
p.miscParams["externalWindowHandle"] = Ogre::StringConverter::toString(size_t(window));
Comment thread
joakimono marked this conversation as resolved.
Outdated
p.miscParams["externalDisplay"] = Ogre::StringConverter::toString(size_t(display));
p.miscParams["externalSurface"] = Ogre::StringConverter::toString(size_t(surface));

// Should external compositor be fetched too?
// @TODO: xdg-stuff

#endif

if (!mWindows.empty())
{
// additional windows should reuse the context
Expand Down
35 changes: 34 additions & 1 deletion Components/Bites/src/OgreApplicationContextSDL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@

#include "SDLInputMapping.h"

#ifdef OGRE_WAYLAND
#include <wayland-egl.h>
#endif

namespace OgreBites {

ApplicationContextSDL::ApplicationContextSDL(const Ogre::String& appName) : ApplicationContextBase(appName)
Expand Down Expand Up @@ -68,7 +72,36 @@ NativeWindowPair ApplicationContextSDL::createWindow(const Ogre::String& name, O
p.miscParams["sdlwin"] = Ogre::StringConverter::toString(size_t(ret.native));

#if OGRE_PLATFORM == OGRE_PLATFORM_LINUX
p.miscParams["externalWindowHandle"] = Ogre::StringConverter::toString(size_t(wmInfo.info.x11.window));
if (wmInfo.subsystem == SDL_SYSWM_WAYLAND)
{
#ifdef OGRE_WAYLAND
Comment thread
joakimono marked this conversation as resolved.
Outdated
Comment thread
joakimono marked this conversation as resolved.
Outdated
Ogre::LogManager::getSingleton().logMessage("[SDL] Creating Wayland window");
wl_egl_window *win_impl = (wl_egl_window*)SDL_GetWindowData(ret.native, "wl_egl_window");

// https://github.com/libsdl-org/SDL/issues/5386
// https://github.com/bkaradzic/bgfx/blob/00fa5ad179f5aa13c1e44d0bcbccdc535aba2d00/examples/common/entry/entry_sdl.cpp#L53-L64
if(!win_impl)
{
Ogre::LogManager::getSingleton().logMessage("[SDL] Creating wl_egl_window");
int width, height;
SDL_GetWindowSize(ret.native, &width, &height);
wl_surface* surface = wmInfo.info.wl.surface;
win_impl = wl_egl_window_create(surface, width, height);
Comment thread
joakimono marked this conversation as resolved.
Outdated
SDL_SetWindowData(ret.native, "wl_egl_window", win_impl);
}
p.miscParams["externalDisplay"] = Ogre::StringConverter::toString(size_t(wmInfo.info.wl.display));
Comment thread
joakimono marked this conversation as resolved.
Outdated
p.miscParams["externalSurface"] = Ogre::StringConverter::toString(size_t(wmInfo.info.wl.surface));
Comment thread
joakimono marked this conversation as resolved.
Outdated
p.miscParams["externalWindowHandle"] = Ogre::StringConverter::toString(size_t(win_impl)); //Ogre::StringConverter::toString(size_t(wmInfo.info.wl.egl_window));

p.miscParams["externalXdgSurface"] = Ogre::StringConverter::toString(size_t(wmInfo.info.wl.xdg_surface));
Comment thread
joakimono marked this conversation as resolved.
Outdated
p.miscParams["externalXdgToplevel"] = Ogre::StringConverter::toString(size_t(wmInfo.info.wl.xdg_toplevel));
#endif
Comment thread
joakimono marked this conversation as resolved.
Outdated
}
else if (wmInfo.subsystem == SDL_SYSWM_X11)
{
Ogre::LogManager::getSingleton().logMessage("[SDL] Creating X11 window");
p.miscParams["externalWindowHandle"] = Ogre::StringConverter::toString(size_t(wmInfo.info.x11.window));
}
#elif OGRE_PLATFORM == OGRE_PLATFORM_WIN32
p.miscParams["externalWindowHandle"] = Ogre::StringConverter::toString(size_t(wmInfo.info.win.window));
#elif OGRE_PLATFORM == OGRE_PLATFORM_APPLE
Expand Down
11 changes: 10 additions & 1 deletion Components/Bites/src/OgreWindowEventUtilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ THE SOFTWARE.
# endif
# include <windows.h>
#elif OGRE_PLATFORM == OGRE_PLATFORM_LINUX
Comment thread
joakimono marked this conversation as resolved.
Outdated
#include <X11/Xlib.h>
# if !defined(OGRE_WAYLAND)
# include <X11/Xlib.h>
# endif
#endif

using namespace Ogre;
Expand All @@ -48,7 +50,9 @@ static WindowEventListeners _msListeners;
static RenderWindowList _msWindows;

#if OGRE_PLATFORM == OGRE_PLATFORM_LINUX
# if !defined(OGRE_WAYLAND)
static void GLXProc( RenderWindow *win, const XEvent &event );
# endif
#endif

#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
Expand Down Expand Up @@ -185,6 +189,8 @@ void WindowEventUtilities::messagePump()
DispatchMessage( &msg );
}
#elif OGRE_PLATFORM == OGRE_PLATFORM_LINUX
#if !defined(OGRE_WAYLAND)
// TODO write wayland-alternative
//GLX Message Pump
Display* xDisplay = 0; // same for all windows

Expand All @@ -209,6 +215,7 @@ void WindowEventUtilities::messagePump()
GLXProc(w, event);
}
}
# endif
#endif
}

Expand Down Expand Up @@ -241,6 +248,7 @@ void WindowEventUtilities::_removeRenderWindow(RenderWindow* window)
}

#if OGRE_PLATFORM == OGRE_PLATFORM_LINUX
# if !defined(OGRE_WAYLAND)
//--------------------------------------------------------------------------------//
static void GLXProc( Ogre::RenderWindow *win, const XEvent &event )
{
Expand Down Expand Up @@ -347,6 +355,7 @@ static void GLXProc( Ogre::RenderWindow *win, const XEvent &event )
break;
} //End switch event.type
}
# endif
#endif

}
2 changes: 1 addition & 1 deletion OgreMain/include/OgreRenderSystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ namespace Ogre
| Full Screen | true, false | false | Specify whether to create the window in full screen mode | |
| border | none, fixed, resize | resize | The type of window border (in windowed mode) | Windows, OSX |
| displayFrequency | Refresh rate in Hertz (e.g. 60, 75, 100) | Desktop vsync rate | Display frequency rate, for fullscreen mode | |
| externalWindowHandle | <ul><li>Win32: HWND as int<li>Linux: X11 Window as ulong<li>OSX: OgreGLView address as an integer. You can pass NSView or NSWindow too, but should perform OgreGLView callbacks into the Ogre manually<li>iOS: UIWindow address as an integer<li>Emscripten: canvas selector String ("#canvas")</ul> | 0 (none) | External window handle, for embedding the OGRE render in an existing window | |
| externalWindowHandle | <ul><li>Win32: HWND as int<li>Linux: X11 Window as ulong; Wayland EGL window address as an integer<li>OSX: OgreGLView address as an integer. You can pass NSView or NSWindow too, but should perform OgreGLView callbacks into the Ogre manually<li>iOS: UIWindow address as an integer<li>Emscripten: canvas selector String ("#canvas")</ul> | 0 (none) | External window handle, for embedding the OGRE render in an existing window | |
| externalGLControl | true, false | false | Let the external window control OpenGL i.e. don't select a pixel format for the window, do not change v-sync and do not swap buffer. When set to true, the calling application is responsible of OpenGL initialization and buffer swapping. It should also create an OpenGL context for its own rendering, Ogre will create one for its use. Then the calling application must also enable Ogre OpenGL context before calling any Ogre function and restore its OpenGL context after these calls. | OpenGL |
| currentGLContext | true, false | false | Use an externally created GL context. (Must be current) | OpenGL |
| minColourBufferSize | Positive integer (usually 16, 32) | 16 | Min total colour buffer size. See EGL_BUFFER_SIZE | OpenGL |
Expand Down
3 changes: 2 additions & 1 deletion OgreMain/include/OgreRenderTarget.h
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ namespace Ogre {

| Name | Description |
|-------------|------------------------------------|
| WINDOW | The native window handle. (X11 Window XID/ HWND / NSWindow*) |
| WINDOW | The native window handle. (Wayland wl_egl_window* /X11 Window XID/ HWND / NSWindow*) |
Comment thread
joakimono marked this conversation as resolved.
Outdated
| HWND | deprecated (same as WINDOW) |
| GL_FBOID | the id of the OpenGL framebuffer object |
| GL_MULTISAMPLEFBOID | the id of the OpenGL framebuffer object used for multisampling |
Expand All @@ -228,6 +228,7 @@ namespace Ogre {
| TARGET | deprecated, do not use |
| XDISPLAY | The X Display connection behind that context. |
| ATOM | The X Atom used in client delete events. |
| (TBD) | Wayland-specific structures |
| VIEW | Cocoa NSView* |
| NSOPENGLCONTEXT | Cocoa NSOpenGLContext* |
| NSOPENGLPIXELFORMAT | Cocoa NSOpenGLPixelFormat* |
Expand Down
40 changes: 34 additions & 6 deletions RenderSystems/GLSupport/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

if(EGL_FOUND)
cmake_dependent_option(OGRE_GLSUPPORT_USE_EGL "use EGL for GL Context Creation instead of GLX/ WGL" TRUE "NOT WIN32" FALSE)

cmake_dependent_option(OGRE_GLSUPPORT_USE_WAYLAND "use Wayland window manager" FALSE "UNIX;NOT APPLE;NOT EMSCRIPTEN;NOT ANDROID" FALSE)
endif()

if(ANDROID)
Expand Down Expand Up @@ -64,13 +66,28 @@ elseif (APPLE)
set(PLATFORM_LIBS "-framework AppKit" ${OPENGL_gl_LIBRARY})
elseif (UNIX)
if(OGRE_GLSUPPORT_USE_EGL)
file(GLOB PLATFORM_HEADERS "include/EGL/X11/*.h" "include/EGL/*.h")
file(GLOB PLATFORM_SOURCES "src/EGL/X11/*.cpp" "src/EGL/*.cpp" "src/X11/*.cpp")

set(NATIVE_INCLUDES
${CMAKE_CURRENT_SOURCE_DIR}/include/EGL
list(APPEND _EGL_HEADERS "include/EGL/*.h")
list(APPEND _EGL_SOURCES "src/EGL/*.cpp")
list(APPEND NATIVE_INCLUDES ${CMAKE_CURRENT_SOURCE_DIR}/include/EGL)
if(OGRE_GLSUPPORT_USE_WAYLAND)
list(APPEND _EGL_HEADERS "include/EGL/Wayland/*.h")
list(APPEND _EGL_SOURCES "src/EGL/Wayland/*.cpp")
list(APPEND _EGL_SOURCES ${CMAKE_BINARY_DIR}/xdg_shell/xdg-shell-client-protocol.c)
list(APPEND NATIVE_INCLUDES
${CMAKE_CURRENT_SOURCE_DIR}/include/EGL/Wayland)
set(WAYLAND_LIBRARIES PkgConfig::waylands)
else()
list(APPEND _EGL_HEADERS "include/EGL/X11/*.h")
list(APPEND _EGL_SOURCES "src/EGL/X11/*.cpp")
list(APPEND _EGL_SOURCES "src/X11/*.cpp")
list(APPEND NATIVE_INCLUDES
${CMAKE_CURRENT_SOURCE_DIR}/include/EGL/X11)
set(PLATFORM_LIBS ${X11_LIBRARIES} ${X11_Xrandr_LIB} ${EGL_LIBRARIES})
endif()

file(GLOB PLATFORM_HEADERS ${_EGL_HEADERS})
file(GLOB PLATFORM_SOURCES ${_EGL_SOURCES})

set(PLATFORM_LIBS ${X11_LIBRARIES} ${X11_Xrandr_LIB} ${EGL_LIBRARIES} ${WAYLAND_LIBRARIES})
else()
file(GLOB PLATFORM_HEADERS "include/GLX/*.h")
file(GLOB PLATFORM_SOURCES "src/GLX/*.cpp" "src/X11/*.cpp")
Expand All @@ -85,6 +102,7 @@ elseif (UNIX)

set(PLATFORM_LIBS ${X11_LIBRARIES} ${X11_Xrandr_LIB} ${OPENGL_glx_LIBRARY})
endif()
#TODO: this should not be included if OGRE_GLSUPPORT_USE_WAYLAND
Comment thread
joakimono marked this conversation as resolved.
Outdated
list(APPEND NATIVE_INCLUDES "${CMAKE_CURRENT_SOURCE_DIR}/src/X11/")
endif ()

Expand Down Expand Up @@ -116,6 +134,16 @@ target_include_directories(OgreGLSupport PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/GLSL>"
PRIVATE "$<BUILD_INTERFACE:${NATIVE_INCLUDES}>")

if(OGRE_GLSUPPORT_USE_WAYLAND)
target_compile_definitions(OgreGLSupport PUBLIC OGRE_WAYLAND)
# TODO should be part of include file?

add_dependencies(OgreGLSupport xdg_shell)
Comment thread
joakimono marked this conversation as resolved.
Outdated
target_include_directories(OgreGLSupport PRIVATE
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/xdg_shell>)

endif()

set_property(TARGET OgreGLSupport PROPERTY POSITION_INDEPENDENT_CODE ON)
generate_export_header(OgreGLSupport
EXPORT_MACRO_NAME _OgreGLExport
Expand Down
11 changes: 11 additions & 0 deletions RenderSystems/GLSupport/include/EGL/OgreEGLSupport.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,17 @@ THE SOFTWARE.
#ifndef __EGLSupport_H__
#define __EGLSupport_H__

#ifndef OGRE_WAYLAND
// Tell EGL that we are using X11 (to select the appropriate definitions)
#define USE_X11
#else
// Tell EGL to not include X11 headers
#define EGL_NO_X11
// Tell EGL that we are using wayland
#ifndef WL_EGL_PLATFORM
#define WL_EGL_PLATFORM 1
#endif
#endif

#include "OgreGLNativeSupport.h"
#include <EGL/egl.h>
Expand Down
Loading