Skip to content

Instantly share code, notes, and snippets.

View ericoporto's full-sized avatar
🎮
making

Érico Porto ericoporto

🎮
making
View GitHub Profile

Introduction

Here are some rough notes on building Kirikiri SDL2 for iOS and Android.
Please note that these may or may not be incomplete. Improved documentation is being planned, but not started yet.

Startup Directory selection

For iOS, the startup directory will be searched in <app name>.app/Contents/Resources/.
For Android, the startup directory will be searched in the root of the assets directory embedded in the apk. For best performance, the file should be stored uncomompressed.

Startup folder candidates:

@pinebit
pinebit / How-To-Play-MIDI-WIN32.c
Last active September 8, 2023 06:34
Playing MIDI using raw WIN32 API
// Step 1. Open default MIDI-device or die
int rc = midiOutOpen(&midi_device, 0, 0, 0, CALLBACK_NULL);
if (rc != MMSYSERR_NOERROR) {
return FALSE;
}
// Step 2. Set instrument for a channel (0..15)
DWORD command = (0x000000C0 | CHANNEL) | (INSTRUMENT << 8);
midiOutShortMsg(midi_device, command);
@jtrefry
jtrefry / Win10-64bit-npm.md
Last active September 6, 2023 07:30
Configuring Windows 10 (64-bit) for npm and node-gyp
  • Install Git for Windows
  • Install Node
  • Install Python 2.7.3
  • Install Microsoft Visual Studio 2015 Community
  • Open the command prompt as Administrator, run the following commands, then close the command prompt (a new prompt is required before the new environment variables will be available)
    • npm install -g npm
      • (Upgrades to npm v3, which no longer nests dependencies indefinitely. No more "maximum path length exceeded" errors due to the 260 character path limit in Windows, or needing to delete node_modules with rimraf.)
    • setx PYTHON C:\Python27\python.exe /m
      • (May need to change path to your custom install directory.)
  • Open a new command prompt and run the following commands. If these install without errors, you have bypasse
@mustafaakin
mustafaakin / README.md
Last active May 31, 2023 05:28
Running Windows Server 2k16 with Docker under Linux, KVM or Virtualbox

Are you let down when you saw there is no guide to use Windows Server 2016 under *nix environments? I really loved Microsoft when I heard they are working on Windows containers, but when this week has arrived, it was sad to see that installation requirements were Windows and HyperV. But actually it is not. You just have to modify the VHD file a bit with nicer tools and execute the already available script in the downloaded VM. I will assume you are running a decent version of Linux and accepted EULA and all the legal stuff that I do not care.

1. Getting the required tools:

$ sudo apt-get install qemu-kvm virt-manager // or virtualbox, but we need qemu-kvm for image manipulation
$ sudo apt-get install qemu-utils libguestfs-tools // image manipulation tools

2. Downloading files

#!/bin/bash
PROJ="/path/to/your/project/"
NAME="MyAwesomeGame"
SVER="1.0.0"
GODOT="/Applications/Godot.app/Contents/MacOS/Godot --path ${PROJ}/src"
###
# Mac OSX (RELEASE)
@acturcato
acturcato / ACT_WEATHER.ino
Last active December 22, 2022 04:38
Web Client to consume Weather Underground web service (RESTful and JSON formats). This sketch connects to a website (http://api.wunderground.com) using an Arduino + Ethernet shield and get data from site. Circuit: * Arduino MEGA 2560 R3 Board. * Ethernet shield attached to pins 10, 11, 12, 13. Created 07 Jan 2014 by Afonso C. Turcato. Arduino ID…
/*
Web Client to consume Weather Underground web service
This sketch connects to a website (http://api.wunderground.com)
using an Arduino Ethernet shield and get data from site.
Circuit:
* Arduino MEGA 2560 R3 Board
* Ethernet shield attached to pins 10, 11, 12, 13
@Jiwan
Jiwan / main.cpp
Created October 29, 2015 12:09
C++98 SFINAE usage for serialization
#include <iostream>
struct A {};
std::string to_string(const A&)
{
return "I am a A!";
}
// Type B with a serialize method.
@sheenobu
sheenobu / main.lua
Created September 27, 2015 06:24
Love2D isometric rendering and picking
TileTable = {
{ 1, 1, 1, 1, 1, 1, 1 },
{ 1, 1, 1, 1, 1, 1, 1 },
{ 1, 1, 1, 1, 1, 1, 1 },
{ 2, 2, 2, 2, 2, 2, 2 },
{ 3, 3, 3, 3, 3, 3, 3 },
{ 4, 4, 4, 4, 4, 4, 4 },
{ 5, 5, 5, 5, 5, 5, 5 },
{ 5, 5, 5, 5, 5, 5, 5 },
{ 5, 5, 5, 5, 5, 5, 5 },
@tonyblundell
tonyblundell / ago.py
Created May 10, 2012 10:43
ago: Calculate a '3 hours ago' type string from a python datetime.
import datetime
def ago(t):
"""
Calculate a '3 hours ago' type string from a python datetime.
"""
units = {
'days': lambda diff: diff.days,
'hours': lambda diff: diff.seconds / 3600,
'minutes': lambda diff: diff.seconds % 3600 / 60,
@slime73
slime73 / sdl-metal-example.m
Last active September 9, 2021 10:53
SDL + Metal example
/**
* This software is in the public domain. Where that dedication is not recognized,
* you are granted a perpetual, irrevokable license to copy and modify this file
* as you see fit.
*
* Requires SDL 2.0.4.
* Devices that do not support Metal are not handled currently.
**/
#import <UIKit/UIKit.h>