From 5a5d2019b355ff01732bc9ca550198e2e057777d Mon Sep 17 00:00:00 2001 From: "U. Artie Eoff" Date: Fri, 27 Apr 2012 10:32:16 -0700 Subject: [PATCH] display hooks for window Signed-off-by: U. Artie Eoff --- src/Makefile.am | 5 ++++- src/display.h | 3 +++ src/simple.cpp | 2 ++ src/window.cpp | 6 +++++- 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 6cade67..4fdb1c3 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -3,4 +3,7 @@ CXXFLAGS = -std=gnu++0x $(CAIRO_CFLAGS) $(WAYLAND_CFLAGS) LDFLAGS = $(CAIRO_LIBS) $(WAYLAND_LIBS) bin_PROGRAMS = simple -simple_SOURCES = simple.cpp display.cpp +simple_SOURCES = \ + simple.cpp \ + display.cpp \ + window.cpp diff --git a/src/display.h b/src/display.h index 38a1535..ec82797 100644 --- a/src/display.h +++ b/src/display.h @@ -34,6 +34,9 @@ public: wl_compositor* compositor() { return compositor_; } wl_display* display() { return display_; } + wl_shell* shell() { return shell_; } + EGLConfig& config() { return argbConfig_; } + EGLContext& context() { return argbContext_; } private: wl_display* display_; diff --git a/src/simple.cpp b/src/simple.cpp index 4e753b2..e844af5 100644 --- a/src/simple.cpp +++ b/src/simple.cpp @@ -2,9 +2,11 @@ #include #include "display.h" +#include "window.h" int main(const int argc, const char** argv) { wayland::Display display; + wayland::Window window(display); return 0; } diff --git a/src/window.cpp b/src/window.cpp index 2ea1960..1c54d7d 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -1,3 +1,7 @@ +#include +#include +#include + #include "window.h" namespace wayland { @@ -15,7 +19,7 @@ Window::Window(Display& display) wl_shell_surface_set_toplevel(shellSurface_); assert( - eglMakeCurrent(display_.display(), eglSurface_, eglSurface_, display_.context() + eglMakeCurrent(display_.display(), eglSurface_, eglSurface_, &display_.context()) == EGL_TRUE ); } -- 2.7.4