This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <SDL/SDL.h> | |
#include <SDL/SDL_image.h> | |
#include <math.h> | |
int quit = 0; | |
/*int screen_width = 640, screen_height = 480, screen_bpp = 32;*/ | |
int screen_width = 1280, screen_height = 720, screen_bpp = 32; | |
int char_width = 8, char_height = 12; | |
int text_width = 80; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <strings.h> | |
/* | |
* Pearson hashing (from Wikipedia) | |
* | |
* Pearson hashing is a hash function designed for fast execution on processors with 8-bit registers. | |
* Given an input consisting of any number of bytes, it produces as output a single byte that is strongly | |
* dependent on every byte of the input. Its implementation requires only a few instructions, plus a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "udpnet.h" | |
#if defined WIN32 | |
typedef int socklen_t; | |
#else | |
#define closesocket(s) close(s) | |
#endif | |
static int udp_err_ = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Minimal SDL2 + OpenGL3 example. | |
Author: https://github.com/koute | |
This file is in the public domain; you can do whatever you want with it. | |
In case the concept of public domain doesn't exist in your jurisdiction | |
you can also use this code under the terms of Creative Commons CC0 license, | |
either version 1.0 or (at your option) any later version; for details see: | |
http://creativecommons.org/publicdomain/zero/1.0/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/******************************************************************************* | |
* | |
* A minimal Forth compiler in C | |
* By Leif Bruder <leifbruder@gmail.com> http://defineanswer42.wordpress.com | |
* Release 2014-04-04 | |
* | |
* Based on Richard W.M. Jones' excellent Jonesforth sources/tutorial | |
* | |
* PUBLIC DOMAIN | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "SDL.h" | |
#include <OpenGLES/ES2/gl.h> | |
#include <OpenGLES/ES2/glext.h> | |
#include <iostream> | |
#include <string> | |
#include <memory> | |
using namespace std; | |
GLuint programObject; | |
class Graphics |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
P-code for PL/0 machine | |
[ref] https://en.wikipedia.org/wiki/P-code_machine | |
[ref] http://blackmesatech.com/2011/12/pl0/pl0.xhtml | |
The PL/0 virtual machine was originally specified by Nicklaus Wirth in his book | |
Algorithms + Data Structures = Programs; it's used as the target machine for a | |
PL/0 compiler. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#define STB_IMAGE_WRITE_IMPLEMENTATION | |
#include "stb_image_write.h" | |
#include <ft2build.h> | |
#include FT_FREETYPE_H | |
#define NUM_GLYPHS 128 | |
struct glyph_info { | |
int x0, y0, x1, y1; // coords of glyph in the texture atlas |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var wasmCode = new Uint8Array([0,97,115,109,1,0,0,0,1,177,128,128,128,0,9,96,0,0,96,1,127,1,127,96,0,1,127,96,1,127,0,96,2,127,127,0,96,2,127,127,1,127,96,5,127,127,127,127,127,0,96,3,127,127,127,0,96,4,127,127,127,127,0,2,157,128,128,128,0,2,3,101,110,118,7,103,101,116,99,104,97,114,0,2,3,101,110,118,7,112,117,116,99,104,97,114,0,1,3,224,128,128,128,0,95,3,2,2,2,3,2,2,3,2,3,2,3,1,4,2,1,5,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,8,2,0,4,133,128,128,128,0,1,112,1,72,72,5,131,128,128,128,0,1,0,2,6,129,128,128,128,0,0,7,216,134,128,128,0,95,6,109,101,109,111,114,121,2,0,6,112,117,116,107,101,121,0,2,5,108,108,107,101,121,0,3,10,107,101,121,87,97,105,116,105,110,103,0,4,6,103,101,116,107,101,121,0,5,4,116,101,108,108,0,6,3,112,111,112,0,7,3,116,111,115,0,8,4,112,117,115,104,0,9,4,100,112,111,112,0,10,5,100,112,117,115,104,0,11,4,114,112,111,112,0,12,5,114,112,117,115,104,0,13,7,114,101,97,100,77,101,109,0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Written in 2017 by Tommy Ettinger (tommy.ettinger@gmail.com) | |
To the extent possible under law, the author has dedicated all copyright | |
and related and neighboring rights to this software to the public domain | |
worldwide. This software is distributed without any warranty. | |
See <http://creativecommons.org/publicdomain/zero/1.0/>. */ | |
#include <stdint.h> |
OlderNewer