summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>1999-05-24 14:03:47 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>1999-05-24 14:03:47 +0000
commit4b341bc95abca4f3827c249ade7fee1abba8b5d0 (patch)
treeabf3cb2e196cbe3fe6ba27b21846c74c2dca3f14
parentc95175061198908df8c54e2df3c3643d020fc40c (diff)
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
-rw-r--r--src/Fl.cxx8
-rw-r--r--src/Fl_win32.cxx10
-rw-r--r--src/fl_call_main.c8
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 $".
*/