EglPlatformHandles.h#

Parent directory (EGL)

Contains platform objects required for EGL (EGLDisplay, EGLSurface, EGLContext etc).

Includes#

  • DynamicEgl.h

  • PVRCore/types/Types.h

Included By#

Namespaces#

Classes#

Typedefs#

Source Code#

#pragma once

#include "PVRCore/types/Types.h"
#if defined(Wayland)
#include <wayland-egl.h>
#endif
#include <DynamicEgl.h>

namespace pvr {
namespace platform {
typedef EGLNativeDisplayType NativeDisplay;

typedef EGLNativeWindowType NativeWindow;

struct NativePlatformHandles_
{
    EGLDisplay display;

    EGLSurface drawSurface;

    EGLSurface readSurface;

    EGLContext context;

#if defined(Wayland)
    wl_egl_window* eglWindow;
#endif

    NativePlatformHandles_() : display(EGL_NO_DISPLAY), drawSurface(EGL_NO_SURFACE), readSurface(EGL_NO_SURFACE), context(EGL_NO_CONTEXT) {}
};

struct NativeDisplayHandle_
{
    NativeDisplay nativeDisplay;

    operator NativeDisplay&() { return nativeDisplay; }

    operator const NativeDisplay&() const { return nativeDisplay; }
};

struct NativeWindowHandle_
{
    NativeWindow nativeWindow;

    operator NativeWindow&() { return nativeWindow; }

    operator const NativeWindow&() const { return nativeWindow; }
};

typedef std::shared_ptr<NativePlatformHandles_> NativePlatformHandles;

typedef std::shared_ptr<NativeDisplayHandle_> NativeDisplayHandle;

} // namespace platform
} // namespace pvr