GameMaker: Windows-specific functions for Studio

While working on one of recent projects, I've stumbled upon few common issues that many meet - even if you are only targeting Windows in GameMaker: Studio, you cannot access files outside the game's AppData directory (not even in program directory). Neither you can order system to open a file, meaning no external "readmes" to be easily hooked up with game, nor portable configuration files, and some other limitations.
So I took an evening and made a simplistic DLL library to bring equivalents to some functions (sleep, execute_shell, non-sandboxed I/O) back for Windows target. Function list is as following:

Continue reading

CPP – sleep() function via time.h

As you may know, there are multiple ways to create a sleep\delay function in C++.
These may appeal more or less to you depending on system and libraries available.
The following short function uses functionality of time.h header, which makes it useful for cases when dos.h is missing and you do not want to include windows.h just for a single function.

void sleep(int ms) {
	clock_t target = clock() + ms;
	while (clock() < target) { }