Home

Awesome

<div align="center"> <h1>GM Sysinfo</h1> <p> Cross-platform GameMaker extension for getting system information and resource usage </p> <div align="center"> <img src="https://img.shields.io/github/actions/workflow/status/SpikeHD/gm-sysinfo/build.yml" /> <img src="https://img.shields.io/github/actions/workflow/status/SpikeHD/gm-sysinfo/test.yml?label=tests" /> <img src="https://img.shields.io/github/repo-size/SpikeHD/gm-sysinfo" /> <img src="https://img.shields.io/github/commit-activity/m/SpikeHD/gm-sysinfo" /> </div> <img width="70%" src="https://github.com/SpikeHD/gm-sysinfo/assets/25207995/0d003ce6-447a-410f-8d7f-84b21a702d0b" /> </div>

Table of Contents

Examples

Below are some basic examples of the functionality in this extension

Display memory usage

// Init
sysinfo_init();

// Get max memory of the system
var max_mem = sysinfo_get_memory_max();

// Get the memory usage of the game
var mem = sysinfo_proc_mem_usage();

// Display the cur / max (pct%)
var max_mb = max_mem / 1024 / 1024;
var mem_mb = mem / 1024 / 1024;

draw_text(0, 0, string(mem_mb) + " / " + string(max_mb) + " (" + string(mem / max_mem * 100) + "%)");

Display CPU usage

// Init
sysinfo_init();

// Get the CPU and memory usage of the game
var cpu_name = sysinfo_get_cpu_brand();
var cpu = sysinfo_get_cpu_usage();

// Display the %
draw_text(0, 0, cpu_name + ": " + string(cpu) + "%");

Get the host/username

// Init
sysinfo_init();

// Get the host name
var host = sysinfo_get_hostname();
var user = sysinfo_get_username();

// Display the host name
draw_text(0, 0, user + "@" + host);

Require only the most top-end of GPUs

// Init
sysinfo_init();

// Get the GPU name
let gpu = sysinfo_get_gpu_name();

if (string_pos("RTX", gpu) == 0) {
  show_message_async("Sorry, but your GPU sucks :/");
  exit;
}

TODO

Documentation

General

sysinfo_init()

Initializes the extension. This must be called before any other functions are called.

sysinfo_get_username()

Returns the username of the current user.

sysinfo_get_hostname()

Returns the hostname of the system.

sysinfo_get_pid()

Returns the PID of the game.

CPU

sysinfo_get_cpu_usage()

Returns the current CPU usage of the game in percent.

sysinfo_get_cpu_brand()

Returns the brand name of the CPU.

sysinfo_get_cpu_cores()

Returns the number of cores the CPU has.

sysinfo_get_cpu_frequency()

Returns the frequency of the CPU in MHz.

sysinfo_sys_cpu_usage()

Returns the CPU usage of the system in percent.

sysinfo_proc_cpu_usage()

Returns the CPU usage of the game in percent.

sysinfo_get_core_count()

Returns the number of cores the CPU has.

sysinfo_get_cpu_vendor_id()

Returns the vendor ID of the CPU.

GPU

sysinfo_get_gpu_name()

Returns the name of the GPU.

sysinfo_get_gpu_vram()

Returns the amount of VRAM the GPU has in bytes.

Memory

sysinfo_get_memory_max()

Returns the maximum memory of the system in bytes.

sysinfo_sys_memory_used()

Returns the memory used by the system in bytes.

sysinfo_proc_memory_used()

Returns the memory used by the game in bytes.