Cleaned up a bit, reverted API back to normal

This commit is contained in:
Zachary Lund 2014-01-09 19:51:51 -06:00
parent d283f24cbb
commit 69d32725d2
3 changed files with 14 additions and 9 deletions

View File

@ -25,6 +25,10 @@
#include "window-basic-main.hpp" #include "window-basic-main.hpp"
#include "window-namedialog.hpp" #include "window-namedialog.hpp"
#ifdef __WXGTK__
#include <gtk/gtk.h>
#endif
using namespace std; using namespace std;
obs_scene_t OBSBasic::GetCurrentScene() obs_scene_t OBSBasic::GetCurrentScene()
@ -235,6 +239,12 @@ bool OBSBasic::InitGraphics()
"Video", "OutputCY"); "Video", "OutputCY");
ovi.output_format = VIDEO_FORMAT_RGBA; ovi.output_format = VIDEO_FORMAT_RGBA;
ovi.adapter = 0; ovi.adapter = 0;
#ifdef __WXGTK__
/* Ugly hack for GTK, I'm hoping this can be avoided eventually... */
gtk_widget_realize(previewPanel->GetHandle());
#endif
ovi.window = WxToGSWindow(previewPanel); ovi.window = WxToGSWindow(previewPanel);
//required to make opengl display stuff on osx(?) //required to make opengl display stuff on osx(?)

View File

@ -21,7 +21,7 @@
#include "wx-wrappers.hpp" #include "wx-wrappers.hpp"
#include <wx/utils.h> #include <wx/utils.h>
#ifdef __linux__ #ifdef __WXGTK__
#include <gdk/gdkx.h> #include <gdk/gdkx.h>
#include <gtk/gtk.h> #include <gtk/gtk.h>
#endif #endif
@ -29,7 +29,7 @@
#include <memory> #include <memory>
using namespace std; using namespace std;
gs_window WxToGSWindow(wxWindow *wxwin) gs_window WxToGSWindow(const wxWindow *wxwin)
{ {
gs_window window; gs_window window;
@ -38,12 +38,7 @@ gs_window WxToGSWindow(wxWindow *wxwin)
#elif _WIN32 #elif _WIN32
window.hwnd = wxwin->GetHandle(); window.hwnd = wxwin->GetHandle();
#else #else
GtkWidget* hndl = wxwin->GetHandle(); GdkWindow* gdkwin = gtk_widget_get_window(wxwin->GetHandle());
/* I don't really understand why wxWidgets doesn't do this during Show() */
gtk_widget_realize(hndl);
GdkWindow* gdkwin = gtk_widget_get_window(hndl);
window.id = GDK_DRAWABLE_XID(gdkwin); window.id = GDK_DRAWABLE_XID(gdkwin);
window.display = GDK_DRAWABLE_XDISPLAY(gdkwin); window.display = GDK_DRAWABLE_XDISPLAY(gdkwin);
#endif #endif

View File

@ -27,7 +27,7 @@
struct gs_window; struct gs_window;
gs_window WxToGSWindow(wxWindow *window); gs_window WxToGSWindow(const wxWindow *window);
void OBSErrorBox(wxWindow *parent, const char *message, ...); void OBSErrorBox(wxWindow *parent, const char *message, ...);
/* returns actual ID of menu item clicked rather than be forced to use /* returns actual ID of menu item clicked rather than be forced to use