Skip to content

Instantly share code, notes, and snippets.

View blogdron's full-sized avatar
👻

BLOGDRON blogdron

👻
View GitHub Profile
@Fingercomp
Fingercomp / table-pack.md
Last active January 10, 2024 10:13
О функции `table.pack` и операторе `#` на примере REPL

Lua — прекрасный язык программирования. Прежде всего благодаря своей предельной простоте. Но даже в Lua есть свои нюансы.

Допустим, мы хотим создать свой Lua REPL. REPL — Read–Eval–Print Loop — также называется оболочкой (shell) или интерпретатором (interpreter). Из аббриевиатуры должно быть понятно, что эта прога будет делать:

  1. читать ввод
  2. интерпретировать его
  3. принтить выхлоп

Программа и так несложно выглядит, а в Lua ещё есть функция load, о которой

#!/bin/sh
export WINEBIN=wine
export WINEDEBUG=-all
export WINEPREFIX=~/wineprefixes/sourcesdk/
export SDK2013DIR=/seagate/steamcmd/sdk2013mp
export VPROJECT=$SDK2013DIR/hl2/
IMPORTDIR=$(pwd)
#!/bin/sh
export WINEBIN=wine
export WINEDEBUG=-all
export WINEPREFIX=~/wineprefixes/sourcesdk/
export BASEDIR="/seagate/SteamLibrary/steamapps/common/SourceFilmmaker/game/"
export VPROJECT=$BASEDIR/usermod/
IMPORTDIR=$(pwd)
@icculus
icculus / sdl-gpu-pitch.md
Last active September 28, 2023 08:42
This is the Epic MegaGrant pitch I wrote for the SDL GPU API, in case anyone is interested.

Describe your project:

Simple Directmedia Layer (SDL) is the gold standard for low-level, cross-platform game development. It is an open source library that is used at the layer where one might use DirectX, so it's useful both for from-scratch development and for powering game engines. It provides abstractions for video, audio, input, and various system-provided functionality. In many cases, if you're building a cross-platform game, SDL is extremely good at helping you delete a large number of #ifdefs in your project...and entire directories full of code.

SDL is used in the Steam Client, is crucial to the Linux game development ecosystem, and has been used for various platforms in every generation of the Unreal Engine, idTech, Source Engine, etc.

A game written to use SDL might work with almost no code changes across all major desktop operating systems, mobile phones, web browsers, and even the Raspberry Pi. Nintendo shipped SDL in over 7.5 million NES and SNES Classic devices. There are SDL-based games