| 4394 |
ripley |
1 |
/*
|
|
|
2 |
* GraphApp - Cross-Platform Graphics Programming Library.
|
|
|
3 |
*
|
|
|
4 |
* File: graphappmain.c (original routines in init.c)
|
| 24283 |
ripley |
5 |
* Platform: Windows Version: 2.40
|
| 4394 |
ripley |
6 |
*
|
|
|
7 |
* Version: 1.00 Changes: Original version by Lachlan Patrick.
|
|
|
8 |
* Version: 1.60 Changes: drawarc/fillarc(r,0,360) now encloses.
|
|
|
9 |
* New fillellipse() function replaces Windows Ellipse().
|
|
|
10 |
* Version: 2.00 Changes: New class system implemented.
|
|
|
11 |
* Version: 2.02 Changes: Added support for functions like MoveToEx.
|
|
|
12 |
* Version: 2.15 Changes: Fixed brush origins problem.
|
|
|
13 |
* Version: 2.20 Changes: Moved some arrays from context.c to here.
|
|
|
14 |
* Version: 2.40 Changes: Moved drawimage to this file.
|
|
|
15 |
*/
|
|
|
16 |
|
|
|
17 |
/* Copyright (C) 1993-1998 Lachlan Patrick
|
|
|
18 |
|
|
|
19 |
This file is part of GraphApp, a cross-platform C graphics library.
|
|
|
20 |
|
|
|
21 |
GraphApp is free software; you can redistribute it and/or modify it
|
|
|
22 |
under the terms of the GNU Library General Public License.
|
|
|
23 |
GraphApp is distributed in the hope that it will be useful, but
|
|
|
24 |
WITHOUT ANY WARRANTY.
|
|
|
25 |
|
|
|
26 |
See the file COPYLIB.TXT for details.
|
|
|
27 |
*/
|
|
|
28 |
|
|
|
29 |
#include "internal.h"
|
|
|
30 |
|
|
|
31 |
extern void startgraphapp(HINSTANCE Instance, HINSTANCE PrevInstance, int CmdShow);
|
|
|
32 |
|
|
|
33 |
/*
|
|
|
34 |
* If PASS_ARGS is zero, the main function will be passed zero
|
|
|
35 |
* and NULL instead of argc and argv.
|
|
|
36 |
* If it is one, the argc and argv parameters will be passed.
|
|
|
37 |
* If it is two, the environ parameter will also be passed.
|
|
|
38 |
* We define the main function as returning void, so this
|
|
|
39 |
* method ignores any value returned from main.
|
|
|
40 |
*/
|
|
|
41 |
|
|
|
42 |
int PASCAL
|
| 24283 |
ripley |
43 |
WinMain (HINSTANCE Instance, HINSTANCE PrevInstance, LPSTR CmdLine,
|
| 4394 |
ripley |
44 |
int CmdShow)
|
|
|
45 |
{
|
| 6994 |
pd |
46 |
#if (PASS_ARGS > 1) /* define argc, argv, environ */
|
| 4394 |
ripley |
47 |
extern int _argc;
|
|
|
48 |
extern char **_argv;
|
|
|
49 |
extern char **environ;
|
|
|
50 |
extern void AppMain(int argc, char **argv, char **envp);
|
| 6994 |
pd |
51 |
#elif (PASS_ARGS > 0) /* only define argc and argv */
|
| 4394 |
ripley |
52 |
extern int _argc;
|
|
|
53 |
extern char **_argv;
|
|
|
54 |
extern void AppMain(int argc, char **argv);
|
| 6994 |
pd |
55 |
#else /* else pass zero and NULL to main */
|
| 4394 |
ripley |
56 |
extern void AppMain(int argc, char **argv);
|
| 6994 |
pd |
57 |
#endif /* end arg declarations */
|
| 4394 |
ripley |
58 |
|
|
|
59 |
startgraphapp(Instance, PrevInstance, CmdShow);
|
|
|
60 |
/*
|
|
|
61 |
* Call the main function now.
|
|
|
62 |
*/
|
| 6994 |
pd |
63 |
#if (PASS_ARGS > 1) /* pass argc, argv, environ */
|
| 4394 |
ripley |
64 |
AppMain(_argc, _argv, environ);
|
| 6994 |
pd |
65 |
#elif (PASS_ARGS > 0) /* only pass argc and argv */
|
| 4394 |
ripley |
66 |
AppMain(_argc, _argv);
|
| 6994 |
pd |
67 |
#else /* pass zero and NULL */
|
| 4394 |
ripley |
68 |
AppMain(0, NULL);
|
| 6994 |
pd |
69 |
#endif
|
| 4394 |
ripley |
70 |
|
|
|
71 |
/*
|
|
|
72 |
* Call the mainloop function to handle events.
|
|
|
73 |
*/
|
|
|
74 |
|
|
|
75 |
|
|
|
76 |
return 0;
|
|
|
77 |
}
|