aboutsummaryrefslogtreecommitdiffstats
path: root/src/egl/main
diff options
context:
space:
mode:
authorAlexander von Gluck IV <[email protected]>2014-12-22 10:10:13 -0500
committerAlexander von Gluck IV <[email protected]>2014-12-23 09:07:57 -0500
commit400b833592d9aad7b2c4627a897380642d52189f (patch)
tree537b8c751497e81f3eb70b2c01ebc2ade3a40ae2 /src/egl/main
parentda4fb3e7a11765725a4aaee41de6c79b40637209 (diff)
egl: Add Haiku code and support
* This is the cleaned up work of the Haiku GCI student Adrián Arroyo Calle [email protected] * Several patches were consolidated to prevent unnecessary touching of non-related code
Diffstat (limited to 'src/egl/main')
-rw-r--r--src/egl/main/SConscript23
-rw-r--r--src/egl/main/eglapi.c2
-rw-r--r--src/egl/main/egldisplay.c7
-rw-r--r--src/egl/main/egldisplay.h1
-rw-r--r--src/egl/main/egldriver.c6
5 files changed, 36 insertions, 3 deletions
diff --git a/src/egl/main/SConscript b/src/egl/main/SConscript
index 390f28a6b84..2ea2261cc13 100644
--- a/src/egl/main/SConscript
+++ b/src/egl/main/SConscript
@@ -18,21 +18,40 @@ if env['platform'] == 'windows':
'_EGL_GET_CORE_ADDRESSES',
'KHRONOS_DLL_EXPORTS',
])
+elif env['platform'] == 'haiku':
+ env.Append(CPPDEFINES = [
+ '_EGL_NATIVE_PLATFORM=_EGL_PLATFORM_HAIKU',
+ '_EGL_OS_UNIX',
+ '_EGL_BUILT_IN_DRIVER_HAIKU',
+ ])
+ env.Prepend(LIBS = [
+ egl_haiku,
+ libloader,
+ ])
else:
env.Append(CPPDEFINES = [
'_EGL_NATIVE_PLATFORM=_EGL_PLATFORM_X11',
'_EGL_OS_UNIX',
])
+ env.Prepend(LIBS = [
+ egl_dri2,
+ libloader,
+ ])
env.Append(CPPPATH = [
'#/include',
])
+
# parse Makefile.sources
egl_sources = env.ParseSourceList('Makefile.sources', 'LIBEGL_C_FILES')
-egl = env.ConvenienceLibrary(
- target = 'egl',
+# libEGL.dll
+env['LIBPREFIX'] = 'lib'
+env['SHLIBPREFIX'] = 'lib'
+
+egl = env.SharedLibrary(
+ target = 'EGL',
source = egl_sources,
)
diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c
index 511848f93c5..db44a266ef7 100644
--- a/src/egl/main/eglapi.c
+++ b/src/egl/main/eglapi.c
@@ -821,9 +821,11 @@ eglSwapBuffers(EGLDisplay dpy, EGLSurface surface)
_EGL_CHECK_SURFACE(disp, surf, EGL_FALSE, drv);
/* surface must be bound to current context in EGL 1.4 */
+ #ifndef _EGL_BUILT_IN_DRIVER_HAIKU
if (_eglGetContextHandle(ctx) == EGL_NO_CONTEXT ||
surf != ctx->DrawSurface)
RETURN_EGL_ERROR(disp, EGL_BAD_SURFACE, EGL_FALSE);
+ #endif
ret = drv->API.SwapBuffers(drv, disp, surf);
diff --git a/src/egl/main/egldisplay.c b/src/egl/main/egldisplay.c
index 76dfee72ab7..a167ae5c738 100644
--- a/src/egl/main/egldisplay.c
+++ b/src/egl/main/egldisplay.c
@@ -75,7 +75,8 @@ static const struct {
{ _EGL_PLATFORM_DRM, "drm" },
{ _EGL_PLATFORM_FBDEV, "fbdev" },
{ _EGL_PLATFORM_NULL, "null" },
- { _EGL_PLATFORM_ANDROID, "android" }
+ { _EGL_PLATFORM_ANDROID, "android" },
+ { _EGL_PLATFORM_HAIKU, "haiku" }
};
@@ -177,6 +178,10 @@ _eglNativePlatformDetectNativeDisplay(void *nativeDisplay)
/* If not matched to any other platform, fallback to x11. */
return _EGL_PLATFORM_X11;
#endif
+
+#ifdef HAVE_HAIKU_PLATFORM
+ return _EGL_PLATFORM_HAIKU;
+#endif
}
return _EGL_INVALID_PLATFORM;
diff --git a/src/egl/main/egldisplay.h b/src/egl/main/egldisplay.h
index d4b9602de8a..bcdc2b2b693 100644
--- a/src/egl/main/egldisplay.h
+++ b/src/egl/main/egldisplay.h
@@ -46,6 +46,7 @@ enum _egl_platform_type {
_EGL_PLATFORM_FBDEV,
_EGL_PLATFORM_NULL,
_EGL_PLATFORM_ANDROID,
+ _EGL_PLATFORM_HAIKU,
_EGL_NUM_PLATFORMS,
_EGL_INVALID_PLATFORM = -1
diff --git a/src/egl/main/egldriver.c b/src/egl/main/egldriver.c
index 8cf777de794..7ad14d32a7e 100644
--- a/src/egl/main/egldriver.c
+++ b/src/egl/main/egldriver.c
@@ -52,6 +52,9 @@
#include <unistd.h>
#endif
+#ifdef _EGL_BUILT_IN_DRIVER_HAIKU
+_EGLDriver* _eglBuiltInDriverHaiku(const char* args);
+#endif
typedef struct _egl_module {
char *Path;
@@ -73,6 +76,9 @@ const struct {
#ifdef _EGL_BUILT_IN_DRIVER_DRI2
{ "egl_dri2", _eglBuiltInDriverDRI2 },
#endif
+#ifdef _EGL_BUILT_IN_DRIVER_HAIKU
+ { "egl_haiku", _eglBuiltInDriverHaiku },
+#endif
{ NULL, NULL }
};