Skip to content

Instantly share code, notes, and snippets.

View erfg12's full-sized avatar
🏠
Working from home

Jacob Fliss erfg12

🏠
Working from home
View GitHub Profile
@erfg12
erfg12 / main.cpp
Created May 11, 2023 16:39
[Episode 9] [Code] First OpenGL Triangle - Modern OpenGL - Mike Shah
#include <SDL.h>
#include <glad/glad.h>
#include <iostream>
#include <vector>
int gScreenWidth = 640;
int gScreenHeight = 480;
int quit = 0;
@erfg12
erfg12 / readme.md
Created May 9, 2023 03:06
Build and Debug C app in Windows

pre-req:

  • install VS
  • add VS's "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\bin\Hostx64\x64" to system environment Path var

to build:

  • type "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars32"
  • type "cl -Zi test.c user32.lib gdi32.lib"

to debug:

  • type "/devenv /debugexe ./test.exe"

For Ubuntu (WSL)

Setup your system environment variables:

rm ~/.profile
echo >>~/.profile "export PS2DEV=$HOME/ps2dev"
echo >>~/.profile "export PS2SDK=\$PS2DEV/ps2sdk"
echo >>~/.profile "export GSKIT=\$PS2DEV/gsKit"
echo >>~/.profile "export PATH=\$PATH:\$PROGRAMFILES/Git/bin"
echo &gt;&gt;~/.profile "export PATH=\$PATH:\$PROGRAMFILES/Mercurial"

Follow kos-setup-easy.md first.

sudo apt install unrar
git clone https://github.com/ianmicheal/SDL-dreamhal--GLDC.git
cp "SDL-dreamhal--GLDC-main/Precompiled libs/*.a" "/opt/toolchains/dc/kos/addons/lib/dreamcast/"
unrar x "SDL-dreamhal--GLDC-main/Precompiled libs/include.rar" "/opt/toolchains/dc/kos/addons/include/"

On Linux (Ubuntu) (WSL for Windows)

sudo mkdir /opt/toolchains/dc
sudo chown -R YOUR_USERNAME_HERE /opt/toolchains/dc
sudo chmod -R ugo+rwx /opt/toolchains/dc
git clone git://git.code.sf.net/p/cadcdev/kallistios /opt/toolchains/dc/kos
cd /opt/toolchains/dc/kos/utils/dc-chain
sh download.sh
sh unpack.sh
make
@erfg12
erfg12 / client.html
Last active July 6, 2022 20:45
RSS --> JS (CORS bypass)
<body>
<!-- host this on GitHub.com pages for free -->
<div id="DisplayData"></div>
<script>
fetch('https://cnet-rss-cors.herokuapp.com/')
.then(response => response.text())
.then(data => {
parser = new DOMParser();
xmlDoc = parser.parseFromString(data, "text/xml");
@erfg12
erfg12 / Makefile
Created April 6, 2022 20:27
Programming Games in C/C++ on DOS
obj = main.obj
bin = main.exe
CC = wcc
CFLAGS = -zq
LD = wlink
$(bin): $(obj)
$(LD) name $@ file { $(obj) }
@erfg12
erfg12 / Retro_Console_Streaming.md
Last active January 7, 2022 07:12
Old Console Streaming

Stream Original Xbox

REQUIRED HARDWARE:

INSTRUCTIONS:

  1. Plug the OGX360 into your Xbox controller slot, plug in a USB cable from your game console into the Titan Two's Output port. The Program port's USB cable should plug into your PC.
  2. Plug in your Xbox video to the HDMI input hardware.
@erfg12
erfg12 / plotPDF.scr
Last active August 24, 2021 14:55
AutoCAD script file to convert DXF or DWG files to PDF. Run with accoreconsole.exe in AutoCAD directory. Works with AutoCAD LT.
; C:\Program Files\Autodesk\AutoCAD LT 2021\accoreconsole.exe /i "FILE_PATH_HERE\test.dwg" /s "FILE_PATH_HERE\plotPDF.scr"
; This example script file expects there to be a `Layout1` layout for each file.
_PLOT
_Y
Layout1
DWG To PDF.pc3
ANSI full bleed A (8.50 x 11.00 Inches)
_Inches
_Landscape
_No
@erfg12
erfg12 / makefile
Created August 16, 2021 18:08
C GCC makefile
# [Windows] Install MinGW (https://sourceforge.net/projects/mingw), add C:\MinGW\bin to Environment Variables PATH. Run command mingw32-make
# [MacOS] https://discussions.apple.com/thread/5250041
# [Ubuntu] "sudo apt install build-essential"
EXECUTABLE = main
CC = "gcc"
LDFLAGS = -lgdi32
src = $(wildcard *.c)