Re: [fltk.bugs] [HIGH] STR #2944: Mac OS X Fl_Gl_Window bugs - all FLTK versions
DO NOT REPLY TO THIS MESSAGE. INSTEAD, POST ANY RESPONSES TO THE LINK BELOW. [STR New] Link: http://www.fltk.org/str.php?L2944 Version: 1.3.2 Thanks for the patches! Can you supply a small compilable app that demonstrates the problem for (1) and (2)? Along the lines of e.g. http://seriss.com/people/erco/fltk/#OpenGlSimple Would like to verify the behavior described. Link: http://www.fltk.org/str.php?L2944 Version: 1.3.2 ___ fltk-bugs mailing list fltk-bugs@easysw.com http://lists.easysw.com/mailman/listinfo/fltk-bugs
Re: [fltk.bugs] [HIGH] STR #2944: Mac OS X Fl_Gl_Window bugs - all FLTK versions
DO NOT REPLY TO THIS MESSAGE. INSTEAD, POST ANY RESPONSES TO THE LINK BELOW. [STR New] Link: http://www.fltk.org/str.php?L2944 Version: 1.3.2 Attached file GlWindow-rasterpos-bug.c++... Link: http://www.fltk.org/str.php?L2944 Version: 1.3.2// LHQuam modification to gl_overlay.cxx to demonstrate Mac OS X Gl_Window glRasterPos bug // when drawing text using gl_draw to Gl_Window AND using draw_overlay. // On Mac OS X // g++ -g -Wno-deprecated-declarations -Wall -Wunused -Wno-format-y2k -fPIC -fno-exceptions -fno-strict-aliasing -I/homedir/quam/Q/downloads/fltk/fltk-1.3.2-mac/ -o GlWindow-rasterpos-bug GlWindow-rasterpos-bug.c++ -L/opt/local/lib -lfltk_gl -lfltk -framework AGL -framework OpenGL -framework ApplicationServices -framework Cocoa // On Mac OS X: To redirect to alternate library location: // export DYLD_LIBRARY_PATH=/homedir/quam/Q/downloads/fltk/fltk-1.3.2-mac/src // On Linux //g++ -g -Wno-deprecated-declarations -Wall -Wunused -Wno-format-y2k -fPIC -fno-exceptions -fno-strict-aliasing -I/homedir/quam/Q/downloads/fltk/fltk-1.3.2/ -o GlWindow-rasterpos-bug GlWindow-rasterpos-bug.c++ -L/homedir/quam/downloads/fltk/fltk-1.3.2/src/ -lfltk.1.3 -lfltk_gl.1.3 -lGL // On Linux: To redirect to alternate library location: // set environment LD_LIBRARY_PATH=/homedir/quam/downloads/fltk/fltk-1.3-SVN-20130404/src // // $Id: gl_overlay.cxx 8864 2011-07-19 04:49:30Z greg.ercolano $ // // OpenGL overlay test program for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. // // This library is free software. Distribution and use rights are outlined in // the file COPYING which should have been included with this file. If this // file is missing or damaged, see the license at: // // http://www.fltk.org/COPYING.php // // Please report all bugs and problems on the following page: // // http://www.fltk.org/str.php // #include config.h #include FL/Fl.H #include FL/Fl_Window.H #include FL/Fl_Hor_Slider.H #include FL/Fl_Toggle_Button.H #include FL/math.h #if !HAVE_GL #include FL/Fl_Box.H class shape_window : public Fl_Box { public: int sides; shape_window(int x,int y,int w,int h,const char *l=0) :Fl_Box(FL_DOWN_BOX,x,y,w,h,l){ label(This demo does\nnot work without GL); } }; #else #include FL/gl.h #include FL/Fl_Gl_Window.H class shape_window : public Fl_Gl_Window { void draw(); void draw_overlay(); public: int sides; int overlay_sides; shape_window(int x,int y,int w,int h,const char *l=0); }; shape_window::shape_window(int x,int y,int w,int h,const char *l) : Fl_Gl_Window(x,y,w,h,l) { sides = overlay_sides = 3; } void shape_window::draw() { // the valid() property may be used to avoid reinitializing your // GL transformation for each redraw: if (!valid()) { valid(1); glLoadIdentity(); glViewport(0,0,w(),h()); } // draw an amazing but slow graphic: glClear(GL_COLOR_BUFFER_BIT); // for (int j=1; j=1000; j++) { glBegin(GL_POLYGON); for (int j=0; jsides; j++) { double ang = j*2*M_PI/sides; glColor3f(float(j)/sides,float(j)/sides,float(j)/sides); glVertex3f(cos(ang),sin(ang),0); } glEnd(); gl_draw(call to gl_draw, 0.0f,0.0f); // comment this line out to suppress the bug // } } void shape_window::draw_overlay() { // the valid() property may be used to avoid reinitializing your // GL transformation for each redraw: if (!valid()) { valid(1); glLoadIdentity(); glViewport(0,0,w(),h()); } // draw an amazing graphic: gl_color(FL_RED); glBegin(GL_LINE_LOOP); for (int j=0; joverlay_sides; j++) { double ang = j*2*M_PI/overlay_sides; glVertex3f(cos(ang),sin(ang),0); } glEnd(); } #endif // when you change the data, as in this callback, you must call redraw(): void sides_cb(Fl_Widget *o, void *p) { shape_window *sw = (shape_window *)p; sw-sides = int(((Fl_Slider *)o)-value()); sw-redraw(); } #if HAVE_GL void overlay_sides_cb(Fl_Widget *o, void *p) { shape_window *sw = (shape_window *)p; sw-overlay_sides = int(((Fl_Slider *)o)-value()); sw-redraw_overlay(); } #endif #include stdio.h int main(int argc, char **argv) { Fl_Window window(300, 370); shape_window sw(10, 75, window.w()-20, window.h()-90); //sw.mode(FL_RGB); window.resizable(sw); Fl_Hor_Slider slider(60, 5, window.w()-70, 30, Sides:); slider.align(FL_ALIGN_LEFT); slider.callback(sides_cb,sw); slider.value(sw.sides); slider.step(1); slider.bounds(3,40); Fl_Hor_Slider oslider(60, 40, window.w()-70, 30, Overlay:); oslider.align(FL_ALIGN_LEFT); #if HAVE_GL oslider.callback(overlay_sides_cb,sw); oslider.value(sw.overlay_sides); #endif oslider.step(1); oslider.bounds(3,40); window.end(); window.show(argc,argv); #if HAVE_GL printf(Can do overlay = %d\n, sw.can_do_overlay()); sw.show(); sw.redraw_overlay(); #else sw.show(); #endif return Fl::run(); } // // End of $Id: gl_overlay.cxx 8864 2011-07-19 04:49:30Z
Re: [fltk.bugs] [HIGH] STR #2944: Mac OS X Fl_Gl_Window bugs - all FLTK versions
DO NOT REPLY TO THIS MESSAGE. INSTEAD, POST ANY RESPONSES TO THE LINK BELOW. [STR New] Link: http://www.fltk.org/str.php?L2944 Version: 1.3.2 Attached file GlWindow-nested-window-bug.c++... Link: http://www.fltk.org/str.php?L2944 Version: 1.3.2// LHQuam modification to shape.cxx to demonstrate Mac OS X Gl_Window bug when the Gl_Window // is inside nested Fl_Windows. // // On Mac OS X // g++ -g -Wno-deprecated-declarations -Wall -Wunused -Wno-format-y2k -fPIC -fno-exceptions -fno-strict-aliasing -I/homedir/quam/Q/downloads/fltk/fltk-1.3.2-mac/ -o GlWindow-nested-window-bug GlWindow-nested-window-bug.c++ -L/opt/local/lib -lfltk_gl -lfltk -framework AGL -framework OpenGL -framework ApplicationServices -framework Cocoa // On Mac OS X: To redirect to alternate library location: // export DYLD_LIBRARY_PATH=/homedir/quam/Q/downloads/fltk/fltk-1.3.2-mac/src // On Linux //g++ -g -Wno-deprecated-declarations -Wall -Wunused -Wno-format-y2k -fPIC -fno-exceptions -fno-strict-aliasing -I/homedir/quam/Q/downloads/fltk/fltk-1.3.2/ -o GlWindow-nested-window-bug GlWindow-nested-window-bug.c++ -L/homedir/quam/downloads/fltk/fltk-1.3.2/src/ -lfltk.1.3 -lfltk_gl.1.3 -lGL // On Linux: To redirect to alternate library location: // set environment LD_LIBRARY_PATH=/homedir/quam/downloads/fltk/fltk-1.3-SVN-20130404/src // ## // $Id: shape.cxx 8864 2011-07-19 04:49:30Z greg.ercolano $ // // Tiny OpenGL demo program for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2010 by Bill Spitzak and others. // // This library is free software. Distribution and use rights are outlined in // the file COPYING which should have been included with this file. If this // file is missing or damaged, see the license at: // // http://www.fltk.org/COPYING.php // // Please report all bugs and problems on the following page: // // http://www.fltk.org/str.php // #include config.h #include FL/Fl.H #include FL/Fl_Window.H #include FL/Fl_Hor_Slider.H #include FL/math.h #if HAVE_GL #include FL/gl.h #include FL/Fl_Gl_Window.H class shape_window : public Fl_Gl_Window { void draw(); public: int sides; shape_window(int x,int y,int w,int h,const char *l=0); }; shape_window::shape_window(int x,int y,int w,int h,const char *l) : Fl_Gl_Window(x,y,w,h,l) { sides = 3; } void shape_window::draw() { // the valid() property may be used to avoid reinitializing your // GL transformation for each redraw: if (!valid()) { valid(1); glLoadIdentity(); glViewport(0, 0, w(), h()); } // draw an amazing graphic: glClear(GL_COLOR_BUFFER_BIT); glColor3f(.5,.6,.7); glBegin(GL_POLYGON); for (int j=0; jsides; j++) { double ang = j*2*M_PI/sides; glVertex3f(cos(ang),sin(ang),0); } glEnd(); } #else #include FL/Fl_Box.H class shape_window : public Fl_Box { public: int sides; shape_window(int x,int y,int w,int h,const char *l=0) :Fl_Box(FL_DOWN_BOX,x,y,w,h,l){ label(This demo does\nnot work without GL); } }; #endif // when you change the data, as in this callback, you must call redraw(): void sides_cb(Fl_Widget *o, void *p) { shape_window *sw = (shape_window *)p; sw-sides = int(((Fl_Slider *)o)-value()); sw-redraw(); } int main(int argc, char **argv) { Fl_Window window(300, 330); // top-level Fl_Window Fl_Window win2(0,0,300,290); // Fl_Window nested inside top-level Fl_Window shape_window sw(10, 10, 280, 280); // make it resize: win2.resizable(sw); win2.end(); window.resizable(win2); // window.size_range(300,330,0,0,1,1,1); // add a knob to control it: Fl_Hor_Slider slider(50, 295, window.w()-60, 30, Sides:); slider.align(FL_ALIGN_LEFT); slider.callback(sides_cb,sw); slider.value(sw.sides); slider.step(1); slider.bounds(3,40); window.end(); window.show(argc,argv); return Fl::run(); } // // End of $Id: shape.cxx 8864 2011-07-19 04:49:30Z greg.ercolano $. // ___ fltk-bugs mailing list fltk-bugs@easysw.com http://lists.easysw.com/mailman/listinfo/fltk-bugs
Re: [fltk.bugs] [HIGH] STR #2944: Mac OS X Fl_Gl_Window bugs - all FLTK versions
DO NOT REPLY TO THIS MESSAGE. INSTEAD, POST ANY RESPONSES TO THE LINK BELOW. [STR New] Link: http://www.fltk.org/str.php?L2944 Version: 1.3.2 I have added files for two test programs that demonstrate the reported Gl_Window bugs. Link: http://www.fltk.org/str.php?L2944 Version: 1.3.2 ___ fltk-bugs mailing list fltk-bugs@easysw.com http://lists.easysw.com/mailman/listinfo/fltk-bugs
Re: [fltk.bugs] [HIGH] STR #2944: Mac OS X Fl_Gl_Window bugs - all FLTK versions
DO NOT REPLY TO THIS MESSAGE. INSTEAD, POST ANY RESPONSES TO THE LINK BELOW. [STR Active] Link: http://www.fltk.org/str.php?L2944 Version: 1.3.2 Assigning this STR to myself. Confirmed #2: Attaching rasterpos-fix-before-and-after-screenshot.jpg showing the problem/solution, and agree with the suggested fix to Fl_Gl_Window::make_current(). Since finding the window offset is now needed in at least two places in the code, will probably add a method to the Fl_Window base class that returns x/y offsets, and use that to implement the fix. Link: http://www.fltk.org/str.php?L2944 Version: 1.3.2attachment: rasterpos-fix-before-and-after-screenshot.jpg___ fltk-bugs mailing list fltk-bugs@easysw.com http://lists.easysw.com/mailman/listinfo/fltk-bugs
[fltk.commit] [Library] r9859 - branches/branch-1.3/ide/Xcode4/plists
Author: manolo Date: 2013-04-05 07:53:26 -0700 (Fri, 05 Apr 2013) New Revision: 9859 Log: Added the NSHighResolutionCapable item to all .plist files for fltk apps to be high-resolution ready. Modified: branches/branch-1.3/ide/Xcode4/plists/CubeView-Info.plist branches/branch-1.3/ide/Xcode4/plists/Demo-Info.plist branches/branch-1.3/ide/Xcode4/plists/Fluid-Info.plist branches/branch-1.3/ide/Xcode4/plists/adjuster-Info.plist branches/branch-1.3/ide/Xcode4/plists/arc-Info.plist branches/branch-1.3/ide/Xcode4/plists/ask-Info.plist branches/branch-1.3/ide/Xcode4/plists/bitmap-Info.plist branches/branch-1.3/ide/Xcode4/plists/blocks-Info.plist branches/branch-1.3/ide/Xcode4/plists/boxtype-Info.plist branches/branch-1.3/ide/Xcode4/plists/browser-Info.plist branches/branch-1.3/ide/Xcode4/plists/button-Info.plist branches/branch-1.3/ide/Xcode4/plists/buttons-Info.plist branches/branch-1.3/ide/Xcode4/plists/checkers-Info.plist branches/branch-1.3/ide/Xcode4/plists/clock-Info.plist branches/branch-1.3/ide/Xcode4/plists/colbrowser-Info.plist branches/branch-1.3/ide/Xcode4/plists/color_chooser-Info.plist branches/branch-1.3/ide/Xcode4/plists/cube-Info.plist branches/branch-1.3/ide/Xcode4/plists/cursor-Info.plist branches/branch-1.3/ide/Xcode4/plists/curve-Info.plist branches/branch-1.3/ide/Xcode4/plists/device-Info.plist branches/branch-1.3/ide/Xcode4/plists/doublebuffer-Info.plist branches/branch-1.3/ide/Xcode4/plists/editor-Info.plist branches/branch-1.3/ide/Xcode4/plists/fast_slow-Info.plist branches/branch-1.3/ide/Xcode4/plists/file_chooser-Info.plist branches/branch-1.3/ide/Xcode4/plists/fltk-Info.plist branches/branch-1.3/ide/Xcode4/plists/fltk_forms-Info.plist branches/branch-1.3/ide/Xcode4/plists/fltk_gl-Info.plist branches/branch-1.3/ide/Xcode4/plists/fltk_images-Info.plist branches/branch-1.3/ide/Xcode4/plists/fltk_jpeg-Info.plist branches/branch-1.3/ide/Xcode4/plists/fltk_png-Info.plist branches/branch-1.3/ide/Xcode4/plists/fltk_zlib-Info.plist branches/branch-1.3/ide/Xcode4/plists/fonts-Info.plist branches/branch-1.3/ide/Xcode4/plists/forms-Info.plist branches/branch-1.3/ide/Xcode4/plists/fractals-Info.plist branches/branch-1.3/ide/Xcode4/plists/fullscreen-Info.plist branches/branch-1.3/ide/Xcode4/plists/gl_overlay-Info.plist branches/branch-1.3/ide/Xcode4/plists/glpuzzle-Info.plist branches/branch-1.3/ide/Xcode4/plists/hello-Info.plist branches/branch-1.3/ide/Xcode4/plists/help-Info.plist branches/branch-1.3/ide/Xcode4/plists/iconize-Info.plist branches/branch-1.3/ide/Xcode4/plists/image-Info.plist branches/branch-1.3/ide/Xcode4/plists/inactive-Info.plist branches/branch-1.3/ide/Xcode4/plists/input-Info.plist branches/branch-1.3/ide/Xcode4/plists/input_choice-Info.plist branches/branch-1.3/ide/Xcode4/plists/keyboard-Info.plist branches/branch-1.3/ide/Xcode4/plists/label-Info.plist branches/branch-1.3/ide/Xcode4/plists/line_style-Info.plist branches/branch-1.3/ide/Xcode4/plists/list_visuals-Info.plist branches/branch-1.3/ide/Xcode4/plists/mandelbrot-Info.plist branches/branch-1.3/ide/Xcode4/plists/menubar-Info.plist branches/branch-1.3/ide/Xcode4/plists/message-Info.plist branches/branch-1.3/ide/Xcode4/plists/minimum-Info.plist branches/branch-1.3/ide/Xcode4/plists/native-filechooser-Info.plist branches/branch-1.3/ide/Xcode4/plists/navigation-Info.plist branches/branch-1.3/ide/Xcode4/plists/output-Info.plist branches/branch-1.3/ide/Xcode4/plists/overlay-Info.plist branches/branch-1.3/ide/Xcode4/plists/pack-Info.plist branches/branch-1.3/ide/Xcode4/plists/pixmap-Info.plist branches/branch-1.3/ide/Xcode4/plists/pixmap_browser-Info.plist branches/branch-1.3/ide/Xcode4/plists/preferences-Info.plist branches/branch-1.3/ide/Xcode4/plists/radio-Info.plist branches/branch-1.3/ide/Xcode4/plists/resize-Info.plist branches/branch-1.3/ide/Xcode4/plists/resizebox-Info.plist branches/branch-1.3/ide/Xcode4/plists/rotated_text-Info.plist branches/branch-1.3/ide/Xcode4/plists/scroll-Info.plist branches/branch-1.3/ide/Xcode4/plists/shape-Info.plist branches/branch-1.3/ide/Xcode4/plists/subwindow-Info.plist branches/branch-1.3/ide/Xcode4/plists/sudoku-Info.plist branches/branch-1.3/ide/Xcode4/plists/symbols-Info.plist branches/branch-1.3/ide/Xcode4/plists/table-Info.plist branches/branch-1.3/ide/Xcode4/plists/tabs-Info.plist branches/branch-1.3/ide/Xcode4/plists/threads-Info.plist branches/branch-1.3/ide/Xcode4/plists/tile-Info.plist branches/branch-1.3/ide/Xcode4/plists/tiled_image-Info.plist branches/branch-1.3/ide/Xcode4/plists/tree-Info.plist branches/branch-1.3/ide/Xcode4/plists/utf8-Info.plist branches/branch-1.3/ide/Xcode4/plists/valuators-Info.plist branches/branch-1.3/ide/Xcode4/plists/zlib-Info.plist Modified: branches/branch-1.3/ide/Xcode4/plists/CubeView-Info.plist
[fltk.commit] [Library] r9860 - branches/branch-1.3/ide/Xcode4/Project Templates/FLTK Application/FLTK 1.3
Author: manolo Date: 2013-04-05 08:09:50 -0700 (Fri, 05 Apr 2013) New Revision: 9860 Log: Added the NSHighResolutionCapable item to all .plist files for fltk apps to be high-resolution ready. Modified: branches/branch-1.3/ide/Xcode4/Project Templates/FLTK Application/FLTK 1.3/___PROJECTNAMEASIDENTIFIER___-Info.plist Modified: branches/branch-1.3/ide/Xcode4/Project Templates/FLTK Application/FLTK 1.3/___PROJECTNAMEASIDENTIFIER___-Info.plist === --- branches/branch-1.3/ide/Xcode4/Project Templates/FLTK Application/FLTK 1.3/___PROJECTNAMEASIDENTIFIER___-Info.plist 2013-04-05 14:53:26 UTC (rev 9859) +++ branches/branch-1.3/ide/Xcode4/Project Templates/FLTK Application/FLTK 1.3/___PROJECTNAMEASIDENTIFIER___-Info.plist 2013-04-05 15:09:50 UTC (rev 9860) @@ -24,5 +24,7 @@ string1.0/string keyLSMinimumSystemVersion/key string${MACOSX_DEPLOYMENT_TARGET}/string + keyNSHighResolutionCapable/key + true/ /dict /plist ___ fltk-commit mailing list fltk-commit@easysw.com http://lists.easysw.com/mailman/listinfo/fltk-commit
[fltk.commit] [Library] r9861 - branches/branch-1.3
Author: manolo Date: 2013-04-05 08:28:43 -0700 (Fri, 05 Apr 2013) New Revision: 9861 Log: Added the NSHighResolutionCapable item to fltk-config --post for fltk apps to be high-resolution ready. Modified: branches/branch-1.3/fltk-config.cmake.in branches/branch-1.3/fltk-config.in Modified: branches/branch-1.3/fltk-config.cmake.in === --- branches/branch-1.3/fltk-config.cmake.in2013-04-05 15:09:50 UTC (rev 9860) +++ branches/branch-1.3/fltk-config.cmake.in2013-04-05 15:28:43 UTC (rev 9861) @@ -317,7 +317,8 @@ string$post/string keyCFBundlePackageType/key stringAPPL/string -/dict + keyNSHighResolutionCapable/key + true/ /plist EOF ;; Modified: branches/branch-1.3/fltk-config.in === --- branches/branch-1.3/fltk-config.in 2013-04-05 15:09:50 UTC (rev 9860) +++ branches/branch-1.3/fltk-config.in 2013-04-05 15:28:43 UTC (rev 9861) @@ -317,6 +317,8 @@ string$post/string keyCFBundlePackageType/key stringAPPL/string + keyNSHighResolutionCapable/key + true/ /dict /plist EOF ___ fltk-commit mailing list fltk-commit@easysw.com http://lists.easysw.com/mailman/listinfo/fltk-commit
Re: [fltk.development] fltk and high res retina display?
I just upgraded to a newer mac laptop, and discovered that fltk apps don't render in the new highres mode. It seems like it shouldn't be too hard for text at least, but I wasn't able to find an enable high res flag after a bit of looking at https://developer.apple.com/library/mac/#documentation/GraphicsAnimation/Conceptual/HighResolutionOSX/Introduction/Introduction.html#//apple_ref/doc/uid/TP40012302-CH1-SW1 There is kWindowHighResolutionCapableAttribute but it's for Carbon. The implication seems to be that for Cocoa apps it should just work. Any of the more mac knowledgeable sorts know what's going on here, or should I keep poking through the apple docs? I have activated QuartzDebug, as suggested in the above-mentionned web-page, to test high resolution without a retina display, and discover that fltk graphics have jagged look everywhere. What a delusion! A very strange thing is that system-created windows (the About my prog, open/save and print dialogs) also have jagged graphics. This suggests we miss some application-wide property. ___ fltk-dev mailing list fltk-dev@easysw.com http://lists.easysw.com/mailman/listinfo/fltk-dev
Re: [fltk.development] fltk and high res retina display?
There is kWindowHighResolutionCapableAttribute but it's for Carbon. The implication seems to be that for Cocoa apps it should just work. Any of the more mac knowledgeable sorts know what's going on here, or should I keep poking through the apple docs? And by Any of the more mac knowledgeable sorts I guess you mainly mean Manolo, since he was the driving force behind the Cocoa porting! I have no ideas myself... Selex ES Ltd Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex SS14 3EL A company registered in England Wales. Company no. 02426132 This email and any attachments are confidential to the intended recipient and may also be privileged. If you are not the intended recipient please delete it from your system and notify the sender. You should not copy it or use it for any purpose nor disclose or distribute its contents to any other person. ___ fltk-dev mailing list fltk-dev@easysw.com http://lists.easysw.com/mailman/listinfo/fltk-dev
Re: [fltk.development] fltk and high res retina display?
On 05 Apr 2013, at 10:53, Manolo Gouy manolo.g...@univ-lyon1.fr wrote: I just upgraded to a newer mac laptop, and discovered that fltk apps don't render in the new highres mode. It seems like it shouldn't be too hard for text at least, but I wasn't able to find an enable high res flag after a bit of looking at https://developer.apple.com/library/mac/#documentation/GraphicsAnimation/Conceptual/HighResolutionOSX/Introduction/Introduction.html#//apple_ref/doc/uid/TP40012302-CH1-SW1 There is kWindowHighResolutionCapableAttribute but it's for Carbon. The implication seems to be that for Cocoa apps it should just work. Any of the more mac knowledgeable sorts know what's going on here, or should I keep poking through the apple docs? I have activated QuartzDebug, as suggested in the above-mentionned web-page, to test high resolution without a retina display, and discover that fltk graphics have jagged look everywhere. What a delusion! A very strange thing is that system-created windows (the About my prog, open/save and print dialogs) also have jagged graphics. This suggests we miss some application-wide property. Adding keyNSHighResolutionCapable/keytrue/ in the app's Info.plist makes standard FLTK widgets/fonts draw fairly well (there are some small artifacts and off-by-one line drawings here and there, but nothing major). OpenGL windows are still drawn at half-resolution, though... Christophe ___ fltk-dev mailing list fltk-dev@easysw.com http://lists.easysw.com/mailman/listinfo/fltk-dev -- Prof. Christophe Geuzaine University of Liege, Electrical Engineering and Computer Science http://www.montefiore.ulg.ac.be/~geuzaine ___ fltk-dev mailing list fltk-dev@easysw.com http://lists.easysw.com/mailman/listinfo/fltk-dev
Re: [fltk.development] fltk and high res retina display?
I just upgraded to a newer mac laptop, and discovered that fltk apps don't render in the new highres mode. It seems like it shouldn't be too hard for text at least, but I wasn't able to find an enable high res flag after a bit of looking at https://developer.apple.com/library/mac/#documentation/GraphicsAnimation/Conceptual/HighResolutionOSX/Introduction/Introduction.html#//apple_ref/doc/uid/TP40012302-CH1-SW1 OK. As reported before by Christophe, the solution is to add one item to the application's Info.plist file, as explained by Apple there: http://developer.apple.com/library/mac/#documentation/GraphicsAnimation/Conceptual/HighResolutionOSX/Explained/Explained.html The item is of the Boolean type, is named NSHighResolutionCapable, and should be turned on. The effect is that when File/Get Info from the finder is done on the application, the Open in Low Resolution option becomes activated and unchecked, instead of greyed out and checked. ___ fltk-dev mailing list fltk-dev@easysw.com http://lists.easysw.com/mailman/listinfo/fltk-dev
[fltk.development] mods to fltk-config.cmake.in in r9861
Hmm, aren't we loosing the close of /dict with this change? Modified: branches/branch-1.3/fltk-config.cmake.in === --- branches/branch-1.3/fltk-config.cmake.in2013-04-05 15:09:50 UTC (rev 9860) +++ branches/branch-1.3/fltk-config.cmake.in2013-04-05 15:28:43 UTC (rev 9861) @@ -317,7 +317,8 @@ string$post/string keyCFBundlePackageType/key stringAPPL/string -/dict + keyNSHighResolutionCapable/key + true/ /plist EOF ___ fltk-dev mailing list fltk-dev@easysw.com http://lists.easysw.com/mailman/listinfo/fltk-dev
[fltk.general] Caps Lock detection
I need to immediately detect when Caps Lock is turned on or off in our login screen, so I can alert the user. Neither of the approaches I've tried works. Both the overrides of Fl_Window::handle and Fl_Secret_Input::handle don't report that Caps Lock has been turned off until the message after it's been turned off. Here's the below sample program's output for the transition from Caps Lock on to off. caps lock 7 caps lock 6 caps lock 7 caps lock 8 caps lock 9 caps lock 8 caps lock 10 Howard Rubin #include FL/Fl.H #include FL/Fl_Window.H #include FL/Fl_Secret_Input.H #include iostream class myWindow : public Fl_Window { public: myWindow(int x, int y, const char* l) : Fl_Window(x, y, l) { } virtual int handle(int event) { static int n = 0; if (Fl::event_state() FL_CAPS_LOCK) { std::cout caps lock ++n std::endl; } else { std::cout caps unlock ++n std::endl; } return Fl_Window::handle(event); } }; class mySecretInput : public Fl_Secret_Input { public: mySecretInput(int x, int y, int w, int h, const char *l) : Fl_Secret_Input(x, y, w, h, l) { } int handle(int event) { static int n = 0; if (Fl::event_state() FL_CAPS_LOCK) { std::coutcaps lock ++n std::endl; } else { std::coutcaps unlock ++n std::endl; } return Fl_Secret_Input::handle(event); } }; int main(int argc, char* argv[]) { myWindow* win = new myWindow(300, 200, ); mySecretInput* inp = new mySecretInput(20, 20, 100, 15, ); win-end(); win-show(); return Fl::run(); } ___ fltk mailing list fltk@easysw.com http://lists.easysw.com/mailman/listinfo/fltk
Re: [fltk.general] Caps Lock detection
On 04/05/13 08:59, Howard Rubin wrote: I need to immediately detect when Caps Lock is turned on or off in our login screen, so I can alert the user. Neither of the approaches I've tried works. Do you see the same problem when using the fltk test/keyboard application? ___ fltk mailing list fltk@easysw.com http://lists.easysw.com/mailman/listinfo/fltk
Re: [fltk.general] Caps Lock detection
#include FL/Fl.H #include FL/Fl_Window.H #include FL/Fl_Secret_Input.H #include iostream class myWindow : public Fl_Window { public: myWindow(int x, int y, const char* l) : Fl_Window(x, y, l) { } virtual int handle(int event) { if (event== FL_SHORTCUT) { static int n = 0; if (Fl::event_state() FL_CAPS_LOCK) { std::cout caps lock ++n std::endl; } else { std::cout caps unlock ++n std::endl; } return 1; } else return Fl_Window::handle(event); } }; int main(int argc, char* argv[]) { myWindow* win = new myWindow(300, 200, ); new Fl_SecretInput(20, 20, 100, 15, ); win-end(); win-show(); return Fl::run(); } ___ fltk mailing list fltk@easysw.com http://lists.easysw.com/mailman/listinfo/fltk
Re: [fltk.general] Caps Lock detection
virtual int handle(int event) { if (event== FL_SHORTCUT) if (event== FL_SHORTCUT Fl::event_key()== 65509) Without check of key every shortcut signals caps lock, thats wrong. And it seems, the real state establishs after the events had run through, but because of binary state it's no problem. ___ fltk mailing list fltk@easysw.com http://lists.easysw.com/mailman/listinfo/fltk
Re: [fltk.general] Caps Lock detection
Thanks for the quick reply. Here's what I have now. It's reporting the opposite of of the Caps Lock state. In other words, (Fl::event_state() FL_CAPS_LOCK) is zero when Caps Lock is on, and nonzero when it's off. Is that what you meant in your last message? I'm less than enthusiastic about displaying the 'Caps Lock is on' message when the test in the code says it's off. Is there really no alternative? Thanks, Howard Rubin #include FL/Fl.H #include FL/Fl_Window.H #include FL/Fl_Secret_Input.H #include iostream class myWindow : public Fl_Window { public: myWindow(int x, int y, const char* l) : Fl_Window(x, y, l) { } virtual int handle(int event) { if (event== FL_SHORTCUT Fl::event_key() == FL_Caps_Lock) { static int n = 0; if (Fl::event_state() FL_CAPS_LOCK) { std::cout caps lock ++n std::endl; } else { std::cout caps unlock ++n std::endl; } return 1; } else return Fl_Window::handle(event); } }; int main(int argc, char* argv[]) { myWindow* win = new myWindow(300, 200, ); new Fl_Secret_Input(20, 20, 100, 15, ); win-end(); win-show(); return Fl::run(); } ___ fltk mailing list fltk@easysw.com http://lists.easysw.com/mailman/listinfo/fltk
Re: [fltk.general] Caps Lock detection
On 05.04.2013 22:02, Howard Rubin wrote: Thanks for the quick reply. Here's what I have now. It's reporting the opposite of of the Caps Lock state. In other words, (Fl::event_state() FL_CAPS_LOCK) is zero when Caps Lock is on, and nonzero when it's off. Is that what you meant in your last message? I'm less than enthusiastic about displaying the 'Caps Lock is on' message when the test in the code says it's off. Is there really no alternative? Well, there should be a better way, but it looks like you found a bug or at least some inconsistency. I'll post two different modified test programs (derived from yours) that do unfortunately show inconsistent behavior on Windows and Linux on my test systems, i.e. Windows 7 and Linux Ubuntu 12.04 an a Virtualbox VM. Maybe someone can test it on a real Linux box and on Mac OS X ? Howard, what's your environment ? Here's #1 that shows more events and gives a clue how to handle the key, and it works well on Windows, but doesn't on my Linux VM: $ cat capslock.cxx #include FL/Fl.H #include FL/Fl_Window.H #include FL/Fl_Button.H #include FL/Fl_Secret_Input.H #include FL/names.h #include iostream class myWindow : public Fl_Window { public: myWindow(int x, int y, const char* l) : Fl_Window(x, y, l) { } virtual int handle(int event) { if (event == FL_FOCUS) { std::cout event = fl_eventnames[event] ... ; if (Fl::event_state() FL_CAPS_LOCK) std::cout WARNING: CAPS LOCK is set; std::cout std::endl; return 1; } if ((event == FL_SHORTCUT || event == FL_KEYDOWN || event == FL_KEYUP) Fl::event_key() == FL_Caps_Lock) { std::cout event = fl_eventnames[event] ... ; static int n = 0; if (Fl::event_state() FL_CAPS_LOCK) { std::cout caps lock ++n std::endl; } else { std::cout caps unlock ++n std::endl std::endl; } return 1; } else return Fl_Window::handle(event); } }; int main(int argc, char* argv[]) { myWindow* win = new myWindow(300, 200, ); new Fl_Secret_Input(20, 20, 100, 20, ); new Fl_Button(20, 120, 100, 20, Test); win-end(); win-show(); return Fl::run(); } // end of file Compilation and output on Windows: $ fltk-config --compile capslock.cxx ./capslock.exe g++ -I/fltk/svn/fltk-1.3 -I/fltk/svn/fltk-1.3/png -I/fltk/svn/fltk-1.3/zlib -I/fltk/svn/fltk-1.3/jpeg -mwindows -DWIN32 -DUSE_OPENGL32 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -o 'capslock' 'capslock.cxx' -mwindows -static-libgcc -static-libstdc++ /fltk/svn/fltk-1.3/lib/libfltk.a -lole32 -luuid -lcomctl32 event = FL_FOCUS ... event = FL_KEYDOWN ... caps lock 1 event = FL_KEYUP ... caps lock 2 event = FL_KEYDOWN ... caps lock 3 event = FL_KEYUP ... caps unlock 4 event = FL_KEYDOWN ... caps lock 5 event = FL_KEYUP ... caps lock 6 event = FL_KEYDOWN ... caps lock 7 event = FL_KEYUP ... caps unlock 8 event = FL_KEYDOWN ... caps lock 9 event = FL_KEYUP ... caps lock 10 event = FL_KEYDOWN ... caps lock 11 event = FL_KEYUP ... caps unlock 12 You can see (or guess) that the CAPS LOCK state is updated *before* the handle message is called on FL_KEYDOWN events, if CAPS LOCK is being turned ON, but *after* the FL_KEYDOWN event, if it is turned OFF. That's why the program shows the caps unlock message only on FL_KEYDOWN events. Obviously it's a little difficult to get the state of these toggle keys in a platform independent way, and hence this doesn't seem to work well on my Linux VM: $ fltk-config --compile capslock.cxx ./capslock g++ -I/home/albrecht/svn/fltk-1.3 -I/home/albrecht/svn/fltk-1.3/png -I/home/albrecht/svn/fltk-1.3/zlib -I/home/albrecht/svn/fltk-1.3/jpeg -I/usr/include/freetype2 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_THREAD_SAFE -D_REENTRANT -o 'capslock' 'capslock.cxx' -static-libgcc -static-libstdc++ /home/albrecht/svn/fltk-1.3/lib/libfltk.a -lXext -lfontconfig -lXinerama -lpthread -ldl -lm -lX11 event = FL_FOCUS ... event = FL_KEYDOWN ... caps unlock 1 event = FL_KEYDOWN ... caps lock 2 event = FL_KEYUP ... caps lock 3 event = FL_KEYDOWN ... caps unlock 4 event = FL_KEYDOWN ... caps lock 5 event = FL_KEYDOWN ... caps lock 6 event = FL_KEYUP ... caps lock 7 event = FL_KEYDOWN ... caps lock 8 event = FL_KEYUP ... caps lock 9 event = FL_KEYDOWN ... caps unlock 10 event = FL_KEYUP ... caps lock 11 event = FL_KEYDOWN ... caps lock 12 event = FL_KEYUP ... caps lock 13 event = FL_KEYDOWN ... caps unlock 14 event = FL_KEYDOWN ... caps lock 15 event = FL_KEYUP ... caps lock 16 event = FL_KEYDOWN ... caps unlock 17 event = FL_KEYDOWN ... caps lock 18 event = FL_KEYDOWN ... caps lock 19 event = FL_KEYUP ... caps lock 20 event = FL_KEYDOWN ... caps lock 21 event = FL_KEYUP ... caps lock 22 event = FL_KEYDOWN ... caps unlock 23 event = FL_KEYUP ... caps lock 24
Re: [fltk.general] Caps Lock detection
Correction: On 06.04.2013 02:10, Albrecht Schlosser wrote: [... about compiling and running program #1] ... event = FL_KEYDOWN ... caps lock 9 event = FL_KEYUP ... caps lock 10 event = FL_KEYDOWN ... caps lock 11 event = FL_KEYUP ... caps unlock 12 You can see (or guess) that the CAPS LOCK state is updated *before* the handle message is called on FL_KEYDOWN events, if CAPS LOCK is being turned ON, but *after* the FL_KEYDOWN event, if it is turned OFF. That's why the program shows the caps unlock message only on FL_KEYDOWN events. The last line should read: FL_KEYUP events., of course. Albrecht ___ fltk mailing list fltk@easysw.com http://lists.easysw.com/mailman/listinfo/fltk
Re: [fltk.opengl] event_x() To Get FL_Gl_Window Coordinates
On 03.04.2013 22:54, Mike Werner wrote: I want to be able to left click in an OpenGL window and have the mouse coordinates in that window returned (i.e. relative to the upper left corner of the window). Seems like I should be able to do this using Fl::event_x. However it's turning out to be difficult. First of all the only way I can get event_x to return anything is to put it in the draw function of my Fl_Gl_Window with the syntax Fl::event_x(). But this doesn't return anything when I click in the OpenGL window. It ONLY returns coordinates when I click on a button outside the OGL window. And the X value returned is relative to main FLTK window. Not what I need. First of all: Fl::event_x() is only valid in the event handling code or in a callback called from this code. Putting Fl::event_x() in a draw() method can only give you _undefined_ values, i.e. it _can_ sometimes be what you expect. This is because Fl::event_x() uses a static variable that is updated only on some events like mouse clicks, but also on FL_MOVE and maybe others. I saw your follow-up: using a button underneath the OGL window might do what you need, since you get the button callback when the click event is handled. There is no way other than to do the coordinate translation yourself, since the OGL window has its own coordinate system, but the button coordinates are relative to the button's window(). Was hoping to be able to put event_x() in the draw function never put it in the draw() method, see above. or in the callback to Fl_Gl_Window and get OGL window relative coordinates. The only idea I have now is to put a large button underneath the OGL window. When I click inside the OGL window, this button will be activated and I'll get an x cord. relative to the main FLTK window and have to subtract off the upper left corner coordinates of the OGL window. Anyone have a more elegant solution? I'd try to put an invisible box or button in the OGL window that serves the same purpose as your button in the main window. The invisible box could be an own derived class, so that you can use the handle() method, but a simple callback would also do the job. However, event handling in GL Windows might differ from normal windows, so I don't know if this would work. Albrecht ___ fltk-opengl mailing list fltk-opengl@easysw.com http://lists.easysw.com/mailman/listinfo/fltk-opengl