Skip to content

Instantly share code, notes, and snippets.

@qwtel
qwtel / WebGLRenderingContext.js
Last active August 29, 2015 14:03
Outline and JSDoc of the WebGLRenderingContext. Based on the WebGL 1.0 API Quick Reference Card http://www.khronos.org/files/webgl/webgl-reference-card-1_0.pdf. Can be used for autocompletion in WebStorm / IntelliJ.
/**
* @constructor
*/
function WebGLRenderingContext() {
}
WebGLRenderingContext.prototype = {
ACTIVE_ATTRIBUTES: 35721,
ACTIVE_TEXTURE: 34016,
ACTIVE_UNIFORMS: 35718,
case class LoopState(i: Int = 0, acc: Double = 0.0, isCompleted: Boolean = false)
lazy val twoPowers = for (i <- 0 until 50) yield Math.pow(2.0, i)
val Epsilon: Double = 1e-17
val TaskSize = 2500000
def modPow16(exp: Double, m: Double): Double = {
if (exp < 1) Math.pow(16.0, exp)
@qwtel
qwtel / ashley.html
Last active December 18, 2015 17:49
A modified version of the Ashley Tumblr theme, including profile picture, Google Analytics, Disqus, support for adding gists via <div class="gist">https://gist.github.com/your/gist</div>, waterfall layout pages via masonry, adding icons of the MFG Labs icon set via <i class="icon-name"></i> and automatic code formatting and highlighting.
<!DOCTYPE html>
<!--
Theme: Ashley v0.4
Author: Jxnblk [http://jxnblk.com]
For: Tumblr [http://tumblr.com/]
Terms: Protected under Creative Commons.
-->
<html lang="en">
class BresenhamLineDrawer implements LineDrawer {
private PixelSetter buffer;
public BresenhamLineDrawer(PixelSetter buffer) {
this.buffer = buffer;
}
@Override
public void drawLine(int x1, int y1, int x2, int y2) {
int deltaX = Math.abs(x2 - x1);
int deltaY = Math.abs(y2 - y1);