Advertisement
Guest User

wxSFML.cpp

a guest
Jul 3rd, 2015
255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.85 KB | None | 0 0
  1. #include "wxSFML.h"
  2.  
  3. #ifdef __WXGTK__
  4.     #include <gdk/gdkx.h>
  5.     #include <gtk/gtk.h>
  6.     #include <wx/gtk/win_gtk.h>
  7. #endif
  8.  
  9. wxSFML::wxSFML(wxWindow* Parent, wxWindowID Id, const wxPoint& Position, const wxSize& Size, long Style) : wxControl(Parent, Id, Position, Size, Style) {
  10.     #ifdef __WXGTK__
  11.         gtk_widget_realize(m_wxwindow);
  12.         gtk_widget_set_double_buffered(m_wxwindow, false);
  13.         GdkWindow* Win = GTK_PIZZA(m_wxwindow)->bin_window;
  14.         XFlush(GDK_WINDOW_XDISPLAY(Win));
  15.         sf::RenderWindow::create(GDK_WINDOW_XWINDOW(Win));
  16.     #else
  17.         sf::RenderWindow::create(GetHandle());
  18.     #endif
  19. }
  20.  
  21. void wxSFML::OnIdle(wxIdleEvent&) {
  22.     Refresh();
  23. }
  24.  
  25. void wxSFML::OnPaint(wxPaintEvent&) {
  26.     wxPaintDC Dc(this);
  27.     OnUpdate();
  28.     display();
  29. }
  30.  
  31. void wxSFML::OnEraseBackground(wxEraseEvent&)
  32. {
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement