summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c29
1 files changed, 17 insertions, 12 deletions
diff --git a/src/main.c b/src/main.c
index 464176e6..de9132ab 100644
--- a/src/main.c
+++ b/src/main.c
@@ -20,25 +20,25 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
20(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 20(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
21SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ 21SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
22 22
23#include <the_Foundation/commandline.h>
24#include <stdio.h>
25#if defined (iPlatformMsys)
26# define SDL_MAIN_HANDLED
27#endif
28#include <SDL.h>
29
30#include "app.h" 23#include "app.h"
31 24
32#if defined (iPlatformApple) 25#if defined (iPlatformApple)
33extern void enableMomentumScroll_MacOS(void); 26# include "macos.h"
34extern void registerURLHandler_MacOS(void);
35#endif 27#endif
36
37#if defined (iPlatformMsys) 28#if defined (iPlatformMsys)
38# include "win32.h" 29# include "win32.h"
30# define SDL_MAIN_HANDLED
39#endif 31#endif
32#if defined (LAGRANGE_ENABLE_MPG123)
33# include <mpg123.h>
34#endif
35
36#include <the_Foundation/commandline.h>
37#include <SDL.h>
38#include <stdio.h>
40 39
41int main(int argc, char **argv) { 40int main(int argc, char **argv) {
41 printf("Lagrange: A Beautiful Gemini Client\n");
42#if defined (iPlatformApple) 42#if defined (iPlatformApple)
43 enableMomentumScroll_MacOS(); 43 enableMomentumScroll_MacOS();
44 registerURLHandler_MacOS(); 44 registerURLHandler_MacOS();
@@ -48,9 +48,11 @@ int main(int argc, char **argv) {
48 setDPIAware_Win32(); 48 setDPIAware_Win32();
49 SDL_SetMainReady(); 49 SDL_SetMainReady();
50#endif 50#endif
51 /* Initialize libraries. */
52#if defined (LAGRANGE_ENABLE_MPG123)
53 mpg123_init();
54#endif
51 init_Foundation(); 55 init_Foundation();
52 printf("Lagrange: A Beautiful Gemini Client\n");
53 /* Initialize SDL. */
54 SDL_SetHint(SDL_HINT_VIDEO_ALLOW_SCREENSAVER, "1"); 56 SDL_SetHint(SDL_HINT_VIDEO_ALLOW_SCREENSAVER, "1");
55 if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_TIMER)) { 57 if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_TIMER)) {
56 fprintf(stderr, "SDL init failed: %s\n", SDL_GetError()); 58 fprintf(stderr, "SDL init failed: %s\n", SDL_GetError());
@@ -58,5 +60,8 @@ int main(int argc, char **argv) {
58 } 60 }
59 run_App(argc, argv); 61 run_App(argc, argv);
60 SDL_Quit(); 62 SDL_Quit();
63#if defined (LAGRANGE_ENABLE_MPG123)
64 mpg123_exit();
65#endif
61 return 0; 66 return 0;
62} 67}