I hereby claim:
- I am gcatlin on github.
- I am gcatlin (https://keybase.io/gcatlin) on keybase.
- I have a public key ASDOkhxPwBV28ND_Pzm3rzNcVWViUFUakYvCgFb8dC-kiQo
To claim this, I am signing this object:
| package main | |
| /* | |
| #include <stdint.h> | |
| #include <stdlib.h> | |
| typedef struct { | |
| void **ptr; | |
| uintptr_t *handle; | |
| uintptr_t size; |
I hereby claim:
To claim this, I am signing this object:
| // | |
| // cc glfw-opengl-example.c glad.c -lglfw | |
| // | |
| #include "glad.h" // https://glad.dav1d.de/ | |
| #include <GLFW/glfw3.h> | |
| static void quit(GLFWwindow *window, int key, int scancode, int action, int mods) | |
| { | |
| if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS) { | |
| glfwSetWindowShouldClose(window, GLFW_TRUE); |
| // | |
| // cc main.c glad.c -lSDL2 | |
| // | |
| #include "glad.h" // https://glad.dav1d.de/ | |
| #include <SDL2/SDL.h> | |
| #include <SDL2/SDL_opengl.h> | |
| #include <stdbool.h> | |
| int main() | |
| { |
| // | |
| // cc glfw-metal-example.m `pkg-config --cflags --libs glfw3` -framework AppKit -framework Metal -framework QuartzCore | |
| // | |
| #define GLFW_INCLUDE_NONE | |
| #define GLFW_EXPOSE_NATIVE_COCOA | |
| #include <GLFW/glfw3.h> | |
| #include <GLFW/glfw3native.h> | |
| #import <Metal/Metal.h> | |
| #import <QuartzCore/CAMetalLayer.h> |
| // | |
| // cc sdl-metal-example.m `sdl2-config --cflags --libs` -framework Metal -framework QuartzCore && ./a.out | |
| // | |
| #include <SDL.h> | |
| #import <Metal/Metal.h> | |
| #import <QuartzCore/CAMetalLayer.h> | |
| int main (int argc, char *args[]) | |
| { | |
| SDL_SetHint(SDL_HINT_RENDER_DRIVER, "metal"); |
| // To run: | |
| // clang core-audio-sine-wave.c -framework AudioUnit && ./a.out | |
| #include <AudioUnit/AudioUnit.h> | |
| #define SAMPLE_RATE 48000 | |
| #define TONE_FREQUENCY 440 | |
| #define M_TAU 2.0 * M_PI | |
| OSStatus RenderSineWave( | |
| void *inRefCon, |
| #!/bin/sh | |
| go build -buildmode=c-shared lib.go | |
| clang main.m -g -Wall -Werror -Wfatal-errors -pedantic -Wno-c11-extensions -Wno-unused-variable -Wno-unused-function -o main.out |
| package main | |
| import ( | |
| "runtime" | |
| "github.com/go-gl/gl" | |
| "github.com/veandco/go-sdl2/sdl" | |
| ) | |
| func main() { |
| <?php | |
| function append_error_handler($handler) { | |
| set_error_handlers(array(set_error_handler($handler), $handler)); | |
| } | |
| function prepend_error_handler($handler) { | |
| set_error_handlers(array($handler, set_error_handler($handler))); | |
| } |