Skip to content

Instantly share code, notes, and snippets.

View Themaister's full-sized avatar

Hans-Kristian Arntzen Themaister

View GitHub Profile
From 18eafaf6d1304cdb9fbc5335de9b19e544508e27 Mon Sep 17 00:00:00 2001
From: Themaister <[email protected]>
Date: Tue, 3 Jan 2012 17:55:53 -0800
Subject: [PATCH] Check for -framework SDL.
---
qb/config.libs.sh | 14 +++++++++++++-
1 files changed, 13 insertions(+), 1 deletions(-)
diff --git a/qb/config.libs.sh b/qb/config.libs.sh
#include <emmintrin.h>
#include <stdio.h>
int main(void)
{
// Attempt to divide by 0x8000. With integer math this is right shift by 15.
// IEEE floats are laid out like this:
// [1 - 8 - 23]
// [Sign bit - Exponent - Mantissa]
#include <emmintrin.h>
#include <stdio.h>
int main(void)
{
static float buf[] __attribute__((aligned(16))) = {0x4000, 0x3000, 0x2000, 0x1000};
printf("Before: %f, %f, %f, %f\n", buf[0], buf[1], buf[2], buf[3]);
__m128i reg = _mm_load_si128((__m128i*)buf);
#ifndef __SHIFTMUL_H
#define __SHIFTMUL_H
namespace Internal
{
template <unsigned a, unsigned x, unsigned y>
struct static_if
{
enum { value = x };
};
/*
* (Inaccurate) Phosphor shader
* Author: Themaister
* Licesese: Public Domain
*/
struct coords
{
float2 coord;
float2 coord_prev;
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<head>
<title>XML Shader (1.0) Viewer</title>
</head>
<style type="text/css">
body {
background: #eeeeee;
font-family: Verdana, serif;
<html>
<head>
<title>XML Shader (1.0) Viewer</title>
</head>
<body onload="webGLStart();">
<input type="button" onclick="do_resize(0.25)" value="Scale 0.25x"/>
<input type="button" onclick="do_resize(0.5)" value="Scale 0.5x"/>
<input type="button" onclick="do_resize(1)" value="Scale 1x"/>
<input type="button" onclick="do_resize(2)" value="Scale 2x"/>
<input type="button" onclick="do_resize(3)" value="Scale 3x"/>
function load_image(evt) {
if (!(window.File && window.FileReader && window.FileList && window.Blob)) {
alert("FileReader API not supported by this browser ...");
return;
}
var file = evt.target.files[0];
if (!file.type.match("image.*")) {
alert("This is not an image file! :(");
return;
<html>
<head>
<title>WebGL shader test ...</title>
</head>
<body onload="webGLStart();">
<p>Hai! :D WebGL shader test ...</p>
<canvas id="test_canvas" style="border: none" width="1024" height="896"></canvas>
</body>
#include <portaudio.h>
#include <stdio.h>
#include <rsound.h>
#include <assert.h>
#include <signal.h>
static volatile sig_atomic_t g_alive;
static void sighandler(int sig)
{
(void)sig;