display hooks for window
authorU. Artie Eoff <ullysses.a.eoff@intel.com>
Fri, 27 Apr 2012 17:32:16 +0000 (10:32 -0700)
committerU. Artie Eoff <ullysses.a.eoff@intel.com>
Fri, 27 Apr 2012 17:32:16 +0000 (10:32 -0700)
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
src/Makefile.am
src/display.h
src/simple.cpp
src/window.cpp

index 6cade67..4fdb1c3 100644 (file)
@@ -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
index 38a1535..ec82797 100644 (file)
@@ -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_;
index 4e753b2..e844af5 100644 (file)
@@ -2,9 +2,11 @@
 #include <cstdlib>
 
 #include "display.h"
+#include "window.h"
 
 int main(const int argc, const char** argv)
 {
        wayland::Display display;
+       wayland::Window window(display);
        return 0;
 }
index 2ea1960..1c54d7d 100644 (file)
@@ -1,3 +1,7 @@
+#include <cassert>
+#include <wayland-client.h>
+#include <wayland-egl.h>
+
 #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
        );
 }