@echo off

SETLOCAL

SET EMULATOR_BIN_PATH=%~dp0

rem set environment variables
SET SDL_STDIO_REDIRECT=0
SET GL_VERSION=2
SET VIGS_SYNC_READ_PIXELS=1

set WITH_GDB="no"
IF "%1"=="--with-gdb" (
	set WITH_GDB="yes"
	SHIFT
)

rem run emulator
IF %WITH_GDB%=="yes" (
	gdb --args "%EMULATOR_BIN_PATH%\emulator-x86" %*
) ELSE (
	"%EMULATOR_BIN_PATH%\emulator-x86" %*
)
