/** SGX

The   sss    gggg x   x   
     s      g      x x    Engine
      sss   g  gg   x
         s  g   g  x x          Copyright 1995-2009.
     ssss    gggg x   x         Steven Goodwin. All Rights Reserved.
    
This version has been released under the GNU Public License v2.0.

Please see the license files for details.

File: sgx/src/drivers/wintel32/core/system/systemwintel32.cpp

*/

#include "sgx/core/core.hpp"
#include "drivers/wintel32/device.hpp"

void sgxSleep(const tREAL32 t)
{
    // WinTel version of 'Sleep' is in milliseonds
    Sleep(DWORD(t * 1000.0f));
}

void sgxYield()
{
    Yield();
}

void sgxYieldWait(const tREAL32 t)
{
    Yield();
    sgxSleep(t);
}

tINT32 sgxSystemExecute(const sgxExecuteProperties &props, const tBOOL blocking)
{
	sgxString s= props.m_Command + " ";
	s += props.m_Arguments;
	if (blocking) {
		return system(s.c_str());	// switched to blocking, but requires full path (which you should use anway)
	}
	return WinExec(s.c_str(), SW_HIDE);		// to determine success of the return call : if > 31 ? TRUE : FALSE;
}

tBOOL sgxGetEnvironment(sgxString &value, const sgxString &env_var)
{
	value = "";
	return FALSE;
}
