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
// stb_dxt.h - Real-Time DXT1/DXT5 compressor | |
// Based on original by fabian "ryg" giesen v1.04 | |
// Custom version, modified by Yann Collet | |
// | |
/* | |
BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php) | |
Redistribution and use in source and binary forms, with or without | |
modification, are permitted provided that the following conditions are | |
met: |
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
#!/bin/bash | |
# If we get interrupted, make sure to kill the whole process tree | |
trap 'trap - SIGTERM && kill 0' SIGINT SIGTERM | |
# Issue command to all devices in parallel | |
for DEVICE in `adb devices | awk '/\tdevice$/ { print $1 }'`; do | |
ANY_DEVICES=1 | |
# Look up pretty name from serial number |
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
/// zzz - very sleepy replacement, based on etw | |
#define INITGUID | |
#include <windows.h> | |
#include <psapi.h> | |
#include <tdh.h> | |
#include <evntrace.h> | |
#include <guiddef.h> | |
#pragma warning(disable: 4091) | |
#include <dbghelp.h> |
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
; input: 4x F16 in XMM0 (low words of each DWord) | |
; original idea+implementation by Dean Macri | |
; WARNING: copy & pasted together from other code, this ver is untested!! | |
; though the original version was definitely correct. | |
bits 32 | |
section .data |
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
max(-x,-y) = -min(x,y) | |
min(-x,-y) = -max(x,y) | |
abs(x) = abs(-x) | |
abs(x) = max(x,-x) = -min(x,-x) | |
abs(x*a) = if (a >= 0) abs(x)*a | |
(a < 0) -abs(x)*a | |
// basically any commutative operation | |
min(x,y) + max(x,y) = x + y |
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
struct vec3f {float x, y, z;}; | |
struct vec4f {float x, y, z, w;}; | |
struct mat44f {vec4f x, y, z, w;}; | |
//============================================================================ | |
// sphere_screen_extents | |
//============================================================================ | |
// Calculates the exact screen extents xyzw=[left, bottom, right, top] in | |
// normalized screen coordinates [-1, 1] for a sphere in view space. For | |
// performance, the projection matrix (v2p) is assumed to be setup so that |
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
static char* | |
sys_clip_get(struct sys *s, Atom selection, Atom target) | |
{ | |
assert(s); | |
struct sys_x11 *x11 = s->platform; | |
/* blocking wait for clipboard data */ | |
XEvent notify; | |
XConvertSelection(x11->dpy, selection, target, selection, x11->helper, CurrentTime); | |
while (!XCheckTypedWindowEvent(x11->dpy, x11->helper, SelectionNotify, ¬ify)) { |
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 <errno.h> | |
#include <sys/types.h> | |
#include <unistd.h> | |
#include <string.h> | |
#include <assert.h> | |
#include <sys/stat.h> | |
#include <fcntl.h> | |
#include <stdlib.h> | |
#include <sys/ioctl.h> |
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
/* =============================================================== | |
* SDEFL | |
* =============================================================== | |
* public domain - no warranty implied; use at your own risk | |
* References: | |
https://bitbucket.org/rmitton/tigr/src/be3832bee7fb2f274fe5823e38f8ec7fa94e0ce9/src/tigr_inflate.c?at=default&fileviewer=file-view-default | |
https://github.com/github/putty/blob/49fb598b0e78d09d6a2a42679ee0649df482090e/sshzlib.c | |
https://www.ietf.org/rfc/rfc1951.txt | |
*/ | |
#include <stdlib.h> |
OlderNewer