Skip to content

Commit

Permalink
SDL fix.
Browse files Browse the repository at this point in the history
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11665 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
  • Loading branch information
Matthias Melcher committed Apr 19, 2016
1 parent 1e8a53e commit 8d796c2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 55 deletions.
39 changes: 0 additions & 39 deletions FL/porting.H
Expand Up @@ -68,54 +68,15 @@ public:
Fl_Region region;
Fl_X *next; // chain of mapped windows
int wait_for_expose;
// NSCursor *cursor;
static Fl_X* first;
static Fl_X* i(const Fl_Window* w) {return w->i;}
static int fake_X_wm(const Fl_Window*,int&,int&,int&,int&,int&);
static Fl_X* make(Fl_Window*);
void flush();
// CGRect* subRect() { return subRect_; } // getter
// void subRect(CGRect *r) { subRect_ = r; } // setter
// bool mapped_to_retina(); // is window mapped to retina display?
// void mapped_to_retina(bool); // sets whether window is mapped to retina display
// bool changed_resolution(); // did window just moved to display with another resolution?
// void changed_resolution(bool);// sets whether window just moved to display with another resolution
// bool in_windowDidResize(); // is window performing windowDidResize?
// void in_windowDidResize(bool); // sets whether window is performing windowDidResize
// // Quartz additions:
// CGContextRef gc; // graphics context (NULL when using QD)
// static void q_release_context(Fl_X *x=0); // free all resources associated with fl_gc
// // Cocoa additions
// static NSOpenGLPixelFormat *mode_to_NSOpenGLPixelFormat(int mode, const int*); // computes NSOpenGLPixelFormat from Gl window's mode
// static NSOpenGLContext* create_GLcontext_for_window(NSOpenGLPixelFormat *pixelformat, NSOpenGLContext *shared_ctx, Fl_Window *window);
// static void GLcontext_update(NSOpenGLContext*);
// static void GLcontext_flushbuffer(NSOpenGLContext*);
// static void GLcontext_release(NSOpenGLContext*);
// static void GLcontext_makecurrent(NSOpenGLContext*);
// static void GL_cleardrawable(void);
// void destroy(void);
// void map(void);
// void unmap(void);
// void collapse(void);
// WindowRef window_ref(void); // useless with cocoa GL windows
// void set_key_window(void);
// // OS X doesn't have per window icons
static void set_default_icons(const Fl_RGB_Image*[], int);
void set_icons();
int set_cursor(Fl_Cursor);
int set_cursor(const Fl_RGB_Image*, int, int);
// static CGImageRef CGImage_from_window_rect(Fl_Window *win, int x, int y, int w, int h);
// static unsigned char *bitmap_from_window_rect(Fl_Window *win, int x, int y, int w, int h, int *bytesPerPixel);
// static Fl_Region intersect_region_and_rect(Fl_Region current, int x,int y,int w, int h);
// static void *get_carbon_function(const char *name);
// static void screen_work_area(int &X, int &Y, int &W, int &H, int n); // compute work area of a given screen
// static int next_marked_length; // next length of marked text after current marked text will have been replaced
// static int insertion_point_location(int *px, int *py, int *pheight); // computes window coordinates & height of insertion point
// static const int CoreText_threshold; // Mac OS version from which the Core Text API is used to display text
// static Fl_Fontdesc* calc_fl_fonts(void); // computes the fl_fonts global variable
// static int dnd(int use_selection); // call Fl_X::dnd(1) to support text dragging
// static int calc_mac_os_version(void); // computes the fl_mac_os_version global variable
// static void clip_to_rounded_corners(CGContextRef gc, int w, int h);
};

extern Window fl_window;
Expand Down
11 changes: 0 additions & 11 deletions src/Fl.cxx
Expand Up @@ -18,17 +18,6 @@

#include <config.h>

#ifdef WIN32
#elif defined(__APPLE__)
#elif defined(USE_SDL)
# pragma message "FL_SDL: implement the FLTK core in its own file"
#elif defined(ANDROID)
# pragma message "ANDROID: implement the FLTK core in its own file"
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: implement the FLTK core in its own file"
# include "Fl_porting.cxx"
#endif

#include <FL/Fl.H>
#include <FL/x.H>
#include <FL/Fl_Screen_Driver.H>
Expand Down
9 changes: 4 additions & 5 deletions src/drivers/PicoSDL/Fl_PicoSDL_Screen_Driver.cxx
Expand Up @@ -58,19 +58,18 @@ double Fl_PicoSDL_Screen_Driver::wait(double time_to_wait)
case SDL_WINDOWEVENT_EXPOSED:
case SDL_WINDOWEVENT_SHOWN:
{
//event->window.windowID
if ( !window ) break;;
Fl_Window_Driver *wd = window->driver();
Fl_X *i = Fl_X::i(Fl::first_window());
i->w->driver()->wait_for_expose_value = 0;

wd->wait_for_expose_value = 0;
if ( i->region ) {
XDestroyRegion(i->region);
i->region = 0;
}
window->clear_damage(FL_DAMAGE_ALL);
i->flush();
wd->flush();
window->clear_damage();
Fl_X::first->w->driver()->wait_for_expose_value = 0;
wd->wait_for_expose_value = 0;
}
break;
}
Expand Down

0 comments on commit 8d796c2

Please sign in to comment.