From 4b341bc95abca4f3827c249ade7fee1abba8b5d0 Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Mon, 24 May 1999 14:03:47 +0000 Subject: Added Rick's hack for initializing fl_display. fl_call_main() and WinMain are now only compiled in for non-GNU compilers under WIN32 (not needed for Cygwin and friends). git-svn-id: file:///fltk/svn/fltk/branches/branch-1.0@593 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl.cxx | 8 ++++---- src/Fl_win32.cxx | 10 +++++----- src/fl_call_main.c | 8 ++++---- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/Fl.cxx b/src/Fl.cxx index c0e3086d5..bc2eba49d 100644 --- a/src/Fl.cxx +++ b/src/Fl.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl.cxx,v 1.24.2.7 1999/05/07 16:17:49 mike Exp $" +// "$Id: Fl.cxx,v 1.24.2.8 1999/05/24 14:03:45 mike Exp $" // // Main event handling code for the Fast Light Tool Kit (FLTK). // @@ -161,10 +161,10 @@ static double fl_elapsed() { #ifdef WIN32 - unsigned long newclock = fl_msg.time; // NOT YET IMPLEMENTED! + unsigned long newclock = GetTickCount(); const int TICKS_PER_SECOND = 1000; // divisor of the value to get seconds static unsigned long prevclock; - if (!initclock) {prevclock = newclock = GetTickCount(); initclock = 1; return 0.0;} + if (!initclock) {prevclock = newclock; initclock = 1; return 0.0;} else if (newclock < prevclock) return 0.0; double t = double(newclock-prevclock)/TICKS_PER_SECOND; @@ -698,5 +698,5 @@ int fl_old_shortcut(const char* s) { } // -// End of "$Id: Fl.cxx,v 1.24.2.7 1999/05/07 16:17:49 mike Exp $". +// End of "$Id: Fl.cxx,v 1.24.2.8 1999/05/24 14:03:45 mike Exp $". // diff --git a/src/Fl_win32.cxx b/src/Fl_win32.cxx index 1f098bdeb..678ab196b 100644 --- a/src/Fl_win32.cxx +++ b/src/Fl_win32.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_win32.cxx,v 1.33.2.10 1999/05/11 09:39:30 bill Exp $" +// "$Id: Fl_win32.cxx,v 1.33.2.11 1999/05/24 14:03:46 mike Exp $" // // WIN32-specific code for the Fast Light Tool Kit (FLTK). // @@ -772,7 +772,7 @@ Fl_X* Fl_X::make(Fl_Window* w) { //////////////////////////////////////////////////////////////// -HINSTANCE fl_display = 0; +HINSTANCE fl_display = GetModuleHandle(NULL); // // This WinMain() function can be overridden by an application and @@ -794,7 +794,7 @@ HINSTANCE fl_display = 0; // Microsoft(r) Windows(r) that allows for it. // -#ifndef FL_DLL +#if !defined(FL_DLL) && !defined(__GNUC__) extern "C" int fl_call_main(); @@ -822,7 +822,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, return fl_call_main(); } -#endif /* !FL_DLL */ +#endif /* !FL_DLL && !__GNUC__ */ //////////////////////////////////////////////////////////////// @@ -940,5 +940,5 @@ void Fl_Window::make_current() { } // -// End of "$Id: Fl_win32.cxx,v 1.33.2.10 1999/05/11 09:39:30 bill Exp $". +// End of "$Id: Fl_win32.cxx,v 1.33.2.11 1999/05/24 14:03:46 mike Exp $". // diff --git a/src/fl_call_main.c b/src/fl_call_main.c index ee4c8c73d..0089f1061 100644 --- a/src/fl_call_main.c +++ b/src/fl_call_main.c @@ -1,5 +1,5 @@ /* - * "$Id: fl_call_main.c,v 1.1.2.1 1999/03/29 17:39:29 carl Exp $" + * "$Id: fl_call_main.c,v 1.1.2.2 1999/05/24 14:03:47 mike Exp $" * * Copyright 1998-1999 by Bill Spitzak and others. * @@ -24,7 +24,7 @@ * Please report all bugs and problems to "fltk-bugs@easysw.com". */ -#if defined(WIN32) && !defined(FL_DLL) +#if defined(WIN32) && !defined(FL_DLL) && !defined(__GNUC__) extern int main(int, char *[]); extern int __argc; extern char **__argv; @@ -32,9 +32,9 @@ extern char **__argv; int fl_call_main() { return main(__argc, __argv); } -#endif +#endif /* WIN32 && !FL_DLL && !__GNUC__ */ /* - * End of "$Id: fl_call_main.c,v 1.1.2.1 1999/03/29 17:39:29 carl Exp $". + * End of "$Id: fl_call_main.c,v 1.1.2.2 1999/05/24 14:03:47 mike Exp $". */ -- cgit v1.2.3