From fe9e38995f5a0abc196e9600c38d95385d6bf84f Mon Sep 17 00:00:00 2001 From: Jonas Suhr Christensen Date: Sat, 18 Jan 2014 10:17:58 +0100 Subject: Added PuGl window drawing. Enable with './configure -with-pugl'. --- plugingui/Makefile.am | 1 + plugingui/Makefile.am.plugingui | 4 +++- plugingui/window.cc | 13 ++++++++++--- 3 files changed, 14 insertions(+), 4 deletions(-) (limited to 'plugingui') diff --git a/plugingui/Makefile.am b/plugingui/Makefile.am index 252db2a..9cf0218 100644 --- a/plugingui/Makefile.am +++ b/plugingui/Makefile.am @@ -41,6 +41,7 @@ EXTRA_DIST = \ listboxbasic.h \ listboxthin.h \ nativewindow.h \ + nativewindow.h \ nativewindow_win32.h \ nativewindow_x11.h \ painter.h \ diff --git a/plugingui/Makefile.am.plugingui b/plugingui/Makefile.am.plugingui index 121b128..f47582c 100644 --- a/plugingui/Makefile.am.plugingui +++ b/plugingui/Makefile.am.plugingui @@ -1,6 +1,8 @@ PLUGIN_GUI_SOURCES = \ $(top_srcdir)/hugin/hugin.c \ $(top_srcdir)/hugin/hugin_syslog.c \ + $(top_srcdir)/pugl/pugl/pugl_x11.c \ + $(top_srcdir)/plugingui/nativewindow_pugl.cc \ $(top_srcdir)/plugingui/nativewindow_x11.cc \ $(top_srcdir)/plugingui/nativewindow_win32.cc \ $(top_srcdir)/plugingui/plugingui.cc \ @@ -33,4 +35,4 @@ PLUGIN_GUI_SOURCES = \ PLUGIN_GUI_LIBS = $(X11_LIBS) $(PTHREAD_LIBS) $(PNG_LIBS) $(ZLIB_LIBS) -PLUGIN_GUI_CFLAGS = $(X11_CFLAGS) $(PNG_CFLAGS) $(ZLIB_CFLAGS) -I$(top_srcdir)/hugin -DWITH_HUG_SYSLOG -DWITH_HUG_MUTEX $(PTHREAD_CFLAGS) +PLUGIN_GUI_CFLAGS = $(X11_CFLAGS) $(PNG_CFLAGS) $(ZLIB_CFLAGS) -I$(top_srcdir)/hugin -DWITH_HUG_SYSLOG -DWITH_HUG_MUTEX $(PTHREAD_CFLAGS) -I$(top_srcdir)/pugl/pugl diff --git a/plugingui/window.cc b/plugingui/window.cc index 41d4d82..8337533 100644 --- a/plugingui/window.cc +++ b/plugingui/window.cc @@ -34,13 +34,16 @@ #include #include +#ifndef PUGL #ifdef X11 #include "nativewindow_x11.h" #endif/*X11*/ - #ifdef WIN32 #include "nativewindow_win32.h" #endif/*WIN32*/ +#else +#include "nativewindow_pugl.h" +#endif GUI::Window::Window() : Widget(NULL), wpixbuf(100, 100), back(":bg.png"), logo(":logo.png") @@ -55,13 +58,16 @@ GUI::Window::Window() _buttonDownFocus = NULL; _mouseFocus = NULL; +#ifndef PUGL #ifdef X11 native = new NativeWindowX11(this); #endif/*X11*/ - #ifdef WIN32 native = new NativeWindowWin32(this); #endif/*WIN32*/ +#else/*Use pugl*/ + native = new NativeWindowPugl(this); +#endif eventhandler = new GUI::EventHandler(native, this); } @@ -110,8 +116,8 @@ void GUI::Window::resize(int width, int height) resized(width, height); //#endif - native->resize(width, height); Widget::resize(width, height); + native->resize(width, height); } void GUI::Window::move(size_t x, size_t y) @@ -166,6 +172,7 @@ void GUI::Window::endPaint() void GUI::Window::updateBuffer() { + DEBUG(window, "Updating buffer\n"); memset(wpixbuf.buf, 0, wpixbuf.width * wpixbuf.height * 3); std::vector pl = getPixelBuffers(); -- cgit v1.2.3