RetroArch/frontend/drivers/platform_emscripten.c

48 lines
1.4 KiB
C
Raw Normal View History

/* RetroArch - A frontend for libretro.
2014-01-01 01:50:59 +01:00
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
2015-01-07 17:46:50 +01:00
* Copyright (C) 2011-2015 - Daniel De Matteis
* Copyright (C) 2012-2015 - Michael Lelli
*
* RetroArch is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with RetroArch.
* If not, see <http://www.gnu.org/licenses/>.
*/
#include <emscripten/emscripten.h>
#include "../../general.h"
2014-10-23 03:54:18 +02:00
#include <file/config_file.h>
#include "../../content.h"
2015-04-14 22:01:41 +02:00
#include "../frontend.h"
2015-04-07 22:21:08 +02:00
#include "../frontend_driver.h"
#include "../runloop_data.h"
static void emscripten_mainloop(void)
{
int ret = rarch_main_iterate();
rarch_main_data_iterate();
if (ret != -1)
2015-01-11 06:57:35 +01:00
return;
main_exit(NULL);
exit(0);
}
2014-06-18 20:31:41 -04:00
int main(int argc, char *argv[])
{
2015-03-20 22:22:06 +01:00
settings_t *settings = config_get_ptr();
emscripten_set_canvas_size(800, 600);
2015-04-20 21:31:25 +02:00
rarch_main(argc, argv, NULL);
2014-09-02 17:42:44 +02:00
emscripten_set_main_loop(emscripten_mainloop,
2015-03-20 22:22:06 +01:00
settings->video.vsync ? 0 : INT_MAX, 1);
return 0;
}