power.experiments.aligntest

module power.experiments.aligntest;


enum vertexShader120;
enum fragmentShader120;

class AlignTest : scene.Simple
{
public:
	x: i32;
	y: i32;
	lookX: i32;
	lookY: i32;
	offsetX: i32;
	offsetY: i32;
	buf: gfx.DrawBuffer;
	testShader: gfx.Shader;


public:
	this(g: scene.Manager) { }
	fn close() { }
	fn mouseMove(m: ctl.Mouse, i32, i32) { }
	fn mouseDown(m: ctl.Mouse, button: i32) { }
	fn mouseUp(m: ctl.Mouse, button: i32) { }
	fn keyDown(ctl.Keyboard, keycode: i32) { }
	fn render(t: gfx.Target, viewInfo: gfx.ViewInfo) { }
	fn drawLevel(level: i32) { }
}

fn calcAlign(pos: i32, level: i32) i32 { }
fn getColor(c: u32) math.Color4b { }

power.experiments.viewer

module power.experiments.viewer;


//! Helper class if you want to draw a module and some text.
class Viewer : scene.Simple
{
public:
	aa: gfx.AA;
	isDragging: bool;
	camPosition: math.Point3f;
	camRotation: math.Quatf;
	cullPosition: math.Point3f;
	cullRotation: math.Quatf;
	//! Text rendering stuff.
	textVbo: gfx.DrawBuffer;
	textBuilder: gfx.DrawVertexBuilder;
	textState: gfx.BitmapState;


public:
	this(m: scene.Manager) { }
	fn renderScene(t: gfx.Target, viewInfo: gfx.ViewInfo) { }
	fn updateText(text: string) { }
	fn printInfo() { }
	fn close() { }
	fn logic() { }
	fn render(t: gfx.Target, viewInfo: gfx.ViewInfo) { }
	fn dropControl() { }
	fn keyDown(ctl.Keyboard, keycode: i32) { }
	fn keyUp(ctl.Keyboard, keycode: i32) { }
	fn mouseMove(m: ctl.Mouse, x: i32, y: i32) { }
	fn mouseDown(m: ctl.Mouse, button: i32) { }
	fn mouseUp(m: ctl.Mouse, button: i32) { }


protected:
	mTimeText: gfx.TimeTracker;
	mLockCull: bool;
	mCamHeading: f32;
	mCamPitch: f32;
	distance: f32;
	mCamUp: bool;
	mCamFore: bool;
	mCamBack: bool;
	mCamLeft: bool;
	mCamRight: bool;
}

power.experiments.svo

module power.experiments.svo;


class SvoLoader : tui.WindowScene
{
public:
	enum NumLevels;


public:
	app: App;


public:
	this(app: App, filename: string, useTest: bool) { }
	fn render(t: gfx.Target, viewInfo: gfx.ViewInfo) { }
	fn logic() { }
	fn loadFile(filename: string, c: svo.Create, frames: u32[], data: void[]) bool { }
	fn loadMagica(fileData: void[], c: svo.Create, frames: u32[], data: void[]) bool { }
	fn loadChalmers(fileData: void[], c: svo.Create, frames: u32[], data: void[]) bool { }
	fn doGen(arg: string, c: svo.Create, frames: u32[], data: void[]) bool { }
	fn genOne(c: svo.Create, frames: u32[], data: void[]) bool { }
	fn genFlatY(c: svo.Create, frames: u32[], data: void[]) bool { }
	fn doError(str: string) { }


protected:
	mFilename: string;
	mHasRendered: bool;
	mUseTest: bool;
}

class ErrrorMessageScene : tui.MessageScene
{
public:
	app: App;


public:
	this(app: App, str: string) { }
	fn pressedOk(button: tui.Button) { }
}

class SvoViewer : Viewer
{
public:
	data: svo.Data;
	obj: svo.Entity;
	animate: bool;
	pipes: old.Pipeline[];
	pipeId: u32;


public:
	this(m: scene.Manager, data: svo.Data, obj: svo.Entity) { }
	fn switchRenderer() { }
	fn resetPosition(pos: i32) { }
	fn close() { }
	fn keyDown(device: ctl.Keyboard, keycode: i32) { }
	fn logic() { }


protected:
	mTimeClear: gfx.TimeTracker;


protected:
	fn checkQuery(t: gfx.Target) { }
}

class NewSvoViewer : SvoViewer
{
public:
	objs: svo.Entity[];


public:
	this(m: scene.Manager, data: svo.Data, obj: svo.Entity) { }
	fn renderScene(t: gfx.Target, viewInfo: gfx.ViewInfo) { }
}

class OldSvoViewer : SvoViewer
{
public:
	this(m: scene.Manager, data: svo.Data, obj: svo.Entity) { }
	fn renderScene(t: gfx.Target, viewInfo: gfx.ViewInfo) { }
}

power.game

module power.game;


class Game : App
{
public:
	this(args: string[]) { }
	fn showMenu() { }
	fn showVoxelScene() { }
	fn showVoxelCompare() { }
	fn showAlignTest() { }
	//! Absolute minimum required.
	fn checkVersion() { }
}

power.menu

module power.menu;


class Menu : tui.MenuScene
{
public:
	app: App;


public:
	this(app: App) { }
	fn pressedClose(button: tui.Button) { }
	fn pressedQuit(button: tui.Button) { }
	fn pressedAlignTest(button: tui.Button) { }
	fn pressedVoxelScene(button: tui.Button) { }
	fn pressedVoxelCompare(button: tui.Button) { }
}

power.voxel.boxel

module power.voxel.boxel;


//! VBO used for boxed base voxels.
class BoxelBuffer : gfx.Buffer
{
public:
	num: GLsizei;


public:
	fn update(vb: BoxelBuilder) { }


public:
	static fn make(name: string, vb: BoxelBuilder) BoxelBuffer { }
}

class BoxelBuilder : gfx.Builder
{
public:
	alias add = gfx.Builder.add;


public:
	this(num: size_t) { }
	fn reset(num: size_t) { }
	fn addCube(x: f32, y: f32, z: f32, color: math.Color4b) { }
	fn add(vert: Vertex*, num: size_t) { }
	fn bake(vao: GLuint, buf: GLuint, num: GLsizei) { }
}

struct Vertex
{
public:
	x: f32;
	y: f32;
	z: f32;
	color: math.Color4b;


public:
	fn opCall(x: f32, y: f32, z: f32, color: math.Color4b) Vertex { }
}

power.voxel.magica

//! Code for loading magicavoxel files.
module power.voxel.magica;


fn loadFile(filename: string) BoxelBuffer { }

power.inbuilt

module power.inbuilt;


fn makeInbuiltTilePng() sys.File { }

power.app

module power.app;


class App : scene.ManagerApp
{
public:
	this(opts: core.Options) { }
	fn showMenu();
	fn showAlignTest();
	fn showVoxelScene();
	fn showVoxelCompare();
}

examples.gl

module examples.gl;


class Game : scene.ManagerApp
{
public:
	this(args: string[]) { }
}

class Scene : scene.Simple
{
public:
	input: ctl.Input;
	tex: gfx.Texture;
	buf: gfx.DrawBuffer;
	width: u32;
	height: u32;


public:
	this(g: Game, width: u32, height: u32) { }
	fn checkVersion() { }
	fn initBuffers() { }
	fn close() { }
	fn render(t: gfx.Target, viewInfo: gfx.ViewInfo) { }
	fn keyDown(ctl.Keyboard, i32) { }
}

voxel.svo.steps

module voxel.svo.steps;


class Step
{
public:
	baseIndex: u32;
	counterIndex: u32;
	finalLevel: u32;


public:
	this() { }
	fn run(state: StepState);
}

class DummyStep : Step
{
public:
	this(baseIndex: u32, counterIndex: u32, finalLevel: u32) { }
	fn run(state: StepState) { }
}

class InitStep : Step
{
public:
	this(baseIndex: u32, counterIndex: u32) { }
	fn run(state: StepState) { }
}

class BaseWalkStep : Step
{
public:
	src: Step;
	shader: gfx.Shader;
	timeTracker: gfx.TimeTracker;


public:
	this() { }
	fn run(state: StepState) { }
}

class FrustumStep : BaseWalkStep
{
public:
	this(store: ShaderStore, src: Step, baseIndex: u32, counterIndex: u32, powerLevels: u32) { }
}

class SplitStep : BaseWalkStep
{
public:
	this(store: ShaderStore, src: Step, baseIndex: u32, counterIndex: u32, splitIndex: u32) { }
}

class SortToDoubleToPointStep : BaseWalkStep
{
public:
	doubleTime: gfx.TimeTracker;
	doubleShader: gfx.Shader;
	pointsTime: gfx.TimeTracker;
	pointsShader: gfx.Shader;


public:
	this(store: ShaderStore, src: Step, baseIndex: u32) { }
	fn run(state: StepState) { }
}

class SortToDoubleToCubeStep : BaseWalkStep
{
public:
	doubleTime: gfx.TimeTracker;
	doubleShader: gfx.Shader;
	dispatchShader: gfx.Shader;
	cubesTime: gfx.TimeTracker;
	cubesShader: gfx.Shader;


public:
	this(store: ShaderStore, src: Step, baseIndex: u32) { }
	fn run(state: StepState) { }
}

//! Helper class to make shaders.
struct ResourceTracker
{
public:
	store: ShaderStore;
	baseIndex: u32;
	counterIndex: u32;
	steps: Step[];


public:
	fn addInit(s: Step) { }
	fn addFrustum(s: Step, src: Step, powerLevels: u32) { }
	fn addSplit(s: Step, o: Step, src: Step, splitIndex: u32) { }
	fn addSortToDoubleToPoint(src: Step) { }
	fn addSortToDoubleToCube(src: Step) { }
	fn makeDummy(s: Step, finalLevel: u32) { }
}

//! The state that is passed to each step when we are running the
//! pipeline.
struct StepState
{
public:
	enum VoxelBufferStepSize;
	enum CountersBufferBinding;
	enum DataBufferBinding;
	enum VoxelBufferBinding;
	enum SortBufferBinding;
	enum DoubleBufferBinding;
	enum DrawIndirectBinding;


public:
	voxelBuffer: GLuint;
	sortBuffer: GLuint;
	doubleBuffer: GLuint;
	dataBuffer: GLuint;
	atomicBuffer: GLuint;
	countersBuffer: GLuint;
	drawIndirectBuffer: GLuint;
	computeIndirectBuffer: GLuint;
}

voxel.svo.packer

//! Code for packing voxels into a oct-tree.
module voxel.svo.packer;


//! Packer to randomly add voxels to and then compact into a input buffer.
struct Packer
{
public:
	enum ArrNum;
	enum ArrMask;
	enum ArrLevels;
	enum ColorLevelStart;


public:
	alias ArrType = Input2Cubed;


public:
	fn setup(levels: u32) { }
	fn setup(levels: u32, arr: ArrType[]) { }
	fn add(x: u32, y: u32, z: u32, val: u32) { }
	fn add(morton: u64, value: u32) { }
	//! Compresses the SVO into the given InputBuffer, allows you to add extra
	//! levels.
	fn toBuffer(ib: InputBuffer, totalLevels: u32, repeat: bool) u32 { }
	//! Compresses the SVO into the given InputBuffer.
	fn toBuffer(ib: InputBuffer) u32 { }
}

struct MyPacker
{
public:
	enum TopNum;
	enum TopMask;
	enum TopLevels;
	enum BottomNum;
	enum BottomMask;
	enum BottomLevels;


public:
	alias NumLevels = totalLevels;
	alias TopType = TOP;
	alias BottomType = BOTTOM;


public:
	fn setup(levels: u32) { }
	fn add(x: u32, y: u32, z: u32, val: u32) { }
	fn add(morton: u32, value: u32) { }
	fn toBuffer(ib: InputBuffer) u32 { }
}

fn repackFrom(dst: Input4Cubed, arr: scope (scope (Input2Cubed)[]), start: u32) { }
fn repackFrom(dst: Input8Cubed, arr: scope (scope (Input2Cubed)[]), start: u32) { }
fn genMipmap(src: Input2Cubed) u32 { }

voxel.svo.design

module voxel.svo.design;


//! Some constants used troughout the code.
enum NumDim;
//! Some constants used troughout the code.
enum XShift;
//! Some constants used troughout the code.
enum YShift;
//! Some constants used troughout the code.
enum ZShift;
//! Constants used in the rendering pipeline.
enum BufferNum;
//! Constants used in the rendering pipeline.
enum BufferCommandId;

//! Information about a single SVO, used by loaders and the pipeline.
struct Create
{
public:
	isAMD: bool;
}

voxel.svo.buddy

//! A simple buddy allocator, only does tracking of which blocks are free
module voxel.svo.buddy;


fn isPowerOfTwo(n: size_t) bool { }
fn nextHighestPowerOfTwo(n: size_t) size_t { }
fn sizeToOrder(n: size_t) u8 { }
fn orderToSize(order: u8) size_t { }
fn countTrailingZeros(bits: u8, isZeroUndef: bool) u8;
fn countTrailingZeros(bits: u16, isZeroUndef: bool) u16;
fn countTrailingZeros(bits: u32, isZeroUndef: bool) u32;
fn countTrailingZeros(bits: u64, isZeroUndef: bool) u64;

voxel.svo.buffers

module voxel.svo.buffers;


//! Generates a index buffer for cubes using bitRakes' tri-strip cube.
//! Modified to fit OpenGL. Its still a bit DXy so backsides of triangles
//! are out.
fn createIndexBuffer(numVoxels: u32) GLuint { }
//! Returns a buffer with a triangle list for drawing quads.
fn createIndexBufferQuads(numVoxels: u32) GLuint { }

voxel.svo

module voxel.svo;

public import voxel.svo.input;
public import voxel.svo.entity;
public import voxel.svo.packer;
public import voxel.svo.design;
public import voxel.svo.buffers;
public import voxel.svo.textures;
public import voxel.svo.pipeline;

voxel.svo.util

module voxel.svo.util;


//! A helper struct to get the distance that a Voxel of a given level is
//! one pixel large.
struct VoxelDistanceFinder
{
public:
	enum SQRT2;


public:
	ratio: f64;
	halfPixels: f64;
	tanHalfFov: f64;


public:
	fn setup(fov: f64, width: u32, height: u32) { }
	fn getDistance(level: i32) f64 { }
}

struct BufferTracker
{
public:
	bits: u32;
	numFree: u32;


public:
	fn setup(num: u32) { }
	fn get() u32 { }
	fn free(index: u32) { }
}

fn countTrailingZeros(bits: u32, isZeroUndef: bool) u32;

voxel.svo.textures

module voxel.svo.textures;


fn createEdge3DSampler() GLuint { }
fn createEdge3DTexture() GLuint { }
fn createEdgeCubeSampler() GLuint { }
fn createEdgeCubeTexture() GLuint { }

voxel.svo.hashbuffer

//! A specialiced hashmap and buffer.
module voxel.svo.hashbuffer;


//! A hash map and buffer.
struct HashBuffer
{
public:
	fn ptr() u32* { }
	fn length() size_t { }
	fn setup(numReserved: u32) { }
	fn setup(startBufferSize: u32, startHashSize: u32, numReserved: u32) { }
	fn close() { }
	fn takeMemory(count: u32) u32[] { }
	fn add(data: scope (const(scope (u32)[])) u32 { }
}

struct ReallocU32Ptr
{
public:
	ptr: T*;
	num: size_t;


public:
	fn takePtrAndClear() T* { }
	fn fits(min: size_t) bool { }
	fn resize(newNum: size_t) { }
	fn free() { }
}

struct ReallocU64Ptr
{
public:
	ptr: T*;
	num: size_t;


public:
	fn takePtrAndClear() T* { }
	fn fits(min: size_t) bool { }
	fn resize(newNum: size_t) { }
	fn free() { }
}

//! Produces slightly fewer hash collisions then crc32.
fn hashFNV1A(key: scope (const(scope (u32)[])) u64 { }

voxel.svo.entity

module voxel.svo.entity;


//! A single entity that points into a SVO tree.
class Entity
{
public:
	data: Data;
	frame: size_t;
	frames: u32[];
	index: size_t;
	numLevels: u32;


public:
	this(data: Data, frames: u32[], numLevels: u32) { }
	fn stepFrame() { }
	fn start() u32 { }
	fn rot() math.Quatf { }
	fn pos() math.Point3f { }


protected:
	fn entry() EntityEntry* { }
}

//! Holds data for multiple SVO trees and Entities.
class Data
{
public:
	data: u32[];
	trees: EntityEntry[];
	create: Create;
	texture: GLuint;
	buffer: GLuint;


public:
	this(create: Create, data: void[]) { }
	fn count(obj: Entity, levels: u32) size_t { }
}

//! Entity data kept in a array.
struct EntityEntry
{
public:
	//! Position of this Tree.
	pos: math.Point3f;
	//! Starting address of this Tree.
	start: u32;
	//! Rotation of this Tree.
	rot: math.Quatf;
}

voxel.svo.shaders

module voxel.svo.shaders;


//! Cache shaders so they can be resude between different passes and
//! models.
class ShaderStore
{
public:
	this(isAMD: bool) { }
	fn makeElementsDispatchShader(src: u32, dst: u32) gfx.Shader { }
	fn makeWalkFrustumShader(srcBaseIndex: u32, dstBaseIndex: u32, counterIndex: u32, powerStart: u32, powerLevels: u32) gfx.Shader { }
	fn makeWalkSplitShader(srcBaseIndex: u32, dstBaseIndex: u32, counterIndex: u32, splitIndex: u32, splitSize: u32, powerStart: u32) gfx.Shader { }
	fn makeWalkSortShader(srcBaseIndex: u32, counterIndex: u32, powerStart: u32) gfx.Shader { }
	fn makeWalkDoubleShader(counterIndex: u32) gfx.Shader { }
	fn makePointsWalkShader(powerStart: u32) gfx.Shader { }
	fn makeCubesWalkShader(src: u32, powerStart: u32) gfx.Shader { }


protected:
	mShaderStore: gfx.Shader[string];
	mCompiler: gfx.Compiler;
	mIsAMD: bool;
}

fn getStore(c: Create) ShaderStore { }

voxel.svo.pipeline

module voxel.svo.pipeline;


//! A single SVO rendering pipeline.
class Pipeline : old.Pipeline
{
public:
	alias draw = old.Pipeline.draw;


public:
	data: Data;


public:
	this(data: Data) { }
	fn close() { }
	fn draw(input: Draw) { }
	fn doDraw(input: old.Draw) { }
	fn doDraw(state: DataBuffer) { }


protected:
	enum DataBufferSize;
	enum AtomicBufferSize;
	enum CounterBufferSize;
	enum DrawIndirectSize;
	enum DispatchIndirectSize;
	enum VoxelBufferSize;
	enum SortBufferSize;
	enum DoubleBufferSize;


protected:
	mStore: ShaderStore;
	mVAO: GLuint;
	mState: StepState;
	mTimeInit: gfx.TimeTracker;
	mTimeClose: gfx.TimeTracker;
	mSteps: Step[];
	mStart: Step[16];
}

struct Draw
{
public:
	camVP: math.Matrix4x4d;
	cullVP: math.Matrix4x4d;
	camPos: math.Point3f;
	_pad0: f32;
	cullPos: math.Point3f;
	_pad1: f32;
	targetWidth: u32;
	targetHeight: u32;
	fov: f32;
	_pad2: f32;
	objs: Entity[];
}

struct DataBuffer
{
public:
	struct Entry
	{
	public:
		xy: u32;
		zobj: u32;
		addr: u32;


	public:
		fn from(id: u32, start: u32) { }
	}

	struct PerObject
	{
	public:
		matrix: math.Matrix4x4f;
		planes: math.Planef[4];
		camPosition: math.Point3f;
		_pad0: f32;
	}


public:
	objs: PerObject[256];
	dists: f32[32];
	pointScale: f32;
	nums: u32[16];
	entries: Entry[256][16];


public:
	fn setFrom(input: Draw) { }
	fn setFrom(input: old.Draw) { }


public:
	static fn updateState(outObj: PerObject, camVp: math.Matrix4x4d, cullVp: math.Matrix4x4d, cullCamPos: math.Point3f, model: Entity) { }
}

//! Checks if we can run voxel graphics code, return null on success.
fn checkGraphics() string { }

voxel.svo.input

module voxel.svo.input;


//! Select the default input buffer.
alias InputBuffer = LinearBuffer;

struct Input2Cubed
{
public:
	enum Pow;
	enum Size;
	enum ElementsNum;
	enum XStride;
	enum YStride;
	enum ZStride;
	enum FlagsNumBits;
	enum FlagsNum;


public:
	alias ElementsType = u32;
	alias FlagsType = u8;


public:
	union U
	{
	public:
		_pad: u32;
		flags: FlagsType[1];
	}


public:
	u: U;
	data: ElementsType[8];


public:
	fn getBit(index: u32) bool { }
	fn set(index: u32, d: u32) { }
	fn set(x: u32, y: u32, z: u32, d: u32) { }
	fn reset() { }
	fn dumpBits() { }


public:
	static fn indexOf(x: u32, y: u32, z: u32) u32 { }
}

struct Input4Cubed
{
public:
	enum Pow;
	enum Size;
	enum ElementsNum;
	enum XStride;
	enum YStride;
	enum ZStride;
	enum FlagsNumBits;
	enum FlagsNum;


public:
	alias ElementsType = u32;
	alias FlagsType = u8;


public:
	union U
	{
	public:
		_pad: u32;
		flags: FlagsType[8];
	}


public:
	u: U;
	data: ElementsType[64];


public:
	fn getBit(index: u32) bool { }
	fn set(index: u32, d: u32) { }
	fn set(x: u32, y: u32, z: u32, d: u32) { }
	fn reset() { }
	fn dumpBits() { }


public:
	static fn indexOf(x: u32, y: u32, z: u32) u32 { }
}

struct Input8Cubed
{
public:
	enum Pow;
	enum Size;
	enum ElementsNum;
	enum XStride;
	enum YStride;
	enum ZStride;
	enum FlagsNumBits;
	enum FlagsNum;


public:
	alias ElementsType = u32;
	alias FlagsType = u8;


public:
	union U
	{
	public:
		_pad: u32;
		flags: FlagsType[64];
	}


public:
	u: U;
	data: ElementsType[512];


public:
	fn getBit(index: u32) bool { }
	fn set(index: u32, d: u32) { }
	fn set(x: u32, y: u32, z: u32, d: u32) { }
	fn reset() { }
	fn dumpBits() { }


public:
	static fn indexOf(x: u32, y: u32, z: u32) u32 { }
}

struct LinearBuffer
{
public:
	enum BitsPerFlag;
	enum FlagsNum2;
	enum FlagsNum4;
	enum FlagsNum8;
	enum FlagsNum2And4;
	enum FlagsNum2And8;
	enum MaxNum2;
	enum MaxNum4;
	enum MaxNum2And4;
	enum MaxNum2And8;
	enum FlagsNum2Cubed;
	enum FlagsNum4Cubed;
	enum FlagsNum8Cubed;


public:
	base: Base;


public:
	fn setup(numReserved: u32) { }
	fn getData() void[] { }
	fn compressAndAdd(box2: Input2Cubed) u32 { }
	fn compressAndAdd(box4: Input4Cubed) u32 { }
	fn compressAndAdd(box2: Input2Cubed, box4: Input4Cubed) u32 { }
	fn compressAndAdd(box2: Input2Cubed, box8: Input8Cubed) u32 { }
}

struct BuddyBuffer
{
public:
	enum BitsPerFlag;
	enum FlagsNum2;
	enum FlagsNum4;
	enum FlagsNum8;
	enum FlagsNum2And4;
	enum FlagsNum2And8;
	enum MaxNum2;
	enum MaxNum4;
	enum MaxNum2And4;
	enum MaxNum2And8;
	enum FlagsNum2Cubed;
	enum FlagsNum4Cubed;
	enum FlagsNum8Cubed;


public:
	base: Base;


public:
	fn setup(numReserved: u32) { }
	fn getData() void[] { }
	fn compressAndAdd(box2: Input2Cubed) u32 { }
	fn compressAndAdd(box4: Input4Cubed) u32 { }
	fn compressAndAdd(box2: Input2Cubed, box4: Input4Cubed) u32 { }
	fn compressAndAdd(box2: Input2Cubed, box8: Input8Cubed) u32 { }
}

struct InputBuddy
{
public:
	enum MinOrder;
	enum MaxOrder;
	enum LargestOrder;
	enum NumLevels;
	enum NumBitsPerElm;
	enum NumBits;
	enum NumElems;


public:
	fn setup() { }
	fn reserveStart(n: size_t) { }
	fn canAlloc(order: size_t) bool { }
	fn alloc(order: size_t) size_t { }
	fn free(order: size_t, n: size_t) { }
}

//! Caching input buffer to build SVOs, is more designed for live updating
//! then space size, so wastes memory.
struct BuddyAdder
{
public:
	fn setup(numReserved: u32) { }
	//! Returns the entire data buffer as void array.
	fn takeMemory(count: u32) u32[] { }
	//! Small helper to add a single u32 value.
	fn add(v: u32) u32 { }
	//! Adds data into the buffer and returns the index to it.
	fn add(data: scope (const(scope (u32)[])) u32 { }
}

voxel.old

module voxel.old;

public import voxel.old.shaders;
public import voxel.old.pipeline;

voxel.old.shaders

module voxel.old.shaders;


//! Cache shaders so they can be resude between different passes and
//! models.
class ShaderStore
{
public:
	this(isAMD: bool) { }
	fn makeComputeDispatchShader(src: u32, dst: u32) gfx.Shader { }
	fn makeElementsDispatchShader(src: u32, dst: u32) gfx.Shader { }
	fn makeArrayDispatchShader(src: u32, dst: u32) gfx.Shader { }
	fn makeListShader(src: u32, dst1: u32, dst2: u32, powerStart: u32, powerLevels: u32, dist: f32) gfx.Shader { }
	fn makeListDoubleShader(src: u32, dst: u32, powerStart: u32) gfx.Shader { }
	fn makeCubesShader(src: u32, powerStart: u32) gfx.Shader { }
	fn makeRayShader(src: u32, powerStart: u32, powerLevels: u32) gfx.Shader { }
	fn makeRayDoubleShader(src: u32, powerStart: u32) gfx.Shader { }
	fn makePointsShader(src: u32, powerStart: u32) gfx.Shader { }
	fn makeQuadsShader(src: u32, powerStart: u32) gfx.Shader { }
	fn makeWalkFrustumShader(srcBaseIndex: u32, dstBaseIndex: u32, counterIndex: u32, powerStart: u32, powerLevels: u32) gfx.Shader { }
	fn makeWalkSplitShader(srcBaseIndex: u32, dstBaseIndex: u32, counterIndex: u32, splitIndex: u32, splitSize: u32, powerStart: u32) gfx.Shader { }
	fn makeWalkSortShader(srcBaseIndex: u32, counterIndex: u32, powerStart: u32) gfx.Shader { }
	fn makeWalkDoubleShader(counterIndex: u32) gfx.Shader { }
	fn makePointsWalkShader(powerStart: u32) gfx.Shader { }
	fn makeCubesWalkShader(src: u32, powerStart: u32) gfx.Shader { }


protected:
	mShaderStore: gfx.Shader[string];
	mCompiler: gfx.Compiler;
	mIsAMD: bool;
}

//! The state that is passed to each step when we are running the
//! pipeline.
struct StepState
{
public:
	matrix: math.Matrix4x4f;
	planes: math.Planef[4];
	camPosition: math.Point3f;
	frame: u32;
	pointScale: f32;
	buffers: GLuint[6];
	atomicBuffer: GLuint;
	commandBuffer: GLuint;
}

fn getStore(c: Create) ShaderStore { }

voxel.old.pipeline

module voxel.old.pipeline;


//! A single SVO rendering pipeline.
class Pipeline
{
public:
	name: string;


public:
	this(name: string) { }
	fn close();
	fn draw(input: Draw) { }
	fn doDraw(input: Draw);


protected:
	mTimeTrackerRoot: gfx.TimeTracker;
}

//! A SVO rendering pipeline that uses stages.
class StepPipeline : Pipeline
{
public:
	enum Kind
	{
		CubePoint,
		Points0,
		Points1,
		Raycube,
		Num,
	}


public:
	this(octTexture: GLuint, create: Create, kind: Kind) { }
	fn makePointsPipeline(b: StepsBuilder, dub: bool) { }
	fn makeRayDoublePipeline(b: StepsBuilder, old: bool) { }
	fn makeCubePointPipeline(b: StepsBuilder) { }
	fn makeRaycubePipeline(b: StepsBuilder) { }
	fn close() { }
	fn doDraw(input: Draw) { }
	fn debugCounter(src: u32) u32 { }


protected:
	mTimeTrackers: gfx.TimeTracker[];
	mOctTexture: GLuint;
	mElementsVAO: GLuint;
	mArrayVAO: GLuint;
	mIndexBuffer: GLuint;
	mAtomicBuffer: GLuint;
	mIndirectBuffer: GLuint;
	mOutputBuffers: GLuint[6];
	mSteps: Step[];
}

//! Helper class to build a rendering pipeline.
class StepsBuilder
{
public:
	s: ShaderStore;
	endLevelOfBuf: u32[6];
	tracker: BufferTracker;


public:
	this(s: ShaderStore) { }
	fn makeInit(dst: u32) InitStep { }
	fn makeList1(src: u32, powerLevels: u32, dst: u32) ListStep { }
	fn makeListDouble(src: u32, dst: u32) ListDoubleStep { }
	fn makeList2(src: u32, powerLevels: u32, distance: f32, dst1: u32, dst2: u32) ListStep { }
	fn makeCubes(src: u32) CubeStep { }
	fn makePoints(src: u32) PointsStep { }
	fn makeRayDouble(src: u32) RayDoubleStep { }
}

//! Base class for all steps in a rendering pipeline.
class Step
{
public:
	name: string;


public:
	this() { }
	fn run(state: StepState);
}

//! First step of any rendering pipeline.
class InitStep : Step
{
public:
	dst: u32;


public:
	this(dst: u32) { }
	fn run(state: StepState) { }
}

class ListStep : Step
{
public:
	dispatchShader: gfx.Shader;
	listShader: gfx.Shader;


public:
	this(s: ShaderStore, src: u32, dst1: u32, dst2: u32, powerStart: u32, powerLevels: u32, distance: f32) { }
	fn run(state: StepState) { }
}

class ListDoubleStep : Step
{
public:
	dispatchShader: gfx.Shader;
	listShader: gfx.Shader;


public:
	this(s: ShaderStore, src: u32, dst: u32, powerStart: u32) { }
	fn run(state: StepState) { }
}

class CubeStep : Step
{
public:
	dispatchShader: gfx.Shader;
	drawShader: gfx.Shader;


public:
	this(s: ShaderStore, src: u32, powerStart: u32) { }
	fn run(state: StepState) { }
}

class RayStep : Step
{
public:
	dispatchShader: gfx.Shader;
	drawShader: gfx.Shader;


public:
	this(s: ShaderStore, src: u32, powerStart: u32, powerLevels: u32) { }
	fn run(state: StepState) { }
}

class RayDoubleStep : Step
{
public:
	dispatchShader: gfx.Shader;
	drawShader: gfx.Shader;


public:
	this(s: ShaderStore, src: u32, powerStart: u32) { }
	fn run(state: StepState) { }
}

class PointsStep : Step
{
public:
	dispatchShader: gfx.Shader;
	drawShader: gfx.Shader;


public:
	this(s: ShaderStore, src: u32, powerStart: u32) { }
	fn run(state: StepState) { }
}

//! Input to the draw call that renders the SVO.
struct Draw
{
public:
	camMVP: math.Matrix4x4d;
	cullMVP: math.Matrix4x4d;
	camPos: math.Point3f;
	pad0: f32;
	cullPos: math.Point3f;
	pad1: f32;
	frame: u32;
	numLevels: u32;
	targetWidth: u32;
	targetHeight: u32;
	fov: f32;
}

//! Checks if we can run voxel graphics code, return null on success.
fn checkGraphics() string { }

voxel.generators.one

//! Contains the OneGen svo generator.
module voxel.generators.one;


//! Generates a single voxel at origin (0, 0, 0).
struct OneGen
{
public:
	enum Max;


public:
	//! Generate a single white voxel at origin.
	fn gen(ib: InputBuffer, levels: u32) u32 { }
}

voxel.generators.flat

//! Contains the FlatGen svo generator.
module voxel.generators.flat;


//! Generates a flat surface on the Y plane.
struct FlatGen
{
public:
	enum Max;
	enum ColorLevels;


public:
	//! Generate a completely flat white surface.
	fn genYWhite(ib: InputBuffer, levels: u32) u32 { }
	//! Generate a completely flat colored surface.
	fn genYColored(ib: InputBuffer, levels: u32) u32 { }
}

voxel.generators

//! Imports all of the svo generators.
module voxel.generators;

public import voxel.generators.one;
public import voxel.generators.flat;

voxel.loaders.magica

//! Code for loading magicavoxel files.
module voxel.loaders.magica;


class Loader
{
public:
	mVoxels: Voxel[];
	mColors: math.Color4b[];
	mLevels: u32;


public:
	this() { }
	fn loadFileFromData(fileData: void[], frames: u32[], data: void[], totalLevels: u32) bool { }
	fn loadFileFromData(data: const(void)[]) bool { }
	fn toBuffer(ib: InputBuffer, totalLevels: u32, repeat: bool) u32 { }
	fn toBufferXYZ64ABGR32() u32[] { }
}

fn isMagicaFile(fileData: void[]) bool { }

voxel.loaders

//! Common code for loaders and imports for users of loaders.
module voxel.loaders;

public import voxel.loaders.magica = voxel.loaders.magica
public import voxel.loaders.chalmers = voxel.loaders.chalmers

voxel.loaders.chalmers

//! Code for loading chalmers svo files.
module voxel.loaders.chalmers;


enum Magic;

class Loader
{
public:
	this() { }
	fn loadFileFromData(fileData: void[], c: Create, frames: u32[], data: void[]) bool { }
}

struct Header
{
public:
	id: u64;
	numFrames: u64;
	resolution: u64;
	dataSizeInU32: u64;
	minX: f32;
	minY: f32;
	minZ: f32;
	maxX: f32;
	maxY: f32;
	maxZ: f32;


public:
	fn check() bool { }
	fn frames() u32[] { }
	fn data() void[] { }
}

fn isChalmersDag(fileData: void[]) bool { }

main

module main;


fn main(args: string[]) i32 { }

charge.game.scene.background

module charge.game.scene.background;


enum vertexShaderES;
enum fragmentShaderES;

class Background : Scene
{
public:
	this(m: Manager) { }
	fn setTile(filename: string) { }
	fn setTile(file: sys.File) { }
	fn setLogo(filename: string) { }
	fn setLogo(file: sys.File) { }
	fn initBuffers(t: gfx.Target) { }
	fn close() { }
	fn updateActions(timepoint: i64) { }
	fn logic() { }
	fn render(t: gfx.Target, viewInfo: gfx.ViewInfo) { }
	fn assumeControl() { }
	fn dropControl() { }


protected:
	mBuf: GLuint;
	mVao: GLuint;
	mNum: GLsizei;
	mWidth: u32;
	mHeight: u32;
	mLogo: gfx.Texture;
	mLogoWidth: u32;
	mLogoHeight: u32;
	mTile: gfx.Texture;
	mTileWidth: u32;
	mTileHeight: u32;
}

charge.game.scene

module charge.game.scene;

public import charge.game.scene.app;
public import charge.game.scene.scene;
public import charge.game.scene.simple;
public import charge.game.scene.background;

charge.game.scene.scene

//! Source file for Scene base class and Manager interface.
module charge.game.scene.scene;


//! A interface back to the main controller, often the main game loop.
interface Manager
{
public:
	//! Push this scene to top of the stack.
	fn push(Scene);
	//! Remove this scene from the stack.
	fn remove(Scene);
	//! The given scene wants to be deleted.
	fn closeMe(Scene);
}

//! A scene often is a level, menu overlay or a loading screen.
class Scene
{
public:
	enum Flag
	{
		TakesInput,
		Transparent,
		Blocker,
		AlwaysOnTop,
	}

	enum Type
	{
		Background,
		Game,
		Menu,
		Overlay,
	}


public:
	flags: Flag;


public:
	this(m: Manager, type: Type) { }
	//! Shutdown this scene, this is called by the Manager.
	fn close();
	//! Called every time actions should be updated, timepoint given is when
	//! next frame is to be displayed.
	fn updateActions(timepoint: i64);
	//! Step the game logic one step.
	fn logic();
	//! Render view of this scene into target.
	fn render(gfx.Target, gfx.ViewInfo);
	//! Install all input listeners.
	fn assumeControl();
	//! Uninstall all input listeners.
	fn dropControl();


protected:
	mManager: Manager;
}

charge.game.scene.app

//! Source file for SceneManagerApp base classes.
module charge.game.scene.app;


//! Base class for games wishing to use Scenes, implements most if not all
//! needed SceneManager functions needed.
class ManagerApp : App, Manager
{
public:
	this(opts: core.Options) { }
	this(core: core.Core) { }
	fn close() { }
	fn updateActions(timepoint: i64) { }
	fn logic() { }
	fn render(t: gfx.Target, viewInfo: gfx.ViewInfo) { }
	fn idle(time: i64) { }
	fn push(r: Scene) { }
	fn closeMe(r: Scene) { }
	fn remove(r: Scene) { }
	fn manageScenes() { }
}

charge.game.scene.simple

//! Source file for Simple, helper default implementation.
module charge.game.scene.simple;


//! Helper that, implements all of the functions on Scene.
class Simple : Scene
{
public:
	this(m: Manager, type: Type) { }
	fn close() { }
	fn updateActions(timepoint: i64) { }
	fn logic() { }
	fn render(gfx.Target, gfx.ViewInfo) { }
	fn keyText(ctl.Keyboard, scope (const(scope (char)[])) { }
	fn keyDown(ctl.Keyboard, i32) { }
	fn keyUp(ctl.Keyboard, i32) { }
	fn mouseMove(ctl.Mouse, i32, i32) { }
	fn mouseDown(ctl.Mouse, i32) { }
	fn mouseUp(ctl.Mouse, i32) { }
	fn assumeControl() { }
	fn dropControl() { }


protected:
	mInput: ctl.Input;
}

charge.game.tui.windowscene

//! Contains classes and code to create a text-user-interface window
//! scene.
module charge.game.tui.windowscene;


//! A text-user-interface that draws to a single window on the screen.
class WindowScene : scene.Simple
{
public:
	enum HeaderExtra;
	enum HeaderShadow;
	enum BorderSize;


public:
	posX: i32;
	posY: i32;
	headerGrid: Grid;
	grid: Grid;
	headerBackgroundColor: math.Color4f;
	gridBackgroundColor: math.Color4f;


public:
	this(m: scene.Manager, width: u32, height: u32) { }
	fn close() { }
	fn mouseDown(m: ctl.Mouse, button: i32) { }
	fn render(t: gfx.Target, viewInfo: gfx.ViewInfo) { }
	fn gridMouseDown(m: ctl.Mouse, x: u32, y: u32, button: i32) { }
	fn setSize(width: u32, height: u32) { }
	fn setHeader(glyphs: scope (const(scope (u8)[])) { }
	fn getSizeInPixels(width: u32, height: u32) { }
	fn getGridPositionOnScreen(x: i32, y: i32) { }
	fn getHeaderSizeInPixels(w: u32, h: u32) { }


protected:
	mTarget: gfx.FramebufferResizer;
	mBlitter: gfx.TextureBlitter;
}

charge.game.tui.glyphdraw

module charge.game.tui.glyphdraw;


enum TabSize;

enum SingleGuiElememts
{
	TOP_LEFT,
	TOP_RIGHT,
	BOTTOM_LEFT,
	BOTTOM_RIGHT,
	VERTICAL_LINE,
	HORIZONTAL_LINE,
}

enum DoubleGuiElememts
{
	TOP_LEFT,
	TOP_RIGHT,
	BOTTOM_LEFT,
	BOTTOM_RIGHT,
	VERTICAL_LINE,
	HORIZONTAL_LINE,
}

fn makeTextLayout(text: string, w: u32, h: u32) { }
fn makeText(grid: Grid, x: i32, y: i32, text: string) { }
fn makeButton(grid: Grid, x: i32, y: i32, width: u32, single: bool, glyphs: scope (const(scope (u8)[])) { }
fn makeFrameSingle(grid: Grid, x: i32, y: i32, w: u32, h: u32) { }
fn makeFrameDouble(grid: Grid, x: i32, y: i32, w: u32, h: u32) { }

charge.game.tui

module charge.game.tui;

public import charge.game.tui.grid;
public import charge.game.tui.glyphdraw;
public import charge.game.tui.menuscene;
public import charge.game.tui.windowscene;
public import charge.game.tui.messagescene;

charge.game.tui.grid

module charge.game.tui.grid;


//! A glyph grid that you can use to create text-user-interface with.
class Grid
{
public:
	this(width: u32, height: u32) { }
	fn close() { }
	fn put(x: i32, y: i32, glyph: u8) { }
	fn setSize(width: u32, height: u32) { }
	fn setGlyphSize(width: i32, height: i32) { }
	fn setOffset(x: i32, y: i32) { }
	fn setColor(color: math.Color4b) { }
	fn reset() { }
	fn getSizeInPixels(width: u32, height: u32) { }
	fn draw(t: Target) { }
	fn width() u32 { }
	fn height() u32 { }
	fn isDirty() bool { }


protected:
	mData: u8[];
	mTextVBO: DrawBuffer;
	mTextState: BitmapState;
	mTextBuilder: DrawVertexBuilder;
	mWidth: u32;
	mHeight: u32;
	mColor: math.Color4b;
	mDirty: bool;


protected:
	fn updateVBO() { }
}

charge.game.tui.menuscene

module charge.game.tui.menuscene;


class Button
{
public:
	pressed: void delegate(Button);
	str: string;
	x: i32;
	y: i32;
	w: u32;
	h: u32;


public:
	this() { }
	fn maybeClicked(x: i32, y: i32) { }
}

class MenuScene : WindowScene
{
public:
	enum TopOffset;
	enum TotalWidth;
	enum ButtonWidth;
	enum ButtonHeight;
	enum ButtonVerticalSeperation;
	enum LastButtonWidth;
	enum LastButtonHorizontalSeperation;


public:
	buttons: Button[];
	quit: Button;
	close: Button;


public:
	this(m: scene.Manager, header: string, buttons: scope (scope (Button)[])) { }
	fn keyDown(ctl.Keyboard, keycode: i32) { }
	fn gridMouseDown(m: ctl.Mouse, x: u32, y: u32, button: i32) { }
}

charge.game.tui.messagescene

module charge.game.tui.messagescene;


class Text
{
public:
	str: string;
	x: i32;
	y: i32;
	w: u32;
	h: u32;


public:
	this() { }
}

class MessageScene : WindowScene
{
public:
	ok: Button;
	text: Text;


public:
	this(m: scene.Manager, header: string, str: string) { }
	fn keyDown(ctl.Keyboard, keycode: i32) { }
	fn gridMouseDown(m: ctl.Mouse, x: u32, y: u32, button: i32) { }
	fn pressedOk(button: Button) { }
}

charge.game

module charge.game;

public import charge.game.app;

charge.game.app

//! Source file for App base classes.
module charge.game.app;


class App
{
public:
	this(opts: core.Options) { }
	this(core: core.Core) { }
	//! Called by the core when it is shutting down.
	fn close() { }
	//! Simple function that dispatches to the charge core.
	fn loop() i32 { }
	//! Called every time actions should be updated, timepoint given is when
	//! next frame is to be displayed.
	fn updateActions(timepoint: i64);
	//! Called every logic step.
	fn logic();
	//! Called every frame.
	fn render(t: gfx.Target, viewInfo: gfx.ViewInfo);
	//! Idle is a bit missleading name, this function is always called after a
	//! frame is completed. Time is the difference between when the next logic
	//! step should happen and the current time, so it can be a negative value
	//! if we are behind (often happens when rendering takes to long to
	//! complete).
	fn idle(time: i64);


protected:
	mCore: core.Core;
	mInput: ctl.Input;
	mFrameTime: gfx.TimeTracker;
	mRenderTime: sys.TimeTracker;
	mLogicTime: sys.TimeTracker;
	mBuildTime: sys.TimeTracker;
	mIdleTime: sys.TimeTracker;
}

charge.license

module charge.license;


//! This is the license for Charge.
enum license;

charge.core.win32

//! Source file for CoreWin32.
module charge.core.win32;

charge.core.common

//! Source file for CommonCore.
module charge.core.common;


//! Class hold common things for core.
class CommonCore : BasicCore
{
public:
	fn loop() i32 { }


protected:
	enum phyFlags;
	enum sfxFlags;


protected:
	p: Properties;
	mRunning: bool;
	mSleepTime: TimeTracker;


protected:
	fn initSubSystem(flag: Flag) { }
	fn getTicks() i64;
	fn doInput();
	fn doRenderAndSwap();
	fn doSleep(diff: i64);
	fn doClose();
	fn notLoaded(mask: Flag, name: string) { }
	fn loadPhy() { }
	fn loadSfx() { }
	fn initSettings() { }
	fn saveSettings() { }
	fn initPhy() { }
	fn closePhy() { }
	fn initSfx() { }
	fn closeSfx() { }
}

charge.core.basic

//! Source file for BasicCore.
module charge.core.basic;


//! More basic helper core that only implements dg functions.
class BasicCore : Core
{
public:
	fn setClose(dgt: void delegate()) { }
	fn setUpdateActions(dgt: void delegate(i64)) { }
	fn setLogic(dgt: void delegate()) { }
	fn setRender(dgt: void delegate(gfx.Target, gfx.ViewInfo)) { }
	fn setIdle(dgt: void delegate(i64)) { }


protected:
	mRetVal: i32;
	closeDg: void delegate();
	updateActionsDg: void delegate(i64);
	logicDg: void delegate();
	renderDg: void delegate(gfx.Target, gfx.ViewInfo);
	idleDg: void delegate(i64);
	global gInstance: BasicCore;
}

fn get() Core { }

charge.core

//! Source file containing Core and Options.
module charge.core;


//! Enum for selecting subsystems.
enum Flag
{
	CTL,
	GFX,
	SFX,
	NET,
	PHY,
	AUTO,
}

//! Enum for selecting window mode.
enum WindowMode
{
	Normal,
	FullscreenDesktop,
	Fullscreen,
}

//! Options at initialization.
class Options
{
public:
	width: u32;
	height: u32;
	title: string;
	flags: Flag;
	windowMode: WindowMode;
	openglDebug: bool;


public:
	this() { }
}

//! Class holding the entire thing together.
class Core
{
public:
	enum DefaultWidth;
	enum DefaultHeight;
	enum DefaultFullscreen;
	enum DefaultFullscreenAutoSize;
	enum DefaultTitle;
	enum DefaultForceResizeEnable;
	enum DefaultWindowMode;


public:
	flags: Flag;
	resizeSupported: bool;
	verbosePrinting: bool;


public:
	//! Sets callback functions.
	fn setUpdateActions(dgt: void delegate(i64));
	//! Sets callback functions.
	fn setLogic(dgt: void delegate());
	//! Sets callback functions.
	fn setRender(dgt: void delegate(gfx.Target, gfx.ViewInfo));
	//! Sets callback functions.
	fn setClose(dgt: void delegate());
	//! Sets callback functions.
	fn setIdle(dgt: void delegate(i64));
	//! Main loop functions, you should expect that this function returns. Best
	//! usage is if you in your main function do this "return c.loop();".
	fn loop() i32;
	//! Signal the core to quit, will return from loop.
	fn quit(i32);
	//! Display a panic message, usually a dialogue box, then calls exit(-1),
	//! so this function does not return.
	fn panic(message: string);
	//! Returns text from the clipboard, should any be in it.
	fn getClipboardText() string;
	fn resize(w: u32, h: u32, mode: WindowMode);
	fn size(w: u32, h: u32, mode: WindowMode);
	fn screenShot();


protected:
	global gInitFuncs: fn () (void)[];
	global gCloseFuncs: fn () (void)[];
}

//! Get a new core created with the given flags.
fn start(opts: Options) Core;
//! Return the current core.
fn get() Core;
//! These functions are run just after Core is initialize and right before
//! Core is closed.
fn addInitAndCloseRunners(init: fn () (void), close: fn () (void)) { }

charge.core.sdl

//! Source file for CoreSDL.
module charge.core.sdl;


//! Multi-platform Core based on SDL.
class CoreSDL : CommonCore
{
public:
	this(opts: Options) { }
	fn quit(ret: i32) { }
	fn panic(msg: string) { }
	fn getClipboardText() string { }
	fn screenShot() { }
	fn resize(w: u32, h: u32, mode: WindowMode) { }
	fn size(w: u32, h: u32, mode: WindowMode) { }


protected:
	fn getTicks() i64 { }
	fn doInput() { }
	fn doRenderAndSwap() { }
	fn doSleep(diff: i64) { }
	fn doClose() { }
}

class InputSDL : Input
{
public:
	this(numJoysticks: size_t) { }
}

class MouseSDL : Mouse
{
public:
	this() { }
	fn setRelativeMode(value: bool) { }
	fn getRelativeMode() bool { }
}

class KeyboardSDL : Keyboard
{
public:
	this() { }
}

class JoystickSDL : Joystick
{
public:
	this(id: size_t) { }
	fn handleEvent(e: SDL_Event) { }
	fn enabled(status: bool) bool { }
	fn enabled() bool { }
}

fn start(opts: Options) Core { }

charge.ctl.device

//! Source file for Device base class.
module charge.ctl.device;


class Device
{
public:
	this() { }
}

charge.ctl

module charge.ctl;

public import charge.ctl.input;
public import charge.ctl.device;
public import charge.ctl.mouse;
public import charge.ctl.keyboard;
public import charge.ctl.joystick;

charge.ctl.mouse

//! Source file for Mouse.
module charge.ctl.mouse;


class Mouse : Device
{
public:
	//! Mask of button state, 1 == pressed *
	state: u32;
	x: i32;
	y: i32;
	move: void delegate(Mouse, i32, i32);
	down: void delegate(Mouse, i32);
	up: void delegate(Mouse, i32);


public:
	this() { }
	fn setRelativeMode(value: bool);
	fn getRelativeMode() bool;
}

charge.ctl.keyboard

//! Source file for Keyboard.
module charge.ctl.keyboard;


class Keyboard : Device
{
public:
	text: void delegate(Keyboard, scope (const(scope (char)[]));
	down: void delegate(Keyboard, i32);
	up: void delegate(Keyboard, i32);


public:
	this() { }
}

charge.ctl.joystick

//! Source file for Joystick.
module charge.ctl.joystick;


class Joystick : Device
{
public:
	axisValues: i32[32];
	axis: void delegate(Joystick, i32, i32);
	down: void delegate(Joystick, i32);
	up: void delegate(Joystick, i32);


public:
	this() { }
	fn enable() bool { }
	fn disable() { }
	fn enabled(status: bool) bool;
	fn enabled() bool;


protected:
	fn handleAxis(which: size_t, value: i16) { }
}

charge.ctl.input

//! Source file for main Input processing and interface.
module charge.ctl.input;


class Input
{
public:
	mouseArray: Mouse[];
	keyboardArray: Keyboard[];
	joystickArray: Joystick[];


public:
	fn mouse() Mouse { }
	fn keyboard() Keyboard { }
	fn joystick() Joystick { }
	fn mice() Mouse[] { }
	fn keyboards() Keyboard[] { }
	fn joysticks() Joystick[] { }


public:
	static fn opCall() Input { }
}

charge.sys.timetracker

//! Source file for TimeTracker.
module charge.sys.timetracker;


class TimeTracker
{
public:
	this(name: string) { }
	fn start() { }
	fn stop() { }


public:
	static fn getTimings(sink: scope (Sink)) { }
}

charge.sys.memheader

//! Source file for c memory allocation and tracking functions.
module charge.sys.memheader;


fn cMemoryUsage() size_t { }
fn cMemoryPrintAll(sink: scope (Sink)) { }
fn cMalloc(size: size_t, file: const(char)*, line: u32) void* { }
fn cRealloc(ptr: void*, size: size_t, file: const(char)*, line: u32) void* { }
fn cFree(ptr: void*, file: const(char)*, line: u32) { }

charge.sys

//! Include everything from sys.
module charge.sys;

public import charge.sys.memory;
public import charge.sys.resource;
public import charge.sys.file;
public import charge.sys.timetracker;

charge.sys.resource

//! Source file for Resource and Pool.
module charge.sys.resource;


//! Reference base class for all Resources.
class Resource
{
public:
	url: string;
	name: string;


public:
	fn incRef() { }
	fn decRef() { }


protected:
	static fn alloc(ti: TypeInfo, uri: scope (const(scope (char)[]), name: scope (const(scope (char)[]), extraSize: size_t, extraPtr: void*, file: const(char)*, line: u32) void* { }
}

//! Pool for named resources.
class Pool
{
public:
	suppress404: bool;


public:
	this() { }
	fn collect() { }
	fn cleanAndLeakCheck(sink: scope (Sink)) { }


public:
	static fn opCall() Pool { }
}

charge.sys.memory

//! Source file for c memory alloction functions.
module charge.sys.memory;

public import core.c.stdlib;

charge.sys.file

//! Source file for Resource and Pool.
module charge.sys.file;


//! A single File from the file system or a zip file.
class File : Resource
{
public:
	enum uri;


public:
	size: size_t;
	ptr: immutable(void)*;


public:
	fn data() immutable(void)[] { }


public:
	//! A file that is created from import("filename.txt") import expressions.
	static fn fromImport(filename: string, data: immutable(void)[]) File { }
	//! Same as above, accepts string as that is what ´import("file")´
	//! returns;.
	static fn fromImport(filename: string, data: string) File { }
	static fn load(filename: string) File { }


protected:
	static fn loadFile(filename: string, fp: FILE*, size: size_t) { }
	static fn read(fp: FILE*, ptr: void*, size: size_t) { }
}

//! Dereference and reference helper function.
fn reference(dec: File, inc: File) { }

charge.math.color

//! Source file for colors used in graphics.
module charge.math.color;


//! A color value with 8 bits of unsigned values per channel.
struct Color4b
{
public:
	r: u8;
	g: u8;
	b: u8;
	a: u8;
	global White: const(Color4b);
	global Black: const(Color4b);


public:
	fn modulate(c: Color4b) { }
	fn blend(c: Color4b) { }
	fn toString() string { }
	fn toABGR() u32 { }
	fn toRGBA() u32 { }
	fn opEquals(other: Color4b) bool { }


public:
	static fn from(rf: f32, gf: f32, bf: f32, af: f32) Color4b { }
	static fn from(r: u8, g: u8, b: u8, a: u8) Color4b { }
	//! Converts a little endian RGBA value to little endian ABGR.
	static fn fromRGBA(value: u32) Color4b { }
	//! Read a little endian ABGR.
	static fn fromABGR(value: u32) Color4b { }
}

struct Color3f
{
public:
	r: f32;
	g: f32;
	b: f32;
	global White: const(Color3f);
	global Black: const(Color3f);


public:
	fn toString() string { }
	fn ptr() f32* { }


public:
	static fn from(r: f32, g: f32, b: f32) Color3f { }
	static fn from(c: Color4b) Color3f { }
}

struct Color4f
{
public:
	r: f32;
	g: f32;
	b: f32;
	a: f32;
	global White: const(Color4f);
	global Black: const(Color4f);


public:
	fn opAddAssign(c: Color4b) { }
	fn opMulAssign(f: f32) { }
	fn toString() string { }
	fn toABGR() u32 { }
	fn toRGBA() u32 { }
	fn ptr() f32* { }


public:
	static fn from(c: Color4b) Color4f { }
	static fn from(c: Color3f) Color4f { }
	static fn from(r: f32, g: f32, b: f32) Color4f { }
	static fn from(r: f32, g: f32, b: f32, a: f32) Color4f { }
}

charge.math.vector

//! Source file for Vector3f.
module charge.math.vector;


//! Vector in a 3D space. Charge follows the OpenGL convetion for axis so
//! Y+ is up, X+ is right and Z- is forward.
struct Vector3f
{
public:
	x: f32;
	y: f32;
	z: f32;
	global Up: Vector3f;
	global Forward: Vector3f;
	global Left: Vector3f;


public:
	fn ptr() f32* { }
	fn opAdd(pos: Point3f) Point3f { }
	fn opAdd(vec: Vector3f) Vector3f { }
	fn opAddAssign(vec: Vector3f) { }
	fn opAddAssign(v: f32) { }
	fn opSub(vec: Vector3f) Vector3f { }
	fn opSubAssign(vec: Vector3f) { }
	fn opSubAssign(v: f32) { }
	fn opNeg() Vector3f { }
	fn opMul(vec: Vector3f) Vector3f { }
	fn opMul(val: f32) Vector3f { }
	fn scale(val: f32) { }
	fn floor() { }
	fn normalize() { }
	fn length() f32 { }
	fn lengthSqrd() f32 { }
	fn dot(vec: Vector3f) f32 { }
	fn toString() string { }


public:
	static fn opCall(x: f32, y: f32, z: f32) Vector3f { }
	static fn opCall(pos: Point3f) Vector3f { }
	static fn opCall(vec: f32[3]) Vector3f { }
	static fn opCall(vec: f32[4]) Vector3f { }
}

//! Vector in a 3D space. Charge follows the OpenGL convetion for axis so
//! Y+ is up, X+ is right and Z- is forward.
struct Vector3d
{
public:
	x: f64;
	y: f64;
	z: f64;
	global Up: Vector3d;
	global Forward: Vector3d;
	global Left: Vector3d;


public:
	fn toString() string { }
}

charge.math.morton

//! Source file for morton encoding code.
module charge.math.morton;


fn encode(x: u32, y: u32) u64 { }
fn encode(x: u32, y: u32, z: u32) u64 { }
fn decode2(p: u64, result: u32[2]) { }
fn decode3(p: u64, result: u32[3]) { }
fn encode_component_2(x: u64, shift: u64) u64 { }
fn encode_component_3(x: u64, shift: u64) u64 { }
fn decode_component_2(x: u64, shift: u64) u32 { }
fn decode_component_3(x: u64, shift: u64) u32 { }

charge.math.point

//! Source file for Point3f.
module charge.math.point;


//! Point in 3D space.
struct Point3f
{
public:
	x: f32;
	y: f32;
	z: f32;


public:
	fn ptr() f32* { }
	fn opAdd(vec: Vector3f) Point3f { }
	fn opAddAssign(v: Vector3f) Point3f { }
	fn opSub(p: Point3f) Vector3f { }
	fn opSub(v: Vector3f) Point3f { }
	fn opNeg() Point3f { }
	fn opSubAssign(v: Vector3f) Point3f { }
	fn vec() Vector3f { }
	fn toString() string { }


public:
	static fn opCall() Point3f { }
	static fn opCall(x: f32, y: f32, z: f32) Point3f { }
	static fn opCall(vec: Vector3f) Point3f { }
	static fn opCall(vec: f32[3]) Point3f { }
	static fn opCall(vec: f32[4]) Point3f { }
}

charge.math.average

//! Source file for calculating a average over time.
module charge.math.average;


struct Average
{
public:
	samples: u64[32];
	pos: size_t;


public:
	fn add(value: u64) { }
	fn calc() u64 { }
}

charge.math

//! Include everything from math.
module charge.math;

public import charge.math.quat;
public import charge.math.color;
public import charge.math.point;
public import charge.math.matrix;
public import charge.math.vector;
public import charge.math.morton;
public import charge.math.frustum;
public import charge.math.average;

charge.math.frustum

//! Source file for Frustum and Plane.
module charge.math.frustum;


//! 3D Plane uses single precision.
struct Planef
{
public:
	a: f32;
	b: f32;
	c: f32;
	d: f32;


public:
	fn setFrom(p: Planed) { }
	fn toString() string { }
}

//! 3D Plane used by the Frustum struct, double precision.
struct Planed
{
public:
	a: f64;
	b: f64;
	c: f64;
	d: f64;


public:
	fn normalize() { }
	fn toString() string { }
}

//! Viewing frustum struct for use when doing Frustum culling in the
//! rendering pipeline.
struct Frustum
{
public:
	enum Planes
	{
		Left,
		Right,
		Top,
		Bottom,
		Far,
		Near,
	}


public:
	alias Left = Planes.Left;
	alias Right = Planes.Right;
	alias Top = Planes.Top;
	alias Bottom = Planes.Bottom;
	alias Far = Planes.Far;
	alias Near = Planes.Near;


public:
	p: Planed[6];


public:
	fn setFromUntransposedGL(mat: Matrix4x4d) { }
}

charge.math.quat

//! Source file for Quatf.
module charge.math.quat;


struct Quatf
{
public:
	x: f32;
	y: f32;
	z: f32;
	w: f32;


public:
	//! Return the inverse rotation of this rotation.
	fn inverse() Quatf { }
	//! Return a new quat which is this rotation rotated by the given
	//! rotation.
	fn opMul(quat: Quatf) Quatf { }
	//! Return a copy of the given vector but rotated by this rotation.
	fn opMul(vec: Vector3f) Vector3f { }
	//! Normalize the rotation, often not needed when using only the inbuilt
	//! functions.
	fn normalize() { }
	fn length() f32 { }
	fn ptr() f32* { }


public:
	static fn opCall() Quatf { }
	static fn opCall(w: f32, x: f32, y: f32, z: f32) Quatf { }
	//! Convert from Euler (and Tait-Bryan) angles to Quaternion.
	static fn opCall(heading: f32, pitch: f32, roll: f32) Quatf { }
}

charge.math.matrix

//! Source file for Matrix4x4d.
module charge.math.matrix;


//! Fov angles to make a up projection matrix, angle semantics matches
//! those of OpenXR.
struct Fovf
{
public:
	angleLeft: f32;
	angleRight: f32;
	angleUp: f32;
	angleDown: f32;


public:
	fn setToFovyAspect(fovy: f64, aspect: f64) { }
}

//! Matrix 3x3!f32, used for normal transforms.
struct Matrix3x3f
{
public:
	a: f32[9];


public:
	fn setToIdentity() { }
	fn setTo(mat: Matrix3x3d) { }
	fn setToAndTranspose(mat: Matrix3x3d) { }
	fn ptr() f32* { }
}

//! Matrix 4x4!f32, used to upload to OpenGL shaders.
struct Matrix4x4f
{
public:
	a: f32[16];


public:
	fn setToIdentity() { }
	fn setFrom(mat: Matrix4x4d) { }
	fn setToAndTranspose(mat: Matrix4x4d) { }
	fn setToMultiply(l: Matrix4x4d, r: Matrix4x4d) { }
	fn setToMultiplyAndTranspose(l: Matrix4x4d, r: Matrix4x4d) { }
	fn ptr() f32* { }
}

//! Matrix 3x3!f64, used mostly to create normal matrices.
struct Matrix3x3d
{
public:
	union Union
	{
	public:
		m: f64[3][3];
		vecs: Vector3d[3];
		a: f64[9];
	}


public:
	u: Union;


public:
	fn setToIdentity() { }
	fn setTo(mat: Matrix4x4d) { }
	fn setToInverse(mat: Matrix4x4d) { }
	fn inverseThis() { }
	fn toString() string { }
}

//! Matrix 4x4!f64, common handy matrix.
struct Matrix4x4d
{
public:
	union Union
	{
	public:
		m: f64[4][4];
		a: f64[16];
	}


public:
	u: Union;


public:
	fn setToIdentity() { }
	//! Set this matrix to a model matrix from the given position and rotation.
	fn setToModel(p: Point3f, q: Quatf) { }
	//! Set this matrix to a model matrix from the given position, rotation and
	//! scales, the variable rotPoint defines where in model scape the rotation
	//! and scale is centered.
	fn setToModel(p: Point3f, q: Quatf, s: Vector3f, rotPoint: Point3f) { }
	//! Set this matrix to a model matrix from the given position, rotation and
	//! scales.
	fn setToModel(p: Point3f, q: Quatf, s: Vector3f) { }
	fn setToOrtho(left: f64, right: f64, bottom: f64, top: f64, nearval: f64, farval: f64) { }
	//! Sets the matrix to a lookAt matrix looking at eye + rot * forward.
	fn setToLookFrom(eye: Point3f, rot: Quatf) { }
	//! Sets the matrix to the same as gluPerspective does.
	fn setToPerspective(fovy: f64, aspect: f64, near: f64, far: f64) { }
	//! Set from a set of fov angles.
	fn setToFrustum(fov: Fovf, near: f64, far: f64) { }
	//! Set to a projection matrix using fov angles, angle semantics matches
	//! those of OpenXR.
	fn setToFrustum(angleLeft: f64, angleRight: f64, angleDown: f64, angleUp: f64, near: f64, far: f64) { }
	//! Transforms a vector using only the lowest 3x3 part of the matrix, aka a
	//! normal transformation, no perspective divide.
	fn opMul(vector: Vector3f) Vector3f { }
	fn opMul(point: Point3f) Point3f { }
	fn opDiv(point: Point3f) Point3f { }
	fn setToMultiply(l: Matrix4x4d, r: Matrix4x4d) { }
	fn transpose() { }
	fn inverse() { }
	fn ptr() f64* { }
}

charge.util.stopwatch

module charge.util.stopwatch;


struct StopWatch
{
public:
	startTicks: i64;
	stopTicks: i64;


public:
	fn start() i64 { }
	fn fromInit() i64 { }
	fn startAndStop(last: StopWatch) i64 { }
	fn stop() i64 { }
	fn microseconds() i64 { }
	fn milliseconds() i64 { }
}

charge.util.properties

module charge.util.properties;


class Properties
{
public:
	this() { }
}

charge.gfx.buffer

//! Vertex buffers.
module charge.gfx.buffer;


class Buffer : sys.Resource
{
public:
	enum uri;


public:
	vao: GLuint;
	buf: GLuint;


protected:
	fn deleteBuffers() { }
}

class Builder
{
public:
	this() { }
	fn ptr() void* { }
	fn length() size_t { }
	fn close() { }
	fn add(input: void*, size: size_t) { }
	fn alignAndGetOffset(to: size_t) size_t { }
	fn resetStore(size: size_t) { }
}

//! Dereference and reference helper function.
fn reference(dec: Buffer, inc: Buffer) { }
//! Closes and sets reference to null.
fn destroy(obj: Builder) { }

charge.gfx.gfx

//! Source file for misc gfx things.
module charge.gfx.gfx;


//! Holds information about a renderer, this derived from looking at
//! extensions and various string that the rendering API exposes.
struct RendererInfo
{
public:
	glVendor: string;
	glVersion: string;
	glRenderer: string;
	isGL: bool;
	isAMD: bool;
	isNVIDIA: bool;
	isINTEL: bool;
	isMESA: bool;
	isConfidentInDetection: bool;
}

//! Has gfx been loaded.
global gfxLoaded: bool;
//! Cached information about the current rendderer, set at init by the
//! core.
global gfxRendererInfo: RendererInfo;

charge.gfx.shader

//! Source file for Shader base class.
module charge.gfx.shader;


class Shader
{
public:
	name: string;
	id: GLuint;


public:
	this(name: string, vert: string, frag: string, attr: string[], tex: string[]) { }
	this(name: string, vert: string, geom: string, frag: string) { }
	this(name: string, comp: string) { }
	this(name: string, id: GLuint) { }
	fn close() { }
	fn bind() { }
	fn unbind() { }
	fn float4(name: const(char)*, count: i32, value: f32*) { }
	fn float4(name: const(char)*, value: f32*) { }
	fn float3(name: const(char)*, count: i32, value: f32*) { }
	fn float3(name: const(char)*, value: f32*) { }
	fn float2(name: const(char)*, count: i32, value: f32*) { }
	fn float2(name: const(char)*, value: f32*) { }
	fn float1(name: const(char)*, count: i32, value: f32*) { }
	fn float1(name: const(char)*, value: f32) { }
	fn int4(name: const(char)*, value: i32*) { }
	fn int3(name: const(char)*, value: i32*) { }
	fn int2(name: const(char)*, value: i32*) { }
	fn int1(name: const(char)*, value: i32) { }
	fn matrix3(name: const(char)*, count: i32, transpose: bool, mat: math.Matrix3x3f) { }
	fn matrix4(name: const(char)*, count: i32, transpose: bool, mat: math.Matrix4x4f) { }
	fn sampler(name: const(char)*, value: i32) { }
}

//! Closes and sets reference to null.
fn destroy(obj: Shader) { }
fn makeShaderC(name: string, comp: string) GLuint { }
fn makeShaderVF(name: string, vert: string, frag: string, attr: string[], texs: string[]) GLuint { }
fn makeShaderVGF(name: string, vert: string, geom: string, frag: string) GLuint { }
fn createAndCompileShaderC(name: string, comp: string) GLuint { }
fn createAndCompileShaderVF(name: string, vert: string, frag: string) GLuint { }
fn createAndCompileShaderVGF(name: string, vert: string, geom: string, frag: string) GLuint { }
fn compileShader(shader: GLuint, source: string) { }
fn compileShaderLog(name: string, shader: GLuint, source: string, type: string) { }
fn getInfoLog(shader: GLuint, program: bool) string { }
fn getStatus(shader: GLuint, program: bool) bool { }
fn printDebug(name: string, shader: GLuint, program: bool, type: string) bool { }

charge.gfx.texture

//! Source file for Texture(s).
module charge.gfx.texture;


//! Base texture class.
class Texture : sys.Resource
{
public:
	enum uri;


public:
	target: GLuint;
	id: GLuint;
	width: u32;
	height: u32;
	depth: u32;


public:
	fn bind() { }
	fn unbind() { }
}

class Texture2D : Texture
{
public:
	static fn makeRGBA8(name: string, width: u32, height: u32, levels: u32) Texture2D { }
	static fn makeDepth24(name: string, width: u32, height: u32, levels: u32) Texture2D { }
	static fn makeAlpha(name: string, width: u32, height: u32, levels: u32) Texture2D { }
	static fn makeRGBA8MSAA(name: string, width: u32, height: u32, numSamples: u32) Texture2D { }
	static fn makeDepth24MSAA(name: string, width: u32, height: u32, numSamples: u32) Texture2D { }
	static fn makeInternalMSAA(name: string, width: u32, height: u32, numSamples: u32, internal: GLuint) Texture2D { }
	static fn makeInternal(name: string, width: u32, height: u32, levels: u32, internal: GLuint) Texture2D { }
	static fn makeId(name: string, target: GLuint, id: GLuint, width: u32, height: u32) Texture2D { }
	static fn load(filename: string) Texture2D { }
	static fn load(file: sys.File) Texture2D { }
}

class Texture2DArray : Texture
{
public:
	fn loadImageIntoLayer(file: sys.File, layer: GLint) { }


public:
	static fn makeRGBA8(name: string, width: u32, height: u32, layers: u32, levels: u32) Texture2DArray { }
	static fn makeInternal(name: string, width: u32, height: u32, layers: u32, levels: u32, internal: GLuint) Texture2DArray { }
	static fn makeId(name: string, target: GLuint, id: GLuint, width: u32, height: u32, layers: u32) Texture2DArray { }
}

//! Dereference and reference helper function.
fn reference(dec: Texture, inc: Texture) { }
//! Dereference and reference helper function.
fn reference(dec: Texture2D, inc: Texture2D) { }

charge.gfx.timetracker

//! Source file for TimeTrackers and trackers.
module charge.gfx.timetracker;


class TimeTracker
{
public:
	name: string;
	samples: math.Average;
	last: GLuint64;


public:
	this(name: string) { }
	fn startFrame() { }
	fn endFrame() { }
	fn start() { }
	fn exchange() { }
	fn stop() { }


public:
	static fn getTimings(sink: scope (Sink)) { }
}

charge.gfx.counters

//! GPU profiling counters.
module charge.gfx.counters;


class Counters
{
public:
	names: string[];
	samples: math.Average[];
	timers: Timer[];


public:
	this(names: string[]) { }
	fn close() { }
	fn start(n: size_t) { }
	fn stop(n: size_t) { }
	fn print(sink: scope (Sink)) { }
}

//! Closes and sets reference to null.
fn destroy(obj: Counters) { }

charge.gfx.draw

//! Super simple 2D drawing helper.
module charge.gfx.draw;


enum vertexShaderES;
enum fragmentShaderES;

//! VBO used for 2D drawing operations.
class DrawBuffer : Buffer
{
public:
	num: GLsizei;


public:
	fn update(vb: DrawVertexBuilder) { }


public:
	static fn make(name: string, vb: DrawVertexBuilder) DrawBuffer { }
}

class DrawVertexBuilder : Builder
{
public:
	alias add = Builder.add;


public:
	this(num: size_t) { }
	fn reset(num: size_t) { }
	fn add(x: f32, y: f32, u: f32, v: f32) { }
	fn add(x: f32, y: f32, u: f32, v: f32, color: math.Color4b) { }
	fn add(vert: DrawVertex*, num: size_t) { }
	fn bake(vao: GLuint, buf: GLuint, num: GLsizei) { }
}

//! Vertex format.
struct DrawVertex
{
public:
	x: f32;
	y: f32;
	u: f32;
	v: f32;
	color: math.Color4b;
}

//! Shader to be used with the vertex format in this file.
global drawShader: Shader;
global drawSamplerLinear: GLuint;
global drawSamplerNearest: GLuint;

//! Dereference and reference helper function.
fn reference(dec: DrawBuffer, inc: DrawBuffer) { }
//! Closes and sets reference to null.
fn destroy(obj: DrawVertexBuilder) { }
fn __ctor() { }
fn initDraw() { }
fn closeDraw() { }

charge.gfx.bitmapfont

//! Simple bitmap font.
module charge.gfx.bitmapfont;


enum tabSize;
enum Width;
enum Height;
enum GlyphWidth;
enum GlyphHeight;

struct BitmapState
{
public:
	offX: i32;
	offY: i32;
	glyphWidth: i32;
	glyphHeight: i32;
}

//! Texture that can be used for fonts.
global bitmapTexture: Texture2D;
global glyphData: immutable(char)[][160];

//! Computes the size of the bounding box for the given text.
fn buildSize(s: BitmapState, text: scope (const(scope (u8)[]), width: u32, height: u32) { }
//! Builds the vertices in builder of the given text. Uses quads, so for
//! vertices per glyph.
fn buildVertices(s: BitmapState, b: DrawVertexBuilder, text: scope (const(scope (u8)[])) { }
//! Builds the vertices in builder of the given text. Uses quads, so for
//! vertices per glyph.
fn buildVerticesGrid(s: BitmapState, b: DrawVertexBuilder, stride: u32, data: scope (const(scope (u8)[]), color: math.Color4b) { }
fn buildVertex(s: BitmapState, b: DrawVertexBuilder, x: i32, y: i32, c: u8, color: math.Color4b) { }
fn __ctor() { }
fn initBitmap() { }
fn closeBitmap() { }

charge.gfx.aa

//! Helper class for rendering a AA view to another target.
module charge.gfx.aa;


struct AA
{
public:
	enum Kind
	{
		None,
		Double,
		MSAA4,
		MSAA8,
		MSAA16,
	}


public:
	tl: TimeTracker;
	fbo: Target;
	kind: Kind;
	currentMSAA: u32;


public:
	fn close() { }
	fn toggle() { }
	fn getName() string { }
	fn bind(t: Target) { }
	fn resolveToAndBind(t: Target) { }
	fn setupFramebuffer(t: Target) { }
}

charge.gfx

//! Include everything from gfx.
module charge.gfx;

public import charge.gfx.gl;
public import charge.gfx.gfx;
public import charge.gfx.aa;
public import charge.gfx.draw;
public import charge.gfx.buffer;
public import charge.gfx.shader;
public import charge.gfx.simple;
public import charge.gfx.compiler;
public import charge.gfx.target;
public import charge.gfx.texture;
public import charge.gfx.timer;
public import charge.gfx.timetracker;
public import charge.gfx.bitmapfont;
public import charge.gfx.sync;
public import charge.gfx.counters;
public import charge.gfx.helpers;

charge.gfx.helpers

//! Helper classes to keep track of framebuffers and blit textures.
module charge.gfx.helpers;


struct FramebufferResizer
{
public:
	fbo: Framebuffer;


public:
	fn close() { }
	fn bind(t: Target, width: u32, height: u32) { }
	fn unbind(t: Target) { }
	fn setupFramebuffer(t: Target, width: u32, height: u32) { }
	fn color() Texture { }
}

struct TextureBlitter
{
public:
	fn close() { }
	fn blit(t: Target, texture: Texture, x: i32, y: i32) { }
	fn updateVBO(x: i32, y: i32, w: u32, h: u32) { }
}

charge.gfx.gl

//! OpenGL helpers.
module charge.gfx.gl;


fn glCheckError(loc: string) GLuint { }
fn glCheckFramebufferError(loc: string) GLuint { }
fn runDetection() { }
fn printDetection() { }

charge.gfx.timer

//! Source file for timers.
module charge.gfx.timer;


struct Timer
{
public:
	fn setup() { }
	fn close() { }
	fn start() { }
	fn stop() { }
	fn getValue(val: GLuint64) bool { }
}

charge.gfx.sync

//! Source file for syncing with the gpu.
module charge.gfx.sync;


//! Sync object.
struct Sync
{
public:
	//! Sync with the gpu and delete sync object or timeout happens, in
	//! milliseconds.
	fn waitAndDelete(sync: Sync, timeout: i64) bool { }
	//! Delete a sync object.
	fn close() { }


public:
	//! Insert a sync object into the GPU command stream.
	static fn insert() Sync { }
}

charge.gfx.target

//! Source file for Target(s), that is FBOs and DefaultTarget.
module charge.gfx.target;


//! Base target class, allows you to bind and unbind targets.
class Target : sys.Resource
{
public:
	enum uri;


public:
	fbo: GLuint;
	width: u32;
	height: u32;


public:
	fn bind(old: Target) { }
	fn unbind() { }
	fn bindAndCopyFrom(src: Target) { }
	fn setMatrixToOrtho(mat: math.Matrix4x4d) { }
	fn setMatrixToOrtho(mat: math.Matrix4x4d, width: f32, height: f32) { }


protected:
	mCopyFilter: GLuint;
}

//! The default fbo in OpenGL, glBindFramebuffer(GL_FRAMEBUFFER, 0).
class DefaultTarget : Target
{
public:
	fn bindDefault() { }


public:
	static fn opCall() DefaultTarget { }
	static fn close() { }
}

//! Target for a FBO made outside of charge, takes ownership of the fbo.
class ExtTarget : Target
{
public:
	static fn make(name: string, fbo: GLuint, width: u32, height: u32) ExtTarget { }
}

//! A simple color + depth framebuffer.
class Framebuffer : Target
{
public:
	color: Texture;
	depth: Texture;


public:
	static fn make(name: string, width: u32, height: u32) Framebuffer { }
}

//! A simple color + depth framebuffer, with MSAA textures.
class FramebufferMSAA : Framebuffer
{
public:
	fn bind(old: Target) { }
	fn unbind() { }


public:
	static fn make(name: string, width: u32, height: u32, samples: u32) FramebufferMSAA { }
}

//! Information about a single view to be rendered, passed alongside a
//! Target.
struct ViewInfo
{
public:
	//! A fov to be used on the given target.
	fov: math.Fovf;
	//! Used in XR mode, gives the position of the view.
	position: math.Point3f;
	//! Used in XR mode, gives the rotation of the view.
	rotation: math.Quatf;
	//! Should the fov be used or can it be filled in.
	validFov: bool;
	//! Are position and @rotation valid and should be used.
	validLocation: bool;
	//! Is this view suitable for orthogonal rendering, that is it displayed on
	//! monitor like thing or is it a XR view.
	suitableForOrtho: bool;


public:
	fn ensureValidFov(fovy: f64, t: Target) { }
}

//! Dereference and reference helper function.
fn reference(dec: Target, inc: Target) { }
//! Dereference and reference helper function.
fn reference(dec: DefaultTarget, inc: DefaultTarget) { }
//! Dereference and reference helper function.
fn reference(dec: ExtTarget, inc: ExtTarget) { }
//! Dereference and reference helper function.
fn reference(dec: Framebuffer, inc: Framebuffer) { }
//! Dereference and reference helper function.
fn reference(dec: FramebufferMSAA, inc: FramebufferMSAA) { }

charge.gfx.simple

//! Simpler object rendering code, shader, buffer and builder.
module charge.gfx.simple;


enum vertexShaderES;
enum fragmentShaderES;

//! VBO used for simple drawing operations.
class SimpleBuffer : Buffer
{
public:
	num: GLsizei;


public:
	fn update(vb: SimpleVertexBuilder) { }


public:
	static fn make(name: string, vb: SimpleVertexBuilder) SimpleBuffer { }
}

//! Building simple vertex buffers.
class SimpleVertexBuilder : Builder
{
public:
	alias add = Builder.add;


public:
	this(num: size_t) { }
	fn reset(num: size_t) { }
	fn add(x: f32, y: f32, z: f32, u: f32, v: f32) { }
	fn add(x: f32, y: f32, z: f32, u: f32, v: f32, color: math.Color4b) { }
	fn add(vert: SimpleVertex*, num: size_t) { }
	fn bake(vao: GLuint, buf: GLuint, num: GLsizei) { }
}

//! Vertex format, vec3f32 position, vec2f32 coordinate and vec4!u8 color.
struct SimpleVertex
{
public:
	x: f32;
	y: f32;
	z: f32;
	u: f32;
	v: f32;
	color: math.Color4b;
}

//! Shader to be used with the vertex format in this file.
global simpleShader: Shader;

//! Dereference and reference helper function.
fn reference(dec: SimpleBuffer, inc: SimpleBuffer) { }
//! Closes and sets reference to null.
fn destroy(obj: SimpleVertexBuilder) { }
fn __ctor() { }
fn initSimple() { }
fn closeSimple() { }

charge.gfx.compiler

//! Source file for Shader Compiler code.
module charge.gfx.compiler;


class Compiler
{
public:
	this() { }
	fn compile(comp: CompSrc, name: string) Shader { }
	fn compile(vert: VertSrc, frag: FragSrc, name: string) Shader { }
	fn getInclude(file: string) string { }
	fn addInclude(src: Src, lookupName: string) { }
}

struct Src
{
public:
	src: string;
	filename: string;


public:
	fn addInternalStart(filename: string) { }
	fn setup(src: string, filename: string, add: bool) { }
}

struct VertSrc
{
public:
	src: Src;


public:
	fn setup(src: string, filename: string, add: bool) { }
}

struct GeomSrc
{
public:
	src: Src;


public:
	fn setup(src: string, filename: string, add: bool) { }
}

struct FragSrc
{
public:
	src: Src;


public:
	fn setup(src: string, filename: string, add: bool) { }
}

struct CompSrc
{
public:
	src: Src;


public:
	fn setup(src: string, filename: string, add: bool) { }
}

lib.gl.types

module lib.gl.types;


alias GLvoid = void;
alias GLintptr = ptrdiff_t;
alias GLsizei = i32;
alias GLchar = char;
alias GLcharARB = i8;
alias GLushort = u16;
alias GLint64EXT = i64;
alias GLshort = i16;
alias GLuint64 = u64;
alias GLhalfARB = u16;
alias GLubyte = u8;
alias GLdouble = f64;
alias GLhandleARB = u32;
alias GLint64 = i64;
alias GLenum = u32;
alias GLeglImageOES = void*;
alias GLintptrARB = ptrdiff_t;
alias GLsizeiptr = ptrdiff_t;
alias GLint = i32;
alias GLboolean = u8;
alias GLbitfield = u32;
alias GLsizeiptrARB = ptrdiff_t;
alias GLfloat = f32;
alias GLuint64EXT = u64;
alias GLclampf = f32;
alias GLbyte = i8;
alias GLclampd = f64;
alias GLuint = u32;
alias GLvdpauSurfaceNV = ptrdiff_t;
alias GLfixed = i32;
alias GLhalf = u16;
alias GLclampx = i32;
alias GLhalfNV = u16;
alias __GLsync = ___GLsync*;
alias GLsync = __GLsync*;
alias _cl_context = __cl_context*;
alias _cl_event = __cl_event*;
alias GLDEBUGPROC = fn (GLenum, GLenum, GLuint, GLenum, GLsizei, const(const(GLchar)*), GLvoid*) (void);
alias GLDEBUGPROCARB = GLDEBUGPROC;
alias GLDEBUGPROCKHR = GLDEBUGPROC;
alias GLDEBUGPROCAMD = fn (GLuint, GLenum, GLenum, GLsizei, const(const(GLchar)*), GLvoid*) (void);

struct ___GLsync
{
}

struct __cl_context
{
}

struct __cl_event
{
}

lib.gl.enums

module lib.gl.enums;


enum GL_FALSE;
enum GL_TRUE;
enum GL_NO_ERROR;
enum GL_NONE;
enum GL_ZERO;
enum GL_ONE;
enum GL_NONE_OES;
enum GL_INVALID_INDEX;
enum GL_TIMEOUT_IGNORED;
enum GL_TIMEOUT_IGNORED_APPLE;
enum GL_VERSION_ES_CL_1_0;
enum GL_VERSION_ES_CM_1_1;
enum GL_VERSION_ES_CL_1_1;
enum GL_DEPTH_BUFFER_BIT;
enum GL_STENCIL_BUFFER_BIT;
enum GL_COLOR_BUFFER_BIT;
enum GL_POINTS;
enum GL_LINES;
enum GL_LINE_LOOP;
enum GL_LINE_STRIP;
enum GL_TRIANGLES;
enum GL_TRIANGLE_STRIP;
enum GL_TRIANGLE_FAN;
enum GL_NEVER;
enum GL_LESS;
enum GL_EQUAL;
enum GL_LEQUAL;
enum GL_GREATER;
enum GL_NOTEQUAL;
enum GL_GEQUAL;
enum GL_ALWAYS;
enum GL_SRC_COLOR;
enum GL_ONE_MINUS_SRC_COLOR;
enum GL_SRC_ALPHA;
enum GL_ONE_MINUS_SRC_ALPHA;
enum GL_DST_ALPHA;
enum GL_ONE_MINUS_DST_ALPHA;
enum GL_DST_COLOR;
enum GL_ONE_MINUS_DST_COLOR;
enum GL_SRC_ALPHA_SATURATE;
enum GL_FRONT_LEFT;
enum GL_FRONT_RIGHT;
enum GL_BACK_LEFT;
enum GL_BACK_RIGHT;
enum GL_FRONT;
enum GL_BACK;
enum GL_LEFT;
enum GL_RIGHT;
enum GL_FRONT_AND_BACK;
enum GL_INVALID_ENUM;
enum GL_INVALID_VALUE;
enum GL_INVALID_OPERATION;
enum GL_OUT_OF_MEMORY;
enum GL_CW;
enum GL_CCW;
enum GL_POINT_SIZE;
enum GL_POINT_SIZE_RANGE;
enum GL_POINT_SIZE_GRANULARITY;
enum GL_LINE_SMOOTH;
enum GL_LINE_WIDTH;
enum GL_LINE_WIDTH_RANGE;
enum GL_LINE_WIDTH_GRANULARITY;
enum GL_POLYGON_MODE;
enum GL_POLYGON_SMOOTH;
enum GL_CULL_FACE;
enum GL_CULL_FACE_MODE;
enum GL_FRONT_FACE;
enum GL_DEPTH_RANGE;
enum GL_DEPTH_TEST;
enum GL_DEPTH_WRITEMASK;
enum GL_DEPTH_CLEAR_VALUE;
enum GL_DEPTH_FUNC;
enum GL_STENCIL_TEST;
enum GL_STENCIL_CLEAR_VALUE;
enum GL_STENCIL_FUNC;
enum GL_STENCIL_VALUE_MASK;
enum GL_STENCIL_FAIL;
enum GL_STENCIL_PASS_DEPTH_FAIL;
enum GL_STENCIL_PASS_DEPTH_PASS;
enum GL_STENCIL_REF;
enum GL_STENCIL_WRITEMASK;
enum GL_VIEWPORT;
enum GL_DITHER;
enum GL_BLEND_DST;
enum GL_BLEND_SRC;
enum GL_BLEND;
enum GL_LOGIC_OP_MODE;
enum GL_DRAW_BUFFER;
enum GL_READ_BUFFER;
enum GL_SCISSOR_BOX;
enum GL_SCISSOR_TEST;
enum GL_COLOR_CLEAR_VALUE;
enum GL_COLOR_WRITEMASK;
enum GL_DOUBLEBUFFER;
enum GL_STEREO;
enum GL_LINE_SMOOTH_HINT;
enum GL_POLYGON_SMOOTH_HINT;
enum GL_UNPACK_SWAP_BYTES;
enum GL_UNPACK_LSB_FIRST;
enum GL_UNPACK_ROW_LENGTH;
enum GL_UNPACK_SKIP_ROWS;
enum GL_UNPACK_SKIP_PIXELS;
enum GL_UNPACK_ALIGNMENT;
enum GL_PACK_SWAP_BYTES;
enum GL_PACK_LSB_FIRST;
enum GL_PACK_ROW_LENGTH;
enum GL_PACK_SKIP_ROWS;
enum GL_PACK_SKIP_PIXELS;
enum GL_PACK_ALIGNMENT;
enum GL_MAX_TEXTURE_SIZE;
enum GL_MAX_VIEWPORT_DIMS;
enum GL_SUBPIXEL_BITS;
enum GL_TEXTURE_1D;
enum GL_TEXTURE_2D;
enum GL_TEXTURE_WIDTH;
enum GL_TEXTURE_HEIGHT;
enum GL_TEXTURE_BORDER_COLOR;
enum GL_DONT_CARE;
enum GL_FASTEST;
enum GL_NICEST;
enum GL_BYTE;
enum GL_UNSIGNED_BYTE;
enum GL_SHORT;
enum GL_UNSIGNED_SHORT;
enum GL_INT;
enum GL_UNSIGNED_INT;
enum GL_FLOAT;
enum GL_CLEAR;
enum GL_AND;
enum GL_AND_REVERSE;
enum GL_COPY;
enum GL_AND_INVERTED;
enum GL_NOOP;
enum GL_XOR;
enum GL_OR;
enum GL_NOR;
enum GL_EQUIV;
enum GL_INVERT;
enum GL_OR_REVERSE;
enum GL_COPY_INVERTED;
enum GL_OR_INVERTED;
enum GL_NAND;
enum GL_SET;
enum GL_TEXTURE;
enum GL_COLOR;
enum GL_DEPTH;
enum GL_STENCIL;
enum GL_STENCIL_INDEX;
enum GL_DEPTH_COMPONENT;
enum GL_RED;
enum GL_GREEN;
enum GL_BLUE;
enum GL_ALPHA;
enum GL_RGB;
enum GL_RGBA;
enum GL_POINT;
enum GL_LINE;
enum GL_FILL;
enum GL_KEEP;
enum GL_REPLACE;
enum GL_INCR;
enum GL_DECR;
enum GL_VENDOR;
enum GL_RENDERER;
enum GL_VERSION;
enum GL_EXTENSIONS;
enum GL_NEAREST;
enum GL_LINEAR;
enum GL_NEAREST_MIPMAP_NEAREST;
enum GL_LINEAR_MIPMAP_NEAREST;
enum GL_NEAREST_MIPMAP_LINEAR;
enum GL_LINEAR_MIPMAP_LINEAR;
enum GL_TEXTURE_MAG_FILTER;
enum GL_TEXTURE_MIN_FILTER;
enum GL_TEXTURE_WRAP_S;
enum GL_TEXTURE_WRAP_T;
enum GL_REPEAT;
enum GL_COLOR_LOGIC_OP;
enum GL_POLYGON_OFFSET_UNITS;
enum GL_POLYGON_OFFSET_POINT;
enum GL_POLYGON_OFFSET_LINE;
enum GL_POLYGON_OFFSET_FILL;
enum GL_POLYGON_OFFSET_FACTOR;
enum GL_TEXTURE_BINDING_1D;
enum GL_TEXTURE_BINDING_2D;
enum GL_TEXTURE_INTERNAL_FORMAT;
enum GL_TEXTURE_RED_SIZE;
enum GL_TEXTURE_GREEN_SIZE;
enum GL_TEXTURE_BLUE_SIZE;
enum GL_TEXTURE_ALPHA_SIZE;
enum GL_DOUBLE;
enum GL_PROXY_TEXTURE_1D;
enum GL_PROXY_TEXTURE_2D;
enum GL_R3_G3_B2;
enum GL_RGB4;
enum GL_RGB5;
enum GL_RGB8;
enum GL_RGB10;
enum GL_RGB12;
enum GL_RGB16;
enum GL_RGBA2;
enum GL_RGBA4;
enum GL_RGB5_A1;
enum GL_RGBA8;
enum GL_RGB10_A2;
enum GL_RGBA12;
enum GL_RGBA16;
enum GL_UNSIGNED_BYTE_3_3_2;
enum GL_UNSIGNED_SHORT_4_4_4_4;
enum GL_UNSIGNED_SHORT_5_5_5_1;
enum GL_UNSIGNED_INT_8_8_8_8;
enum GL_UNSIGNED_INT_10_10_10_2;
enum GL_TEXTURE_BINDING_3D;
enum GL_PACK_SKIP_IMAGES;
enum GL_PACK_IMAGE_HEIGHT;
enum GL_UNPACK_SKIP_IMAGES;
enum GL_UNPACK_IMAGE_HEIGHT;
enum GL_TEXTURE_3D;
enum GL_PROXY_TEXTURE_3D;
enum GL_TEXTURE_DEPTH;
enum GL_TEXTURE_WRAP_R;
enum GL_MAX_3D_TEXTURE_SIZE;
enum GL_UNSIGNED_BYTE_2_3_3_REV;
enum GL_UNSIGNED_SHORT_5_6_5;
enum GL_UNSIGNED_SHORT_5_6_5_REV;
enum GL_UNSIGNED_SHORT_4_4_4_4_REV;
enum GL_UNSIGNED_SHORT_1_5_5_5_REV;
enum GL_UNSIGNED_INT_8_8_8_8_REV;
enum GL_UNSIGNED_INT_2_10_10_10_REV;
enum GL_BGR;
enum GL_BGRA;
enum GL_MAX_ELEMENTS_VERTICES;
enum GL_MAX_ELEMENTS_INDICES;
enum GL_CLAMP_TO_EDGE;
enum GL_TEXTURE_MIN_LOD;
enum GL_TEXTURE_MAX_LOD;
enum GL_TEXTURE_BASE_LEVEL;
enum GL_TEXTURE_MAX_LEVEL;
enum GL_SMOOTH_POINT_SIZE_RANGE;
enum GL_SMOOTH_POINT_SIZE_GRANULARITY;
enum GL_SMOOTH_LINE_WIDTH_RANGE;
enum GL_SMOOTH_LINE_WIDTH_GRANULARITY;
enum GL_ALIASED_LINE_WIDTH_RANGE;
enum GL_TEXTURE0;
enum GL_TEXTURE1;
enum GL_TEXTURE2;
enum GL_TEXTURE3;
enum GL_TEXTURE4;
enum GL_TEXTURE5;
enum GL_TEXTURE6;
enum GL_TEXTURE7;
enum GL_TEXTURE8;
enum GL_TEXTURE9;
enum GL_TEXTURE10;
enum GL_TEXTURE11;
enum GL_TEXTURE12;
enum GL_TEXTURE13;
enum GL_TEXTURE14;
enum GL_TEXTURE15;
enum GL_TEXTURE16;
enum GL_TEXTURE17;
enum GL_TEXTURE18;
enum GL_TEXTURE19;
enum GL_TEXTURE20;
enum GL_TEXTURE21;
enum GL_TEXTURE22;
enum GL_TEXTURE23;
enum GL_TEXTURE24;
enum GL_TEXTURE25;
enum GL_TEXTURE26;
enum GL_TEXTURE27;
enum GL_TEXTURE28;
enum GL_TEXTURE29;
enum GL_TEXTURE30;
enum GL_TEXTURE31;
enum GL_ACTIVE_TEXTURE;
enum GL_MULTISAMPLE;
enum GL_SAMPLE_ALPHA_TO_COVERAGE;
enum GL_SAMPLE_ALPHA_TO_ONE;
enum GL_SAMPLE_COVERAGE;
enum GL_SAMPLE_BUFFERS;
enum GL_SAMPLES;
enum GL_SAMPLE_COVERAGE_VALUE;
enum GL_SAMPLE_COVERAGE_INVERT;
enum GL_TEXTURE_CUBE_MAP;
enum GL_TEXTURE_BINDING_CUBE_MAP;
enum GL_TEXTURE_CUBE_MAP_POSITIVE_X;
enum GL_TEXTURE_CUBE_MAP_NEGATIVE_X;
enum GL_TEXTURE_CUBE_MAP_POSITIVE_Y;
enum GL_TEXTURE_CUBE_MAP_NEGATIVE_Y;
enum GL_TEXTURE_CUBE_MAP_POSITIVE_Z;
enum GL_TEXTURE_CUBE_MAP_NEGATIVE_Z;
enum GL_PROXY_TEXTURE_CUBE_MAP;
enum GL_MAX_CUBE_MAP_TEXTURE_SIZE;
enum GL_COMPRESSED_RGB;
enum GL_COMPRESSED_RGBA;
enum GL_TEXTURE_COMPRESSION_HINT;
enum GL_TEXTURE_COMPRESSED_IMAGE_SIZE;
enum GL_TEXTURE_COMPRESSED;
enum GL_NUM_COMPRESSED_TEXTURE_FORMATS;
enum GL_COMPRESSED_TEXTURE_FORMATS;
enum GL_CLAMP_TO_BORDER;
enum GL_BLEND_DST_RGB;
enum GL_BLEND_SRC_RGB;
enum GL_BLEND_DST_ALPHA;
enum GL_BLEND_SRC_ALPHA;
enum GL_POINT_FADE_THRESHOLD_SIZE;
enum GL_DEPTH_COMPONENT16;
enum GL_DEPTH_COMPONENT24;
enum GL_DEPTH_COMPONENT32;
enum GL_MIRRORED_REPEAT;
enum GL_MAX_TEXTURE_LOD_BIAS;
enum GL_TEXTURE_LOD_BIAS;
enum GL_INCR_WRAP;
enum GL_DECR_WRAP;
enum GL_TEXTURE_DEPTH_SIZE;
enum GL_TEXTURE_COMPARE_MODE;
enum GL_TEXTURE_COMPARE_FUNC;
enum GL_BLEND_COLOR;
enum GL_BLEND_EQUATION;
enum GL_CONSTANT_COLOR;
enum GL_ONE_MINUS_CONSTANT_COLOR;
enum GL_CONSTANT_ALPHA;
enum GL_ONE_MINUS_CONSTANT_ALPHA;
enum GL_FUNC_ADD;
enum GL_FUNC_REVERSE_SUBTRACT;
enum GL_FUNC_SUBTRACT;
enum GL_MIN;
enum GL_MAX;
enum GL_BUFFER_SIZE;
enum GL_BUFFER_USAGE;
enum GL_QUERY_COUNTER_BITS;
enum GL_CURRENT_QUERY;
enum GL_QUERY_RESULT;
enum GL_QUERY_RESULT_AVAILABLE;
enum GL_ARRAY_BUFFER;
enum GL_ELEMENT_ARRAY_BUFFER;
enum GL_ARRAY_BUFFER_BINDING;
enum GL_ELEMENT_ARRAY_BUFFER_BINDING;
enum GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING;
enum GL_READ_ONLY;
enum GL_WRITE_ONLY;
enum GL_READ_WRITE;
enum GL_BUFFER_ACCESS;
enum GL_BUFFER_MAPPED;
enum GL_BUFFER_MAP_POINTER;
enum GL_STREAM_DRAW;
enum GL_STREAM_READ;
enum GL_STREAM_COPY;
enum GL_STATIC_DRAW;
enum GL_STATIC_READ;
enum GL_STATIC_COPY;
enum GL_DYNAMIC_DRAW;
enum GL_DYNAMIC_READ;
enum GL_DYNAMIC_COPY;
enum GL_SAMPLES_PASSED;
enum GL_SRC1_ALPHA;
enum GL_BLEND_EQUATION_RGB;
enum GL_VERTEX_ATTRIB_ARRAY_ENABLED;
enum GL_VERTEX_ATTRIB_ARRAY_SIZE;
enum GL_VERTEX_ATTRIB_ARRAY_STRIDE;
enum GL_VERTEX_ATTRIB_ARRAY_TYPE;
enum GL_CURRENT_VERTEX_ATTRIB;
enum GL_VERTEX_PROGRAM_POINT_SIZE;
enum GL_VERTEX_ATTRIB_ARRAY_POINTER;
enum GL_STENCIL_BACK_FUNC;
enum GL_STENCIL_BACK_FAIL;
enum GL_STENCIL_BACK_PASS_DEPTH_FAIL;
enum GL_STENCIL_BACK_PASS_DEPTH_PASS;
enum GL_MAX_DRAW_BUFFERS;
enum GL_DRAW_BUFFER0;
enum GL_DRAW_BUFFER1;
enum GL_DRAW_BUFFER2;
enum GL_DRAW_BUFFER3;
enum GL_DRAW_BUFFER4;
enum GL_DRAW_BUFFER5;
enum GL_DRAW_BUFFER6;
enum GL_DRAW_BUFFER7;
enum GL_DRAW_BUFFER8;
enum GL_DRAW_BUFFER9;
enum GL_DRAW_BUFFER10;
enum GL_DRAW_BUFFER11;
enum GL_DRAW_BUFFER12;
enum GL_DRAW_BUFFER13;
enum GL_DRAW_BUFFER14;
enum GL_DRAW_BUFFER15;
enum GL_BLEND_EQUATION_ALPHA;
enum GL_MAX_VERTEX_ATTRIBS;
enum GL_VERTEX_ATTRIB_ARRAY_NORMALIZED;
enum GL_MAX_TEXTURE_IMAGE_UNITS;
enum GL_FRAGMENT_SHADER;
enum GL_VERTEX_SHADER;
enum GL_MAX_FRAGMENT_UNIFORM_COMPONENTS;
enum GL_MAX_VERTEX_UNIFORM_COMPONENTS;
enum GL_MAX_VARYING_FLOATS;
enum GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS;
enum GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS;
enum GL_SHADER_TYPE;
enum GL_FLOAT_VEC2;
enum GL_FLOAT_VEC3;
enum GL_FLOAT_VEC4;
enum GL_INT_VEC2;
enum GL_INT_VEC3;
enum GL_INT_VEC4;
enum GL_BOOL;
enum GL_BOOL_VEC2;
enum GL_BOOL_VEC3;
enum GL_BOOL_VEC4;
enum GL_FLOAT_MAT2;
enum GL_FLOAT_MAT3;
enum GL_FLOAT_MAT4;
enum GL_SAMPLER_1D;
enum GL_SAMPLER_2D;
enum GL_SAMPLER_3D;
enum GL_SAMPLER_CUBE;
enum GL_SAMPLER_1D_SHADOW;
enum GL_SAMPLER_2D_SHADOW;
enum GL_DELETE_STATUS;
enum GL_COMPILE_STATUS;
enum GL_LINK_STATUS;
enum GL_VALIDATE_STATUS;
enum GL_INFO_LOG_LENGTH;
enum GL_ATTACHED_SHADERS;
enum GL_ACTIVE_UNIFORMS;
enum GL_ACTIVE_UNIFORM_MAX_LENGTH;
enum GL_SHADER_SOURCE_LENGTH;
enum GL_ACTIVE_ATTRIBUTES;
enum GL_ACTIVE_ATTRIBUTE_MAX_LENGTH;
enum GL_FRAGMENT_SHADER_DERIVATIVE_HINT;
enum GL_SHADING_LANGUAGE_VERSION;
enum GL_CURRENT_PROGRAM;
enum GL_POINT_SPRITE_COORD_ORIGIN;
enum GL_LOWER_LEFT;
enum GL_UPPER_LEFT;
enum GL_STENCIL_BACK_REF;
enum GL_STENCIL_BACK_VALUE_MASK;
enum GL_STENCIL_BACK_WRITEMASK;
enum GL_PIXEL_PACK_BUFFER;
enum GL_PIXEL_UNPACK_BUFFER;
enum GL_PIXEL_PACK_BUFFER_BINDING;
enum GL_PIXEL_UNPACK_BUFFER_BINDING;
enum GL_FLOAT_MAT2x3;
enum GL_FLOAT_MAT2x4;
enum GL_FLOAT_MAT3x2;
enum GL_FLOAT_MAT3x4;
enum GL_FLOAT_MAT4x2;
enum GL_FLOAT_MAT4x3;
enum GL_SRGB;
enum GL_SRGB8;
enum GL_SRGB_ALPHA;
enum GL_SRGB8_ALPHA8;
enum GL_COMPRESSED_SRGB;
enum GL_COMPRESSED_SRGB_ALPHA;
enum GL_COMPARE_REF_TO_TEXTURE;
enum GL_CLIP_DISTANCE0;
enum GL_CLIP_DISTANCE1;
enum GL_CLIP_DISTANCE2;
enum GL_CLIP_DISTANCE3;
enum GL_CLIP_DISTANCE4;
enum GL_CLIP_DISTANCE5;
enum GL_CLIP_DISTANCE6;
enum GL_CLIP_DISTANCE7;
enum GL_MAX_CLIP_DISTANCES;
enum GL_MAJOR_VERSION;
enum GL_MINOR_VERSION;
enum GL_NUM_EXTENSIONS;
enum GL_CONTEXT_FLAGS;
enum GL_COMPRESSED_RED;
enum GL_COMPRESSED_RG;
enum GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT;
enum GL_RGBA32F;
enum GL_RGB32F;
enum GL_RGBA16F;
enum GL_RGB16F;
enum GL_VERTEX_ATTRIB_ARRAY_INTEGER;
enum GL_MAX_ARRAY_TEXTURE_LAYERS;
enum GL_MIN_PROGRAM_TEXEL_OFFSET;
enum GL_MAX_PROGRAM_TEXEL_OFFSET;
enum GL_CLAMP_READ_COLOR;
enum GL_FIXED_ONLY;
enum GL_MAX_VARYING_COMPONENTS;
enum GL_TEXTURE_1D_ARRAY;
enum GL_PROXY_TEXTURE_1D_ARRAY;
enum GL_TEXTURE_2D_ARRAY;
enum GL_PROXY_TEXTURE_2D_ARRAY;
enum GL_TEXTURE_BINDING_1D_ARRAY;
enum GL_TEXTURE_BINDING_2D_ARRAY;
enum GL_R11F_G11F_B10F;
enum GL_UNSIGNED_INT_10F_11F_11F_REV;
enum GL_RGB9_E5;
enum GL_UNSIGNED_INT_5_9_9_9_REV;
enum GL_TEXTURE_SHARED_SIZE;
enum GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH;
enum GL_TRANSFORM_FEEDBACK_BUFFER_MODE;
enum GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS;
enum GL_TRANSFORM_FEEDBACK_VARYINGS;
enum GL_TRANSFORM_FEEDBACK_BUFFER_START;
enum GL_TRANSFORM_FEEDBACK_BUFFER_SIZE;
enum GL_PRIMITIVES_GENERATED;
enum GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN;
enum GL_RASTERIZER_DISCARD;
enum GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS;
enum GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS;
enum GL_INTERLEAVED_ATTRIBS;
enum GL_SEPARATE_ATTRIBS;
enum GL_TRANSFORM_FEEDBACK_BUFFER;
enum GL_TRANSFORM_FEEDBACK_BUFFER_BINDING;
enum GL_RGBA32UI;
enum GL_RGB32UI;
enum GL_RGBA16UI;
enum GL_RGB16UI;
enum GL_RGBA8UI;
enum GL_RGB8UI;
enum GL_RGBA32I;
enum GL_RGB32I;
enum GL_RGBA16I;
enum GL_RGB16I;
enum GL_RGBA8I;
enum GL_RGB8I;
enum GL_RED_INTEGER;
enum GL_GREEN_INTEGER;
enum GL_BLUE_INTEGER;
enum GL_RGB_INTEGER;
enum GL_RGBA_INTEGER;
enum GL_BGR_INTEGER;
enum GL_BGRA_INTEGER;
enum GL_SAMPLER_1D_ARRAY;
enum GL_SAMPLER_2D_ARRAY;
enum GL_SAMPLER_1D_ARRAY_SHADOW;
enum GL_SAMPLER_2D_ARRAY_SHADOW;
enum GL_SAMPLER_CUBE_SHADOW;
enum GL_UNSIGNED_INT_VEC2;
enum GL_UNSIGNED_INT_VEC3;
enum GL_UNSIGNED_INT_VEC4;
enum GL_INT_SAMPLER_1D;
enum GL_INT_SAMPLER_2D;
enum GL_INT_SAMPLER_3D;
enum GL_INT_SAMPLER_CUBE;
enum GL_INT_SAMPLER_1D_ARRAY;
enum GL_INT_SAMPLER_2D_ARRAY;
enum GL_UNSIGNED_INT_SAMPLER_1D;
enum GL_UNSIGNED_INT_SAMPLER_2D;
enum GL_UNSIGNED_INT_SAMPLER_3D;
enum GL_UNSIGNED_INT_SAMPLER_CUBE;
enum GL_UNSIGNED_INT_SAMPLER_1D_ARRAY;
enum GL_UNSIGNED_INT_SAMPLER_2D_ARRAY;
enum GL_QUERY_WAIT;
enum GL_QUERY_NO_WAIT;
enum GL_QUERY_BY_REGION_WAIT;
enum GL_QUERY_BY_REGION_NO_WAIT;
enum GL_BUFFER_ACCESS_FLAGS;
enum GL_BUFFER_MAP_LENGTH;
enum GL_BUFFER_MAP_OFFSET;
enum GL_DEPTH_COMPONENT32F;
enum GL_DEPTH32F_STENCIL8;
enum GL_FLOAT_32_UNSIGNED_INT_24_8_REV;
enum GL_INVALID_FRAMEBUFFER_OPERATION;
enum GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING;
enum GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE;
enum GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE;
enum GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE;
enum GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE;
enum GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE;
enum GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE;
enum GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE;
enum GL_FRAMEBUFFER_DEFAULT;
enum GL_FRAMEBUFFER_UNDEFINED;
enum GL_DEPTH_STENCIL_ATTACHMENT;
enum GL_MAX_RENDERBUFFER_SIZE;
enum GL_DEPTH_STENCIL;
enum GL_UNSIGNED_INT_24_8;
enum GL_DEPTH24_STENCIL8;
enum GL_TEXTURE_STENCIL_SIZE;
enum GL_TEXTURE_RED_TYPE;
enum GL_TEXTURE_GREEN_TYPE;
enum GL_TEXTURE_BLUE_TYPE;
enum GL_TEXTURE_ALPHA_TYPE;
enum GL_TEXTURE_DEPTH_TYPE;
enum GL_UNSIGNED_NORMALIZED;
enum GL_FRAMEBUFFER_BINDING;
enum GL_DRAW_FRAMEBUFFER_BINDING;
enum GL_RENDERBUFFER_BINDING;
enum GL_READ_FRAMEBUFFER;
enum GL_DRAW_FRAMEBUFFER;
enum GL_READ_FRAMEBUFFER_BINDING;
enum GL_RENDERBUFFER_SAMPLES;
enum GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE;
enum GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME;
enum GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL;
enum GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE;
enum GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER;
enum GL_FRAMEBUFFER_COMPLETE;
enum GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT;
enum GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT;
enum GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER;
enum GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER;
enum GL_FRAMEBUFFER_UNSUPPORTED;
enum GL_MAX_COLOR_ATTACHMENTS;
enum GL_COLOR_ATTACHMENT0;
enum GL_COLOR_ATTACHMENT1;
enum GL_COLOR_ATTACHMENT2;
enum GL_COLOR_ATTACHMENT3;
enum GL_COLOR_ATTACHMENT4;
enum GL_COLOR_ATTACHMENT5;
enum GL_COLOR_ATTACHMENT6;
enum GL_COLOR_ATTACHMENT7;
enum GL_COLOR_ATTACHMENT8;
enum GL_COLOR_ATTACHMENT9;
enum GL_COLOR_ATTACHMENT10;
enum GL_COLOR_ATTACHMENT11;
enum GL_COLOR_ATTACHMENT12;
enum GL_COLOR_ATTACHMENT13;
enum GL_COLOR_ATTACHMENT14;
enum GL_COLOR_ATTACHMENT15;
enum GL_COLOR_ATTACHMENT16;
enum GL_COLOR_ATTACHMENT17;
enum GL_COLOR_ATTACHMENT18;
enum GL_COLOR_ATTACHMENT19;
enum GL_COLOR_ATTACHMENT20;
enum GL_COLOR_ATTACHMENT21;
enum GL_COLOR_ATTACHMENT22;
enum GL_COLOR_ATTACHMENT23;
enum GL_COLOR_ATTACHMENT24;
enum GL_COLOR_ATTACHMENT25;
enum GL_COLOR_ATTACHMENT26;
enum GL_COLOR_ATTACHMENT27;
enum GL_COLOR_ATTACHMENT28;
enum GL_COLOR_ATTACHMENT29;
enum GL_COLOR_ATTACHMENT30;
enum GL_COLOR_ATTACHMENT31;
enum GL_DEPTH_ATTACHMENT;
enum GL_STENCIL_ATTACHMENT;
enum GL_FRAMEBUFFER;
enum GL_RENDERBUFFER;
enum GL_RENDERBUFFER_WIDTH;
enum GL_RENDERBUFFER_HEIGHT;
enum GL_RENDERBUFFER_INTERNAL_FORMAT;
enum GL_STENCIL_INDEX1;
enum GL_STENCIL_INDEX4;
enum GL_STENCIL_INDEX8;
enum GL_STENCIL_INDEX16;
enum GL_RENDERBUFFER_RED_SIZE;
enum GL_RENDERBUFFER_GREEN_SIZE;
enum GL_RENDERBUFFER_BLUE_SIZE;
enum GL_RENDERBUFFER_ALPHA_SIZE;
enum GL_RENDERBUFFER_DEPTH_SIZE;
enum GL_RENDERBUFFER_STENCIL_SIZE;
enum GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE;
enum GL_MAX_SAMPLES;
enum GL_INDEX;
enum GL_FRAMEBUFFER_SRGB;
enum GL_HALF_FLOAT;
enum GL_MAP_READ_BIT;
enum GL_MAP_WRITE_BIT;
enum GL_MAP_INVALIDATE_RANGE_BIT;
enum GL_MAP_INVALIDATE_BUFFER_BIT;
enum GL_MAP_FLUSH_EXPLICIT_BIT;
enum GL_MAP_UNSYNCHRONIZED_BIT;
enum GL_COMPRESSED_RED_RGTC1;
enum GL_COMPRESSED_SIGNED_RED_RGTC1;
enum GL_COMPRESSED_RG_RGTC2;
enum GL_COMPRESSED_SIGNED_RG_RGTC2;
enum GL_RG;
enum GL_RG_INTEGER;
enum GL_R8;
enum GL_R16;
enum GL_RG8;
enum GL_RG16;
enum GL_R16F;
enum GL_R32F;
enum GL_RG16F;
enum GL_RG32F;
enum GL_R8I;
enum GL_R8UI;
enum GL_R16I;
enum GL_R16UI;
enum GL_R32I;
enum GL_R32UI;
enum GL_RG8I;
enum GL_RG8UI;
enum GL_RG16I;
enum GL_RG16UI;
enum GL_RG32I;
enum GL_RG32UI;
enum GL_VERTEX_ARRAY_BINDING;
enum GL_SAMPLER_2D_RECT;
enum GL_SAMPLER_2D_RECT_SHADOW;
enum GL_SAMPLER_BUFFER;
enum GL_INT_SAMPLER_2D_RECT;
enum GL_INT_SAMPLER_BUFFER;
enum GL_UNSIGNED_INT_SAMPLER_2D_RECT;
enum GL_UNSIGNED_INT_SAMPLER_BUFFER;
enum GL_TEXTURE_BUFFER;
enum GL_MAX_TEXTURE_BUFFER_SIZE;
enum GL_TEXTURE_BINDING_BUFFER;
enum GL_TEXTURE_BUFFER_DATA_STORE_BINDING;
enum GL_TEXTURE_RECTANGLE;
enum GL_TEXTURE_BINDING_RECTANGLE;
enum GL_PROXY_TEXTURE_RECTANGLE;
enum GL_MAX_RECTANGLE_TEXTURE_SIZE;
enum GL_R8_SNORM;
enum GL_RG8_SNORM;
enum GL_RGB8_SNORM;
enum GL_RGBA8_SNORM;
enum GL_R16_SNORM;
enum GL_RG16_SNORM;
enum GL_RGB16_SNORM;
enum GL_RGBA16_SNORM;
enum GL_SIGNED_NORMALIZED;
enum GL_PRIMITIVE_RESTART;
enum GL_PRIMITIVE_RESTART_INDEX;
enum GL_COPY_READ_BUFFER;
enum GL_COPY_WRITE_BUFFER;
enum GL_UNIFORM_BUFFER;
enum GL_UNIFORM_BUFFER_BINDING;
enum GL_UNIFORM_BUFFER_START;
enum GL_UNIFORM_BUFFER_SIZE;
enum GL_MAX_VERTEX_UNIFORM_BLOCKS;
enum GL_MAX_GEOMETRY_UNIFORM_BLOCKS;
enum GL_MAX_FRAGMENT_UNIFORM_BLOCKS;
enum GL_MAX_COMBINED_UNIFORM_BLOCKS;
enum GL_MAX_UNIFORM_BUFFER_BINDINGS;
enum GL_MAX_UNIFORM_BLOCK_SIZE;
enum GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS;
enum GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS;
enum GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS;
enum GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT;
enum GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH;
enum GL_ACTIVE_UNIFORM_BLOCKS;
enum GL_UNIFORM_TYPE;
enum GL_UNIFORM_SIZE;
enum GL_UNIFORM_NAME_LENGTH;
enum GL_UNIFORM_BLOCK_INDEX;
enum GL_UNIFORM_OFFSET;
enum GL_UNIFORM_ARRAY_STRIDE;
enum GL_UNIFORM_MATRIX_STRIDE;
enum GL_UNIFORM_IS_ROW_MAJOR;
enum GL_UNIFORM_BLOCK_BINDING;
enum GL_UNIFORM_BLOCK_DATA_SIZE;
enum GL_UNIFORM_BLOCK_NAME_LENGTH;
enum GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS;
enum GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES;
enum GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER;
enum GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER;
enum GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER;
enum GL_CONTEXT_CORE_PROFILE_BIT;
enum GL_CONTEXT_COMPATIBILITY_PROFILE_BIT;
enum GL_LINES_ADJACENCY;
enum GL_LINE_STRIP_ADJACENCY;
enum GL_TRIANGLES_ADJACENCY;
enum GL_TRIANGLE_STRIP_ADJACENCY;
enum GL_PROGRAM_POINT_SIZE;
enum GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS;
enum GL_FRAMEBUFFER_ATTACHMENT_LAYERED;
enum GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS;
enum GL_GEOMETRY_SHADER;
enum GL_GEOMETRY_VERTICES_OUT;
enum GL_GEOMETRY_INPUT_TYPE;
enum GL_GEOMETRY_OUTPUT_TYPE;
enum GL_MAX_GEOMETRY_UNIFORM_COMPONENTS;
enum GL_MAX_GEOMETRY_OUTPUT_VERTICES;
enum GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS;
enum GL_MAX_VERTEX_OUTPUT_COMPONENTS;
enum GL_MAX_GEOMETRY_INPUT_COMPONENTS;
enum GL_MAX_GEOMETRY_OUTPUT_COMPONENTS;
enum GL_MAX_FRAGMENT_INPUT_COMPONENTS;
enum GL_CONTEXT_PROFILE_MASK;
enum GL_DEPTH_CLAMP;
enum GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION;
enum GL_FIRST_VERTEX_CONVENTION;
enum GL_LAST_VERTEX_CONVENTION;
enum GL_PROVOKING_VERTEX;
enum GL_TEXTURE_CUBE_MAP_SEAMLESS;
enum GL_MAX_SERVER_WAIT_TIMEOUT;
enum GL_OBJECT_TYPE;
enum GL_SYNC_CONDITION;
enum GL_SYNC_STATUS;
enum GL_SYNC_FLAGS;
enum GL_SYNC_FENCE;
enum GL_SYNC_GPU_COMMANDS_COMPLETE;
enum GL_UNSIGNALED;
enum GL_SIGNALED;
enum GL_ALREADY_SIGNALED;
enum GL_TIMEOUT_EXPIRED;
enum GL_CONDITION_SATISFIED;
enum GL_WAIT_FAILED;
enum GL_SYNC_FLUSH_COMMANDS_BIT;
enum GL_SAMPLE_POSITION;
enum GL_SAMPLE_MASK;
enum GL_SAMPLE_MASK_VALUE;
enum GL_MAX_SAMPLE_MASK_WORDS;
enum GL_TEXTURE_2D_MULTISAMPLE;
enum GL_PROXY_TEXTURE_2D_MULTISAMPLE;
enum GL_TEXTURE_2D_MULTISAMPLE_ARRAY;
enum GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY;
enum GL_TEXTURE_BINDING_2D_MULTISAMPLE;
enum GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY;
enum GL_TEXTURE_SAMPLES;
enum GL_TEXTURE_FIXED_SAMPLE_LOCATIONS;
enum GL_SAMPLER_2D_MULTISAMPLE;
enum GL_INT_SAMPLER_2D_MULTISAMPLE;
enum GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE;
enum GL_SAMPLER_2D_MULTISAMPLE_ARRAY;
enum GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY;
enum GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY;
enum GL_MAX_COLOR_TEXTURE_SAMPLES;
enum GL_MAX_DEPTH_TEXTURE_SAMPLES;
enum GL_MAX_INTEGER_SAMPLES;
enum GL_VERTEX_ATTRIB_ARRAY_DIVISOR;
enum GL_SRC1_COLOR;
enum GL_ONE_MINUS_SRC1_COLOR;
enum GL_ONE_MINUS_SRC1_ALPHA;
enum GL_MAX_DUAL_SOURCE_DRAW_BUFFERS;
enum GL_ANY_SAMPLES_PASSED;
enum GL_SAMPLER_BINDING;
enum GL_RGB10_A2UI;
enum GL_TEXTURE_SWIZZLE_R;
enum GL_TEXTURE_SWIZZLE_G;
enum GL_TEXTURE_SWIZZLE_B;
enum GL_TEXTURE_SWIZZLE_A;
enum GL_TEXTURE_SWIZZLE_RGBA;
enum GL_TIME_ELAPSED;
enum GL_TIMESTAMP;
enum GL_INT_2_10_10_10_REV;
enum GL_SAMPLE_SHADING;
enum GL_MIN_SAMPLE_SHADING_VALUE;
enum GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET;
enum GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET;
enum GL_TEXTURE_CUBE_MAP_ARRAY;
enum GL_TEXTURE_BINDING_CUBE_MAP_ARRAY;
enum GL_PROXY_TEXTURE_CUBE_MAP_ARRAY;
enum GL_SAMPLER_CUBE_MAP_ARRAY;
enum GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW;
enum GL_INT_SAMPLER_CUBE_MAP_ARRAY;
enum GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY;
enum GL_DRAW_INDIRECT_BUFFER;
enum GL_DRAW_INDIRECT_BUFFER_BINDING;
enum GL_GEOMETRY_SHADER_INVOCATIONS;
enum GL_MAX_GEOMETRY_SHADER_INVOCATIONS;
enum GL_MIN_FRAGMENT_INTERPOLATION_OFFSET;
enum GL_MAX_FRAGMENT_INTERPOLATION_OFFSET;
enum GL_FRAGMENT_INTERPOLATION_OFFSET_BITS;
enum GL_MAX_VERTEX_STREAMS;
enum GL_DOUBLE_VEC2;
enum GL_DOUBLE_VEC3;
enum GL_DOUBLE_VEC4;
enum GL_DOUBLE_MAT2;
enum GL_DOUBLE_MAT3;
enum GL_DOUBLE_MAT4;
enum GL_DOUBLE_MAT2x3;
enum GL_DOUBLE_MAT2x4;
enum GL_DOUBLE_MAT3x2;
enum GL_DOUBLE_MAT3x4;
enum GL_DOUBLE_MAT4x2;
enum GL_DOUBLE_MAT4x3;
enum GL_ACTIVE_SUBROUTINES;
enum GL_ACTIVE_SUBROUTINE_UNIFORMS;
enum GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS;
enum GL_ACTIVE_SUBROUTINE_MAX_LENGTH;
enum GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH;
enum GL_MAX_SUBROUTINES;
enum GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS;
enum GL_NUM_COMPATIBLE_SUBROUTINES;
enum GL_COMPATIBLE_SUBROUTINES;
enum GL_PATCHES;
enum GL_PATCH_VERTICES;
enum GL_PATCH_DEFAULT_INNER_LEVEL;
enum GL_PATCH_DEFAULT_OUTER_LEVEL;
enum GL_TESS_CONTROL_OUTPUT_VERTICES;
enum GL_TESS_GEN_MODE;
enum GL_TESS_GEN_SPACING;
enum GL_TESS_GEN_VERTEX_ORDER;
enum GL_TESS_GEN_POINT_MODE;
enum GL_ISOLINES;
enum GL_FRACTIONAL_ODD;
enum GL_FRACTIONAL_EVEN;
enum GL_MAX_PATCH_VERTICES;
enum GL_MAX_TESS_GEN_LEVEL;
enum GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS;
enum GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS;
enum GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS;
enum GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS;
enum GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS;
enum GL_MAX_TESS_PATCH_COMPONENTS;
enum GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS;
enum GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS;
enum GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS;
enum GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS;
enum GL_MAX_TESS_CONTROL_INPUT_COMPONENTS;
enum GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS;
enum GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS;
enum GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS;
enum GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER;
enum GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER;
enum GL_TESS_EVALUATION_SHADER;
enum GL_TESS_CONTROL_SHADER;
enum GL_TRANSFORM_FEEDBACK;
enum GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED;
enum GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE;
enum GL_TRANSFORM_FEEDBACK_BINDING;
enum GL_MAX_TRANSFORM_FEEDBACK_BUFFERS;
enum GL_FIXED;
enum GL_IMPLEMENTATION_COLOR_READ_TYPE;
enum GL_IMPLEMENTATION_COLOR_READ_FORMAT;
enum GL_LOW_FLOAT;
enum GL_MEDIUM_FLOAT;
enum GL_HIGH_FLOAT;
enum GL_LOW_INT;
enum GL_MEDIUM_INT;
enum GL_HIGH_INT;
enum GL_SHADER_COMPILER;
enum GL_SHADER_BINARY_FORMATS;
enum GL_NUM_SHADER_BINARY_FORMATS;
enum GL_MAX_VERTEX_UNIFORM_VECTORS;
enum GL_MAX_VARYING_VECTORS;
enum GL_MAX_FRAGMENT_UNIFORM_VECTORS;
enum GL_RGB565;
enum GL_PROGRAM_BINARY_RETRIEVABLE_HINT;
enum GL_PROGRAM_BINARY_LENGTH;
enum GL_NUM_PROGRAM_BINARY_FORMATS;
enum GL_PROGRAM_BINARY_FORMATS;
enum GL_VERTEX_SHADER_BIT;
enum GL_FRAGMENT_SHADER_BIT;
enum GL_GEOMETRY_SHADER_BIT;
enum GL_TESS_CONTROL_SHADER_BIT;
enum GL_TESS_EVALUATION_SHADER_BIT;
enum GL_ALL_SHADER_BITS;
enum GL_PROGRAM_SEPARABLE;
enum GL_ACTIVE_PROGRAM;
enum GL_PROGRAM_PIPELINE_BINDING;
enum GL_MAX_VIEWPORTS;
enum GL_VIEWPORT_SUBPIXEL_BITS;
enum GL_VIEWPORT_BOUNDS_RANGE;
enum GL_LAYER_PROVOKING_VERTEX;
enum GL_VIEWPORT_INDEX_PROVOKING_VERTEX;
enum GL_UNDEFINED_VERTEX;
enum GL_COPY_READ_BUFFER_BINDING;
enum GL_COPY_WRITE_BUFFER_BINDING;
enum GL_TRANSFORM_FEEDBACK_ACTIVE;
enum GL_TRANSFORM_FEEDBACK_PAUSED;
enum GL_UNPACK_COMPRESSED_BLOCK_WIDTH;
enum GL_UNPACK_COMPRESSED_BLOCK_HEIGHT;
enum GL_UNPACK_COMPRESSED_BLOCK_DEPTH;
enum GL_UNPACK_COMPRESSED_BLOCK_SIZE;
enum GL_PACK_COMPRESSED_BLOCK_WIDTH;
enum GL_PACK_COMPRESSED_BLOCK_HEIGHT;
enum GL_PACK_COMPRESSED_BLOCK_DEPTH;
enum GL_PACK_COMPRESSED_BLOCK_SIZE;
enum GL_NUM_SAMPLE_COUNTS;
enum GL_MIN_MAP_BUFFER_ALIGNMENT;
enum GL_ATOMIC_COUNTER_BUFFER;
enum GL_ATOMIC_COUNTER_BUFFER_BINDING;
enum GL_ATOMIC_COUNTER_BUFFER_START;
enum GL_ATOMIC_COUNTER_BUFFER_SIZE;
enum GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE;
enum GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS;
enum GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES;
enum GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER;
enum GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER;
enum GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER;
enum GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER;
enum GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER;
enum GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS;
enum GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS;
enum GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS;
enum GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS;
enum GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS;
enum GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS;
enum GL_MAX_VERTEX_ATOMIC_COUNTERS;
enum GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS;
enum GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS;
enum GL_MAX_GEOMETRY_ATOMIC_COUNTERS;
enum GL_MAX_FRAGMENT_ATOMIC_COUNTERS;
enum GL_MAX_COMBINED_ATOMIC_COUNTERS;
enum GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE;
enum GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS;
enum GL_ACTIVE_ATOMIC_COUNTER_BUFFERS;
enum GL_UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX;
enum GL_UNSIGNED_INT_ATOMIC_COUNTER;
enum GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT;
enum GL_ELEMENT_ARRAY_BARRIER_BIT;
enum GL_UNIFORM_BARRIER_BIT;
enum GL_TEXTURE_FETCH_BARRIER_BIT;
enum GL_SHADER_IMAGE_ACCESS_BARRIER_BIT;
enum GL_COMMAND_BARRIER_BIT;
enum GL_PIXEL_BUFFER_BARRIER_BIT;
enum GL_TEXTURE_UPDATE_BARRIER_BIT;
enum GL_BUFFER_UPDATE_BARRIER_BIT;
enum GL_FRAMEBUFFER_BARRIER_BIT;
enum GL_TRANSFORM_FEEDBACK_BARRIER_BIT;
enum GL_ATOMIC_COUNTER_BARRIER_BIT;
enum GL_ALL_BARRIER_BITS;
enum GL_MAX_IMAGE_UNITS;
enum GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS;
enum GL_IMAGE_BINDING_NAME;
enum GL_IMAGE_BINDING_LEVEL;
enum GL_IMAGE_BINDING_LAYERED;
enum GL_IMAGE_BINDING_LAYER;
enum GL_IMAGE_BINDING_ACCESS;
enum GL_IMAGE_1D;
enum GL_IMAGE_2D;
enum GL_IMAGE_3D;
enum GL_IMAGE_2D_RECT;
enum GL_IMAGE_CUBE;
enum GL_IMAGE_BUFFER;
enum GL_IMAGE_1D_ARRAY;
enum GL_IMAGE_2D_ARRAY;
enum GL_IMAGE_CUBE_MAP_ARRAY;
enum GL_IMAGE_2D_MULTISAMPLE;
enum GL_IMAGE_2D_MULTISAMPLE_ARRAY;
enum GL_INT_IMAGE_1D;
enum GL_INT_IMAGE_2D;
enum GL_INT_IMAGE_3D;
enum GL_INT_IMAGE_2D_RECT;
enum GL_INT_IMAGE_CUBE;
enum GL_INT_IMAGE_BUFFER;
enum GL_INT_IMAGE_1D_ARRAY;
enum GL_INT_IMAGE_2D_ARRAY;
enum GL_INT_IMAGE_CUBE_MAP_ARRAY;
enum GL_INT_IMAGE_2D_MULTISAMPLE;
enum GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY;
enum GL_UNSIGNED_INT_IMAGE_1D;
enum GL_UNSIGNED_INT_IMAGE_2D;
enum GL_UNSIGNED_INT_IMAGE_3D;
enum GL_UNSIGNED_INT_IMAGE_2D_RECT;
enum GL_UNSIGNED_INT_IMAGE_CUBE;
enum GL_UNSIGNED_INT_IMAGE_BUFFER;
enum GL_UNSIGNED_INT_IMAGE_1D_ARRAY;
enum GL_UNSIGNED_INT_IMAGE_2D_ARRAY;
enum GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY;
enum GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE;
enum GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY;
enum GL_MAX_IMAGE_SAMPLES;
enum GL_IMAGE_BINDING_FORMAT;
enum GL_IMAGE_FORMAT_COMPATIBILITY_TYPE;
enum GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE;
enum GL_IMAGE_FORMAT_COMPATIBILITY_BY_CLASS;
enum GL_MAX_VERTEX_IMAGE_UNIFORMS;
enum GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS;
enum GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS;
enum GL_MAX_GEOMETRY_IMAGE_UNIFORMS;
enum GL_MAX_FRAGMENT_IMAGE_UNIFORMS;
enum GL_MAX_COMBINED_IMAGE_UNIFORMS;
enum GL_COMPRESSED_RGBA_BPTC_UNORM;
enum GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM;
enum GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT;
enum GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT;
enum GL_TEXTURE_IMMUTABLE_FORMAT;
enum GL_NUM_SHADING_LANGUAGE_VERSIONS;
enum GL_VERTEX_ATTRIB_ARRAY_LONG;
enum GL_COMPRESSED_RGB8_ETC2;
enum GL_COMPRESSED_SRGB8_ETC2;
enum GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2;
enum GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2;
enum GL_COMPRESSED_RGBA8_ETC2_EAC;
enum GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC;
enum GL_COMPRESSED_R11_EAC;
enum GL_COMPRESSED_SIGNED_R11_EAC;
enum GL_COMPRESSED_RG11_EAC;
enum GL_COMPRESSED_SIGNED_RG11_EAC;
enum GL_PRIMITIVE_RESTART_FIXED_INDEX;
enum GL_ANY_SAMPLES_PASSED_CONSERVATIVE;
enum GL_MAX_ELEMENT_INDEX;
enum GL_COMPUTE_SHADER;
enum GL_MAX_COMPUTE_UNIFORM_BLOCKS;
enum GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS;
enum GL_MAX_COMPUTE_IMAGE_UNIFORMS;
enum GL_MAX_COMPUTE_SHARED_MEMORY_SIZE;
enum GL_MAX_COMPUTE_UNIFORM_COMPONENTS;
enum GL_MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS;
enum GL_MAX_COMPUTE_ATOMIC_COUNTERS;
enum GL_MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS;
enum GL_MAX_COMPUTE_WORK_GROUP_INVOCATIONS;
enum GL_MAX_COMPUTE_WORK_GROUP_COUNT;
enum GL_MAX_COMPUTE_WORK_GROUP_SIZE;
enum GL_COMPUTE_WORK_GROUP_SIZE;
enum GL_UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER;
enum GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER;
enum GL_DISPATCH_INDIRECT_BUFFER;
enum GL_DISPATCH_INDIRECT_BUFFER_BINDING;
enum GL_COMPUTE_SHADER_BIT;
enum GL_DEBUG_OUTPUT_SYNCHRONOUS;
enum GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH;
enum GL_DEBUG_CALLBACK_FUNCTION;
enum GL_DEBUG_CALLBACK_USER_PARAM;
enum GL_DEBUG_SOURCE_API;
enum GL_DEBUG_SOURCE_WINDOW_SYSTEM;
enum GL_DEBUG_SOURCE_SHADER_COMPILER;
enum GL_DEBUG_SOURCE_THIRD_PARTY;
enum GL_DEBUG_SOURCE_APPLICATION;
enum GL_DEBUG_SOURCE_OTHER;
enum GL_DEBUG_TYPE_ERROR;
enum GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR;
enum GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR;
enum GL_DEBUG_TYPE_PORTABILITY;
enum GL_DEBUG_TYPE_PERFORMANCE;
enum GL_DEBUG_TYPE_OTHER;
enum GL_MAX_DEBUG_MESSAGE_LENGTH;
enum GL_MAX_DEBUG_LOGGED_MESSAGES;
enum GL_DEBUG_LOGGED_MESSAGES;
enum GL_DEBUG_SEVERITY_HIGH;
enum GL_DEBUG_SEVERITY_MEDIUM;
enum GL_DEBUG_SEVERITY_LOW;
enum GL_DEBUG_TYPE_MARKER;
enum GL_DEBUG_TYPE_PUSH_GROUP;
enum GL_DEBUG_TYPE_POP_GROUP;
enum GL_DEBUG_SEVERITY_NOTIFICATION;
enum GL_MAX_DEBUG_GROUP_STACK_DEPTH;
enum GL_DEBUG_GROUP_STACK_DEPTH;
enum GL_BUFFER;
enum GL_SHADER;
enum GL_PROGRAM;
enum GL_QUERY;
enum GL_PROGRAM_PIPELINE;
enum GL_SAMPLER;
enum GL_MAX_LABEL_LENGTH;
enum GL_DEBUG_OUTPUT;
enum GL_CONTEXT_FLAG_DEBUG_BIT;
enum GL_MAX_UNIFORM_LOCATIONS;
enum GL_FRAMEBUFFER_DEFAULT_WIDTH;
enum GL_FRAMEBUFFER_DEFAULT_HEIGHT;
enum GL_FRAMEBUFFER_DEFAULT_LAYERS;
enum GL_FRAMEBUFFER_DEFAULT_SAMPLES;
enum GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS;
enum GL_MAX_FRAMEBUFFER_WIDTH;
enum GL_MAX_FRAMEBUFFER_HEIGHT;
enum GL_MAX_FRAMEBUFFER_LAYERS;
enum GL_MAX_FRAMEBUFFER_SAMPLES;
enum GL_INTERNALFORMAT_SUPPORTED;
enum GL_INTERNALFORMAT_PREFERRED;
enum GL_INTERNALFORMAT_RED_SIZE;
enum GL_INTERNALFORMAT_GREEN_SIZE;
enum GL_INTERNALFORMAT_BLUE_SIZE;
enum GL_INTERNALFORMAT_ALPHA_SIZE;
enum GL_INTERNALFORMAT_DEPTH_SIZE;
enum GL_INTERNALFORMAT_STENCIL_SIZE;
enum GL_INTERNALFORMAT_SHARED_SIZE;
enum GL_INTERNALFORMAT_RED_TYPE;
enum GL_INTERNALFORMAT_GREEN_TYPE;
enum GL_INTERNALFORMAT_BLUE_TYPE;
enum GL_INTERNALFORMAT_ALPHA_TYPE;
enum GL_INTERNALFORMAT_DEPTH_TYPE;
enum GL_INTERNALFORMAT_STENCIL_TYPE;
enum GL_MAX_WIDTH;
enum GL_MAX_HEIGHT;
enum GL_MAX_DEPTH;
enum GL_MAX_LAYERS;
enum GL_MAX_COMBINED_DIMENSIONS;
enum GL_COLOR_COMPONENTS;
enum GL_DEPTH_COMPONENTS;
enum GL_STENCIL_COMPONENTS;
enum GL_COLOR_RENDERABLE;
enum GL_DEPTH_RENDERABLE;
enum GL_STENCIL_RENDERABLE;
enum GL_FRAMEBUFFER_RENDERABLE;
enum GL_FRAMEBUFFER_RENDERABLE_LAYERED;
enum GL_FRAMEBUFFER_BLEND;
enum GL_READ_PIXELS;
enum GL_READ_PIXELS_FORMAT;
enum GL_READ_PIXELS_TYPE;
enum GL_TEXTURE_IMAGE_FORMAT;
enum GL_TEXTURE_IMAGE_TYPE;
enum GL_GET_TEXTURE_IMAGE_FORMAT;
enum GL_GET_TEXTURE_IMAGE_TYPE;
enum GL_MIPMAP;
enum GL_MANUAL_GENERATE_MIPMAP;
enum GL_AUTO_GENERATE_MIPMAP;
enum GL_COLOR_ENCODING;
enum GL_SRGB_READ;
enum GL_SRGB_WRITE;
enum GL_FILTER;
enum GL_VERTEX_TEXTURE;
enum GL_TESS_CONTROL_TEXTURE;
enum GL_TESS_EVALUATION_TEXTURE;
enum GL_GEOMETRY_TEXTURE;
enum GL_FRAGMENT_TEXTURE;
enum GL_COMPUTE_TEXTURE;
enum GL_TEXTURE_SHADOW;
enum GL_TEXTURE_GATHER;
enum GL_TEXTURE_GATHER_SHADOW;
enum GL_SHADER_IMAGE_LOAD;
enum GL_SHADER_IMAGE_STORE;
enum GL_SHADER_IMAGE_ATOMIC;
enum GL_IMAGE_TEXEL_SIZE;
enum GL_IMAGE_COMPATIBILITY_CLASS;
enum GL_IMAGE_PIXEL_FORMAT;
enum GL_IMAGE_PIXEL_TYPE;
enum GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_TEST;
enum GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_TEST;
enum GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_WRITE;
enum GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_WRITE;
enum GL_TEXTURE_COMPRESSED_BLOCK_WIDTH;
enum GL_TEXTURE_COMPRESSED_BLOCK_HEIGHT;
enum GL_TEXTURE_COMPRESSED_BLOCK_SIZE;
enum GL_CLEAR_BUFFER;
enum GL_TEXTURE_VIEW;
enum GL_VIEW_COMPATIBILITY_CLASS;
enum GL_FULL_SUPPORT;
enum GL_CAVEAT_SUPPORT;
enum GL_IMAGE_CLASS_4_X_32;
enum GL_IMAGE_CLASS_2_X_32;
enum GL_IMAGE_CLASS_1_X_32;
enum GL_IMAGE_CLASS_4_X_16;
enum GL_IMAGE_CLASS_2_X_16;
enum GL_IMAGE_CLASS_1_X_16;
enum GL_IMAGE_CLASS_4_X_8;
enum GL_IMAGE_CLASS_2_X_8;
enum GL_IMAGE_CLASS_1_X_8;
enum GL_IMAGE_CLASS_11_11_10;
enum GL_IMAGE_CLASS_10_10_10_2;
enum GL_VIEW_CLASS_128_BITS;
enum GL_VIEW_CLASS_96_BITS;
enum GL_VIEW_CLASS_64_BITS;
enum GL_VIEW_CLASS_48_BITS;
enum GL_VIEW_CLASS_32_BITS;
enum GL_VIEW_CLASS_24_BITS;
enum GL_VIEW_CLASS_16_BITS;
enum GL_VIEW_CLASS_8_BITS;
enum GL_VIEW_CLASS_S3TC_DXT1_RGB;
enum GL_VIEW_CLASS_S3TC_DXT1_RGBA;
enum GL_VIEW_CLASS_S3TC_DXT3_RGBA;
enum GL_VIEW_CLASS_S3TC_DXT5_RGBA;
enum GL_VIEW_CLASS_RGTC1_RED;
enum GL_VIEW_CLASS_RGTC2_RG;
enum GL_VIEW_CLASS_BPTC_UNORM;
enum GL_VIEW_CLASS_BPTC_FLOAT;
enum GL_UNIFORM;
enum GL_UNIFORM_BLOCK;
enum GL_PROGRAM_INPUT;
enum GL_PROGRAM_OUTPUT;
enum GL_BUFFER_VARIABLE;
enum GL_SHADER_STORAGE_BLOCK;
enum GL_VERTEX_SUBROUTINE;
enum GL_TESS_CONTROL_SUBROUTINE;
enum GL_TESS_EVALUATION_SUBROUTINE;
enum GL_GEOMETRY_SUBROUTINE;
enum GL_FRAGMENT_SUBROUTINE;
enum GL_COMPUTE_SUBROUTINE;
enum GL_VERTEX_SUBROUTINE_UNIFORM;
enum GL_TESS_CONTROL_SUBROUTINE_UNIFORM;
enum GL_TESS_EVALUATION_SUBROUTINE_UNIFORM;
enum GL_GEOMETRY_SUBROUTINE_UNIFORM;
enum GL_FRAGMENT_SUBROUTINE_UNIFORM;
enum GL_COMPUTE_SUBROUTINE_UNIFORM;
enum GL_TRANSFORM_FEEDBACK_VARYING;
enum GL_ACTIVE_RESOURCES;
enum GL_MAX_NAME_LENGTH;
enum GL_MAX_NUM_ACTIVE_VARIABLES;
enum GL_MAX_NUM_COMPATIBLE_SUBROUTINES;
enum GL_NAME_LENGTH;
enum GL_TYPE;
enum GL_ARRAY_SIZE;
enum GL_OFFSET;
enum GL_BLOCK_INDEX;
enum GL_ARRAY_STRIDE;
enum GL_MATRIX_STRIDE;
enum GL_IS_ROW_MAJOR;
enum GL_ATOMIC_COUNTER_BUFFER_INDEX;
enum GL_BUFFER_BINDING;
enum GL_BUFFER_DATA_SIZE;
enum GL_NUM_ACTIVE_VARIABLES;
enum GL_ACTIVE_VARIABLES;
enum GL_REFERENCED_BY_VERTEX_SHADER;
enum GL_REFERENCED_BY_TESS_CONTROL_SHADER;
enum GL_REFERENCED_BY_TESS_EVALUATION_SHADER;
enum GL_REFERENCED_BY_GEOMETRY_SHADER;
enum GL_REFERENCED_BY_FRAGMENT_SHADER;
enum GL_REFERENCED_BY_COMPUTE_SHADER;
enum GL_TOP_LEVEL_ARRAY_SIZE;
enum GL_TOP_LEVEL_ARRAY_STRIDE;
enum GL_LOCATION;
enum GL_LOCATION_INDEX;
enum GL_IS_PER_PATCH;
enum GL_SHADER_STORAGE_BUFFER;
enum GL_SHADER_STORAGE_BUFFER_BINDING;
enum GL_SHADER_STORAGE_BUFFER_START;
enum GL_SHADER_STORAGE_BUFFER_SIZE;
enum GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS;
enum GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS;
enum GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS;
enum GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS;
enum GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS;
enum GL_MAX_COMPUTE_SHADER_STORAGE_BLOCKS;
enum GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS;
enum GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS;
enum GL_MAX_SHADER_STORAGE_BLOCK_SIZE;
enum GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT;
enum GL_SHADER_STORAGE_BARRIER_BIT;
enum GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES;
enum GL_DEPTH_STENCIL_TEXTURE_MODE;
enum GL_TEXTURE_BUFFER_OFFSET;
enum GL_TEXTURE_BUFFER_SIZE;
enum GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT;
enum GL_TEXTURE_VIEW_MIN_LEVEL;
enum GL_TEXTURE_VIEW_NUM_LEVELS;
enum GL_TEXTURE_VIEW_MIN_LAYER;
enum GL_TEXTURE_VIEW_NUM_LAYERS;
enum GL_TEXTURE_IMMUTABLE_LEVELS;
enum GL_VERTEX_ATTRIB_BINDING;
enum GL_VERTEX_ATTRIB_RELATIVE_OFFSET;
enum GL_VERTEX_BINDING_DIVISOR;
enum GL_VERTEX_BINDING_OFFSET;
enum GL_VERTEX_BINDING_STRIDE;
enum GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET;
enum GL_MAX_VERTEX_ATTRIB_BINDINGS;
enum GL_VERTEX_BINDING_BUFFER;
enum GL_DISPLAY_LIST;
enum GL_MAX_VERTEX_ATTRIB_STRIDE;
enum GL_PRIMITIVE_RESTART_FOR_PATCHES_SUPPORTED;
enum GL_TEXTURE_BUFFER_BINDING;
enum GL_MAP_PERSISTENT_BIT;
enum GL_MAP_COHERENT_BIT;
enum GL_DYNAMIC_STORAGE_BIT;
enum GL_CLIENT_STORAGE_BIT;
enum GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT;
enum GL_BUFFER_IMMUTABLE_STORAGE;
enum GL_BUFFER_STORAGE_FLAGS;
enum GL_CLEAR_TEXTURE;
enum GL_LOCATION_COMPONENT;
enum GL_TRANSFORM_FEEDBACK_BUFFER_INDEX;
enum GL_TRANSFORM_FEEDBACK_BUFFER_STRIDE;
enum GL_QUERY_BUFFER;
enum GL_QUERY_BUFFER_BARRIER_BIT;
enum GL_QUERY_BUFFER_BINDING;
enum GL_QUERY_RESULT_NO_WAIT;
enum GL_MIRROR_CLAMP_TO_EDGE;
enum GL_CONTEXT_LOST;
enum GL_NEGATIVE_ONE_TO_ONE;
enum GL_ZERO_TO_ONE;
enum GL_CLIP_ORIGIN;
enum GL_CLIP_DEPTH_MODE;
enum GL_QUERY_WAIT_INVERTED;
enum GL_QUERY_NO_WAIT_INVERTED;
enum GL_QUERY_BY_REGION_WAIT_INVERTED;
enum GL_QUERY_BY_REGION_NO_WAIT_INVERTED;
enum GL_MAX_CULL_DISTANCES;
enum GL_MAX_COMBINED_CLIP_AND_CULL_DISTANCES;
enum GL_TEXTURE_TARGET;
enum GL_QUERY_TARGET;
enum GL_GUILTY_CONTEXT_RESET;
enum GL_INNOCENT_CONTEXT_RESET;
enum GL_UNKNOWN_CONTEXT_RESET;
enum GL_RESET_NOTIFICATION_STRATEGY;
enum GL_LOSE_CONTEXT_ON_RESET;
enum GL_NO_RESET_NOTIFICATION;
enum GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT;
enum GL_CONTEXT_RELEASE_BEHAVIOR;
enum GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH;
enum GL_SHADER_BINARY_FORMAT_SPIR_V;
enum GL_SPIR_V_BINARY;
enum GL_PARAMETER_BUFFER;
enum GL_PARAMETER_BUFFER_BINDING;
enum GL_CONTEXT_FLAG_NO_ERROR_BIT;
enum GL_VERTICES_SUBMITTED;
enum GL_PRIMITIVES_SUBMITTED;
enum GL_VERTEX_SHADER_INVOCATIONS;
enum GL_TESS_CONTROL_SHADER_PATCHES;
enum GL_TESS_EVALUATION_SHADER_INVOCATIONS;
enum GL_GEOMETRY_SHADER_PRIMITIVES_EMITTED;
enum GL_FRAGMENT_SHADER_INVOCATIONS;
enum GL_COMPUTE_SHADER_INVOCATIONS;
enum GL_CLIPPING_INPUT_PRIMITIVES;
enum GL_CLIPPING_OUTPUT_PRIMITIVES;
enum GL_POLYGON_OFFSET_CLAMP;
enum GL_SPIR_V_EXTENSIONS;
enum GL_NUM_SPIR_V_EXTENSIONS;
enum GL_TEXTURE_MAX_ANISOTROPY;
enum GL_MAX_TEXTURE_MAX_ANISOTROPY;
enum GL_TRANSFORM_FEEDBACK_OVERFLOW;
enum GL_TRANSFORM_FEEDBACK_STREAM_OVERFLOW;
enum GL_PRIMITIVE_BOUNDING_BOX_ARB;
enum GL_MULTISAMPLE_LINE_WIDTH_RANGE_ARB;
enum GL_MULTISAMPLE_LINE_WIDTH_GRANULARITY_ARB;
enum GL_TEXTURE_TILING_EXT;
enum GL_DEDICATED_MEMORY_OBJECT_EXT;
enum GL_PROTECTED_MEMORY_OBJECT_EXT;
enum GL_NUM_TILING_TYPES_EXT;
enum GL_TILING_TYPES_EXT;
enum GL_OPTIMAL_TILING_EXT;
enum GL_LINEAR_TILING_EXT;
enum GL_NUM_DEVICE_UUIDS_EXT;
enum GL_DEVICE_UUID_EXT;
enum GL_DRIVER_UUID_EXT;
enum GL_HANDLE_TYPE_OPAQUE_FD_EXT;
enum GL_HANDLE_TYPE_OPAQUE_WIN32_EXT;
enum GL_HANDLE_TYPE_OPAQUE_WIN32_KMT_EXT;
enum GL_DEVICE_LUID_EXT;
enum GL_DEVICE_NODE_MASK_EXT;
enum GL_HANDLE_TYPE_D3D12_TILEPOOL_EXT;
enum GL_HANDLE_TYPE_D3D12_RESOURCE_EXT;
enum GL_HANDLE_TYPE_D3D11_IMAGE_EXT;
enum GL_HANDLE_TYPE_D3D11_IMAGE_KMT_EXT;
enum GL_LAYOUT_GENERAL_EXT;
enum GL_LAYOUT_COLOR_ATTACHMENT_EXT;
enum GL_LAYOUT_DEPTH_STENCIL_ATTACHMENT_EXT;
enum GL_LAYOUT_DEPTH_STENCIL_READ_ONLY_EXT;
enum GL_LAYOUT_SHADER_READ_ONLY_EXT;
enum GL_LAYOUT_TRANSFER_SRC_EXT;
enum GL_LAYOUT_TRANSFER_DST_EXT;
enum GL_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_EXT;
enum GL_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_EXT;
enum GL_HANDLE_TYPE_D3D12_FENCE_EXT;
enum GL_D3D12_FENCE_VALUE_EXT;
enum GL_TEXTURE_MAX_ANISOTROPY_EXT;
enum GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT;

lib.gl.funcs

module lib.gl.funcs;


global GL_VERSION_1_0: bool;
global GL_VERSION_1_1: bool;
global GL_VERSION_1_2: bool;
global GL_VERSION_1_3: bool;
global GL_VERSION_1_4: bool;
global GL_VERSION_1_5: bool;
global GL_VERSION_2_0: bool;
global GL_VERSION_2_1: bool;
global GL_VERSION_3_0: bool;
global GL_VERSION_3_1: bool;
global GL_VERSION_3_2: bool;
global GL_VERSION_3_3: bool;
global GL_VERSION_4_0: bool;
global GL_VERSION_4_1: bool;
global GL_VERSION_4_2: bool;
global GL_VERSION_4_3: bool;
global GL_VERSION_4_4: bool;
global GL_VERSION_4_5: bool;
global GL_VERSION_4_6: bool;

fn glCullFace(GLenum);
fn glFrontFace(GLenum);
fn glHint(GLenum, GLenum);
fn glLineWidth(GLfloat);
fn glPointSize(GLfloat);
fn glPolygonMode(GLenum, GLenum);
fn glScissor(GLint, GLint, GLsizei, GLsizei);
fn glTexParameterf(GLenum, GLenum, GLfloat);
fn glTexParameterfv(GLenum, GLenum, const(GLfloat)*);
fn glTexParameteri(GLenum, GLenum, GLint);
fn glTexParameteriv(GLenum, GLenum, const(GLint)*);
fn glTexImage1D(GLenum, GLint, GLint, GLsizei, GLint, GLenum, GLenum, const(void)*);
fn glTexImage2D(GLenum, GLint, GLint, GLsizei, GLsizei, GLint, GLenum, GLenum, const(void)*);
fn glDrawBuffer(GLenum);
fn glClear(GLbitfield);
fn glClearColor(GLfloat, GLfloat, GLfloat, GLfloat);
fn glClearStencil(GLint);
fn glClearDepth(GLdouble);
fn glStencilMask(GLuint);
fn glColorMask(GLboolean, GLboolean, GLboolean, GLboolean);
fn glDepthMask(GLboolean);
fn glDisable(GLenum);
fn glEnable(GLenum);
fn glFinish();
fn glFlush();
fn glBlendFunc(GLenum, GLenum);
fn glLogicOp(GLenum);
fn glStencilFunc(GLenum, GLint, GLuint);
fn glStencilOp(GLenum, GLenum, GLenum);
fn glDepthFunc(GLenum);
fn glPixelStoref(GLenum, GLfloat);
fn glPixelStorei(GLenum, GLint);
fn glReadBuffer(GLenum);
fn glReadPixels(GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, void*);
fn glGetBooleanv(GLenum, GLboolean*);
fn glGetDoublev(GLenum, GLdouble*);
fn glGetError() GLenum;
fn glGetFloatv(GLenum, GLfloat*);
fn glGetIntegerv(GLenum, GLint*);
fn glGetString(GLenum) const(GLubyte)*;
fn glGetTexImage(GLenum, GLint, GLenum, GLenum, void*);
fn glGetTexParameterfv(GLenum, GLenum, GLfloat*);
fn glGetTexParameteriv(GLenum, GLenum, GLint*);
fn glGetTexLevelParameterfv(GLenum, GLint, GLenum, GLfloat*);
fn glGetTexLevelParameteriv(GLenum, GLint, GLenum, GLint*);
fn glIsEnabled(GLenum) GLboolean;
fn glDepthRange(GLdouble, GLdouble);
fn glViewport(GLint, GLint, GLsizei, GLsizei);
fn glDrawArrays(GLenum, GLint, GLsizei);
fn glDrawElements(GLenum, GLsizei, GLenum, const(void)*);
fn glPolygonOffset(GLfloat, GLfloat);
fn glCopyTexImage1D(GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLint);
fn glCopyTexImage2D(GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint);
fn glCopyTexSubImage1D(GLenum, GLint, GLint, GLint, GLint, GLsizei);
fn glCopyTexSubImage2D(GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei);
fn glTexSubImage1D(GLenum, GLint, GLint, GLsizei, GLenum, GLenum, const(void)*);
fn glTexSubImage2D(GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const(void)*);
fn glBindTexture(GLenum, GLuint);
fn glDeleteTextures(GLsizei, const(GLuint)*);
fn glGenTextures(GLsizei, GLuint*);
fn glIsTexture(GLuint) GLboolean;
fn glDrawRangeElements(GLenum, GLuint, GLuint, GLsizei, GLenum, const(void)*);
fn glTexImage3D(GLenum, GLint, GLint, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const(void)*);
fn glTexSubImage3D(GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const(void)*);
fn glCopyTexSubImage3D(GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei);
fn glActiveTexture(GLenum);
fn glSampleCoverage(GLfloat, GLboolean);
fn glCompressedTexImage3D(GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const(void)*);
fn glCompressedTexImage2D(GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const(void)*);
fn glCompressedTexImage1D(GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const(void)*);
fn glCompressedTexSubImage3D(GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const(void)*);
fn glCompressedTexSubImage2D(GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const(void)*);
fn glCompressedTexSubImage1D(GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const(void)*);
fn glGetCompressedTexImage(GLenum, GLint, void*);
fn glBlendFuncSeparate(GLenum, GLenum, GLenum, GLenum);
fn glMultiDrawArrays(GLenum, const(GLint)*, const(GLsizei)*, GLsizei);
fn glMultiDrawElements(GLenum, const(GLsizei)*, GLenum, const(const(void)*)*, GLsizei);
fn glPointParameterf(GLenum, GLfloat);
fn glPointParameterfv(GLenum, const(GLfloat)*);
fn glPointParameteri(GLenum, GLint);
fn glPointParameteriv(GLenum, const(GLint)*);
fn glBlendColor(GLfloat, GLfloat, GLfloat, GLfloat);
fn glBlendEquation(GLenum);
fn glGenQueries(GLsizei, GLuint*);
fn glDeleteQueries(GLsizei, const(GLuint)*);
fn glIsQuery(GLuint) GLboolean;
fn glBeginQuery(GLenum, GLuint);
fn glEndQuery(GLenum);
fn glGetQueryiv(GLenum, GLenum, GLint*);
fn glGetQueryObjectiv(GLuint, GLenum, GLint*);
fn glGetQueryObjectuiv(GLuint, GLenum, GLuint*);
fn glBindBuffer(GLenum, GLuint);
fn glDeleteBuffers(GLsizei, const(GLuint)*);
fn glGenBuffers(GLsizei, GLuint*);
fn glIsBuffer(GLuint) GLboolean;
fn glBufferData(GLenum, GLsizeiptr, const(void)*, GLenum);
fn glBufferSubData(GLenum, GLintptr, GLsizeiptr, const(void)*);
fn glGetBufferSubData(GLenum, GLintptr, GLsizeiptr, void*);
fn glMapBuffer(GLenum, GLenum) void*;
fn glUnmapBuffer(GLenum) GLboolean;
fn glGetBufferParameteriv(GLenum, GLenum, GLint*);
fn glGetBufferPointerv(GLenum, GLenum, void**);
fn glBlendEquationSeparate(GLenum, GLenum);
fn glDrawBuffers(GLsizei, const(GLenum)*);
fn glStencilOpSeparate(GLenum, GLenum, GLenum, GLenum);
fn glStencilFuncSeparate(GLenum, GLenum, GLint, GLuint);
fn glStencilMaskSeparate(GLenum, GLuint);
fn glAttachShader(GLuint, GLuint);
fn glBindAttribLocation(GLuint, GLuint, const(GLchar)*);
fn glCompileShader(GLuint);
fn glCreateProgram() GLuint;
fn glCreateShader(GLenum) GLuint;
fn glDeleteProgram(GLuint);
fn glDeleteShader(GLuint);
fn glDetachShader(GLuint, GLuint);
fn glDisableVertexAttribArray(GLuint);
fn glEnableVertexAttribArray(GLuint);
fn glGetActiveAttrib(GLuint, GLuint, GLsizei, GLsizei*, GLint*, GLenum*, GLchar*);
fn glGetActiveUniform(GLuint, GLuint, GLsizei, GLsizei*, GLint*, GLenum*, GLchar*);
fn glGetAttachedShaders(GLuint, GLsizei, GLsizei*, GLuint*);
fn glGetAttribLocation(GLuint, const(GLchar)*) GLint;
fn glGetProgramiv(GLuint, GLenum, GLint*);
fn glGetProgramInfoLog(GLuint, GLsizei, GLsizei*, GLchar*);
fn glGetShaderiv(GLuint, GLenum, GLint*);
fn glGetShaderInfoLog(GLuint, GLsizei, GLsizei*, GLchar*);
fn glGetShaderSource(GLuint, GLsizei, GLsizei*, GLchar*);
fn glGetUniformLocation(GLuint, const(GLchar)*) GLint;
fn glGetUniformfv(GLuint, GLint, GLfloat*);
fn glGetUniformiv(GLuint, GLint, GLint*);
fn glGetVertexAttribdv(GLuint, GLenum, GLdouble*);
fn glGetVertexAttribfv(GLuint, GLenum, GLfloat*);
fn glGetVertexAttribiv(GLuint, GLenum, GLint*);
fn glGetVertexAttribPointerv(GLuint, GLenum, void**);
fn glIsProgram(GLuint) GLboolean;
fn glIsShader(GLuint) GLboolean;
fn glLinkProgram(GLuint);
fn glShaderSource(GLuint, GLsizei, const(const(GLchar)*)*, const(GLint)*);
fn glUseProgram(GLuint);
fn glUniform1f(GLint, GLfloat);
fn glUniform2f(GLint, GLfloat, GLfloat);
fn glUniform3f(GLint, GLfloat, GLfloat, GLfloat);
fn glUniform4f(GLint, GLfloat, GLfloat, GLfloat, GLfloat);
fn glUniform1i(GLint, GLint);
fn glUniform2i(GLint, GLint, GLint);
fn glUniform3i(GLint, GLint, GLint, GLint);
fn glUniform4i(GLint, GLint, GLint, GLint, GLint);
fn glUniform1fv(GLint, GLsizei, const(GLfloat)*);
fn glUniform2fv(GLint, GLsizei, const(GLfloat)*);
fn glUniform3fv(GLint, GLsizei, const(GLfloat)*);
fn glUniform4fv(GLint, GLsizei, const(GLfloat)*);
fn glUniform1iv(GLint, GLsizei, const(GLint)*);
fn glUniform2iv(GLint, GLsizei, const(GLint)*);
fn glUniform3iv(GLint, GLsizei, const(GLint)*);
fn glUniform4iv(GLint, GLsizei, const(GLint)*);
fn glUniformMatrix2fv(GLint, GLsizei, GLboolean, const(GLfloat)*);
fn glUniformMatrix3fv(GLint, GLsizei, GLboolean, const(GLfloat)*);
fn glUniformMatrix4fv(GLint, GLsizei, GLboolean, const(GLfloat)*);
fn glValidateProgram(GLuint);
fn glVertexAttrib1d(GLuint, GLdouble);
fn glVertexAttrib1dv(GLuint, const(GLdouble)*);
fn glVertexAttrib1f(GLuint, GLfloat);
fn glVertexAttrib1fv(GLuint, const(GLfloat)*);
fn glVertexAttrib1s(GLuint, GLshort);
fn glVertexAttrib1sv(GLuint, const(GLshort)*);
fn glVertexAttrib2d(GLuint, GLdouble, GLdouble);
fn glVertexAttrib2dv(GLuint, const(GLdouble)*);
fn glVertexAttrib2f(GLuint, GLfloat, GLfloat);
fn glVertexAttrib2fv(GLuint, const(GLfloat)*);
fn glVertexAttrib2s(GLuint, GLshort, GLshort);
fn glVertexAttrib2sv(GLuint, const(GLshort)*);
fn glVertexAttrib3d(GLuint, GLdouble, GLdouble, GLdouble);
fn glVertexAttrib3dv(GLuint, const(GLdouble)*);
fn glVertexAttrib3f(GLuint, GLfloat, GLfloat, GLfloat);
fn glVertexAttrib3fv(GLuint, const(GLfloat)*);
fn glVertexAttrib3s(GLuint, GLshort, GLshort, GLshort);
fn glVertexAttrib3sv(GLuint, const(GLshort)*);
fn glVertexAttrib4Nbv(GLuint, const(GLbyte)*);
fn glVertexAttrib4Niv(GLuint, const(GLint)*);
fn glVertexAttrib4Nsv(GLuint, const(GLshort)*);
fn glVertexAttrib4Nub(GLuint, GLubyte, GLubyte, GLubyte, GLubyte);
fn glVertexAttrib4Nubv(GLuint, const(GLubyte)*);
fn glVertexAttrib4Nuiv(GLuint, const(GLuint)*);
fn glVertexAttrib4Nusv(GLuint, const(GLushort)*);
fn glVertexAttrib4bv(GLuint, const(GLbyte)*);
fn glVertexAttrib4d(GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
fn glVertexAttrib4dv(GLuint, const(GLdouble)*);
fn glVertexAttrib4f(GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
fn glVertexAttrib4fv(GLuint, const(GLfloat)*);
fn glVertexAttrib4iv(GLuint, const(GLint)*);
fn glVertexAttrib4s(GLuint, GLshort, GLshort, GLshort, GLshort);
fn glVertexAttrib4sv(GLuint, const(GLshort)*);
fn glVertexAttrib4ubv(GLuint, const(GLubyte)*);
fn glVertexAttrib4uiv(GLuint, const(GLuint)*);
fn glVertexAttrib4usv(GLuint, const(GLushort)*);
fn glVertexAttribPointer(GLuint, GLint, GLenum, GLboolean, GLsizei, const(void)*);
fn glUniformMatrix2x3fv(GLint, GLsizei, GLboolean, const(GLfloat)*);
fn glUniformMatrix3x2fv(GLint, GLsizei, GLboolean, const(GLfloat)*);
fn glUniformMatrix2x4fv(GLint, GLsizei, GLboolean, const(GLfloat)*);
fn glUniformMatrix4x2fv(GLint, GLsizei, GLboolean, const(GLfloat)*);
fn glUniformMatrix3x4fv(GLint, GLsizei, GLboolean, const(GLfloat)*);
fn glUniformMatrix4x3fv(GLint, GLsizei, GLboolean, const(GLfloat)*);
fn glColorMaski(GLuint, GLboolean, GLboolean, GLboolean, GLboolean);
fn glGetBooleani_v(GLenum, GLuint, GLboolean*);
fn glGetIntegeri_v(GLenum, GLuint, GLint*);
fn glEnablei(GLenum, GLuint);
fn glDisablei(GLenum, GLuint);
fn glIsEnabledi(GLenum, GLuint) GLboolean;
fn glBeginTransformFeedback(GLenum);
fn glEndTransformFeedback();
fn glBindBufferRange(GLenum, GLuint, GLuint, GLintptr, GLsizeiptr);
fn glBindBufferBase(GLenum, GLuint, GLuint);
fn glTransformFeedbackVaryings(GLuint, GLsizei, const(const(GLchar)*)*, GLenum);
fn glGetTransformFeedbackVarying(GLuint, GLuint, GLsizei, GLsizei*, GLsizei*, GLenum*, GLchar*);
fn glClampColor(GLenum, GLenum);
fn glBeginConditionalRender(GLuint, GLenum);
fn glEndConditionalRender();
fn glVertexAttribIPointer(GLuint, GLint, GLenum, GLsizei, const(void)*);
fn glGetVertexAttribIiv(GLuint, GLenum, GLint*);
fn glGetVertexAttribIuiv(GLuint, GLenum, GLuint*);
fn glVertexAttribI1i(GLuint, GLint);
fn glVertexAttribI2i(GLuint, GLint, GLint);
fn glVertexAttribI3i(GLuint, GLint, GLint, GLint);
fn glVertexAttribI4i(GLuint, GLint, GLint, GLint, GLint);
fn glVertexAttribI1ui(GLuint, GLuint);
fn glVertexAttribI2ui(GLuint, GLuint, GLuint);
fn glVertexAttribI3ui(GLuint, GLuint, GLuint, GLuint);
fn glVertexAttribI4ui(GLuint, GLuint, GLuint, GLuint, GLuint);
fn glVertexAttribI1iv(GLuint, const(GLint)*);
fn glVertexAttribI2iv(GLuint, const(GLint)*);
fn glVertexAttribI3iv(GLuint, const(GLint)*);
fn glVertexAttribI4iv(GLuint, const(GLint)*);
fn glVertexAttribI1uiv(GLuint, const(GLuint)*);
fn glVertexAttribI2uiv(GLuint, const(GLuint)*);
fn glVertexAttribI3uiv(GLuint, const(GLuint)*);
fn glVertexAttribI4uiv(GLuint, const(GLuint)*);
fn glVertexAttribI4bv(GLuint, const(GLbyte)*);
fn glVertexAttribI4sv(GLuint, const(GLshort)*);
fn glVertexAttribI4ubv(GLuint, const(GLubyte)*);
fn glVertexAttribI4usv(GLuint, const(GLushort)*);
fn glGetUniformuiv(GLuint, GLint, GLuint*);
fn glBindFragDataLocation(GLuint, GLuint, const(GLchar)*);
fn glGetFragDataLocation(GLuint, const(GLchar)*) GLint;
fn glUniform1ui(GLint, GLuint);
fn glUniform2ui(GLint, GLuint, GLuint);
fn glUniform3ui(GLint, GLuint, GLuint, GLuint);
fn glUniform4ui(GLint, GLuint, GLuint, GLuint, GLuint);
fn glUniform1uiv(GLint, GLsizei, const(GLuint)*);
fn glUniform2uiv(GLint, GLsizei, const(GLuint)*);
fn glUniform3uiv(GLint, GLsizei, const(GLuint)*);
fn glUniform4uiv(GLint, GLsizei, const(GLuint)*);
fn glTexParameterIiv(GLenum, GLenum, const(GLint)*);
fn glTexParameterIuiv(GLenum, GLenum, const(GLuint)*);
fn glGetTexParameterIiv(GLenum, GLenum, GLint*);
fn glGetTexParameterIuiv(GLenum, GLenum, GLuint*);
fn glClearBufferiv(GLenum, GLint, const(GLint)*);
fn glClearBufferuiv(GLenum, GLint, const(GLuint)*);
fn glClearBufferfv(GLenum, GLint, const(GLfloat)*);
fn glClearBufferfi(GLenum, GLint, GLfloat, GLint);
fn glGetStringi(GLenum, GLuint) const(GLubyte)*;
fn glIsRenderbuffer(GLuint) GLboolean;
fn glBindRenderbuffer(GLenum, GLuint);
fn glDeleteRenderbuffers(GLsizei, const(GLuint)*);
fn glGenRenderbuffers(GLsizei, GLuint*);
fn glRenderbufferStorage(GLenum, GLenum, GLsizei, GLsizei);
fn glGetRenderbufferParameteriv(GLenum, GLenum, GLint*);
fn glIsFramebuffer(GLuint) GLboolean;
fn glBindFramebuffer(GLenum, GLuint);
fn glDeleteFramebuffers(GLsizei, const(GLuint)*);
fn glGenFramebuffers(GLsizei, GLuint*);
fn glCheckFramebufferStatus(GLenum) GLenum;
fn glFramebufferTexture1D(GLenum, GLenum, GLenum, GLuint, GLint);
fn glFramebufferTexture2D(GLenum, GLenum, GLenum, GLuint, GLint);
fn glFramebufferTexture3D(GLenum, GLenum, GLenum, GLuint, GLint, GLint);
fn glFramebufferRenderbuffer(GLenum, GLenum, GLenum, GLuint);
fn glGetFramebufferAttachmentParameteriv(GLenum, GLenum, GLenum, GLint*);
fn glGenerateMipmap(GLenum);
fn glBlitFramebuffer(GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLbitfield, GLenum);
fn glRenderbufferStorageMultisample(GLenum, GLsizei, GLenum, GLsizei, GLsizei);
fn glFramebufferTextureLayer(GLenum, GLenum, GLuint, GLint, GLint);
fn glMapBufferRange(GLenum, GLintptr, GLsizeiptr, GLbitfield) void*;
fn glFlushMappedBufferRange(GLenum, GLintptr, GLsizeiptr);
fn glBindVertexArray(GLuint);
fn glDeleteVertexArrays(GLsizei, const(GLuint)*);
fn glGenVertexArrays(GLsizei, GLuint*);
fn glIsVertexArray(GLuint) GLboolean;
fn glDrawArraysInstanced(GLenum, GLint, GLsizei, GLsizei);
fn glDrawElementsInstanced(GLenum, GLsizei, GLenum, const(void)*, GLsizei);
fn glTexBuffer(GLenum, GLenum, GLuint);
fn glPrimitiveRestartIndex(GLuint);
fn glCopyBufferSubData(GLenum, GLenum, GLintptr, GLintptr, GLsizeiptr);
fn glGetUniformIndices(GLuint, GLsizei, const(const(GLchar)*)*, GLuint*);
fn glGetActiveUniformsiv(GLuint, GLsizei, const(GLuint)*, GLenum, GLint*);
fn glGetActiveUniformName(GLuint, GLuint, GLsizei, GLsizei*, GLchar*);
fn glGetUniformBlockIndex(GLuint, const(GLchar)*) GLuint;
fn glGetActiveUniformBlockiv(GLuint, GLuint, GLenum, GLint*);
fn glGetActiveUniformBlockName(GLuint, GLuint, GLsizei, GLsizei*, GLchar*);
fn glUniformBlockBinding(GLuint, GLuint, GLuint);
fn glDrawElementsBaseVertex(GLenum, GLsizei, GLenum, const(void)*, GLint);
fn glDrawRangeElementsBaseVertex(GLenum, GLuint, GLuint, GLsizei, GLenum, const(void)*, GLint);
fn glDrawElementsInstancedBaseVertex(GLenum, GLsizei, GLenum, const(void)*, GLsizei, GLint);
fn glMultiDrawElementsBaseVertex(GLenum, const(GLsizei)*, GLenum, const(const(void)*)*, GLsizei, const(GLint)*);
fn glProvokingVertex(GLenum);
fn glFenceSync(GLenum, GLbitfield) GLsync;
fn glIsSync(GLsync) GLboolean;
fn glDeleteSync(GLsync);
fn glClientWaitSync(GLsync, GLbitfield, GLuint64) GLenum;
fn glWaitSync(GLsync, GLbitfield, GLuint64);
fn glGetInteger64v(GLenum, GLint64*);
fn glGetSynciv(GLsync, GLenum, GLsizei, GLsizei*, GLint*);
fn glGetInteger64i_v(GLenum, GLuint, GLint64*);
fn glGetBufferParameteri64v(GLenum, GLenum, GLint64*);
fn glFramebufferTexture(GLenum, GLenum, GLuint, GLint);
fn glTexImage2DMultisample(GLenum, GLsizei, GLenum, GLsizei, GLsizei, GLboolean);
fn glTexImage3DMultisample(GLenum, GLsizei, GLenum, GLsizei, GLsizei, GLsizei, GLboolean);
fn glGetMultisamplefv(GLenum, GLuint, GLfloat*);
fn glSampleMaski(GLuint, GLbitfield);
fn glBindFragDataLocationIndexed(GLuint, GLuint, GLuint, const(GLchar)*);
fn glGetFragDataIndex(GLuint, const(GLchar)*) GLint;
fn glGenSamplers(GLsizei, GLuint*);
fn glDeleteSamplers(GLsizei, const(GLuint)*);
fn glIsSampler(GLuint) GLboolean;
fn glBindSampler(GLuint, GLuint);
fn glSamplerParameteri(GLuint, GLenum, GLint);
fn glSamplerParameteriv(GLuint, GLenum, const(GLint)*);
fn glSamplerParameterf(GLuint, GLenum, GLfloat);
fn glSamplerParameterfv(GLuint, GLenum, const(GLfloat)*);
fn glSamplerParameterIiv(GLuint, GLenum, const(GLint)*);
fn glSamplerParameterIuiv(GLuint, GLenum, const(GLuint)*);
fn glGetSamplerParameteriv(GLuint, GLenum, GLint*);
fn glGetSamplerParameterIiv(GLuint, GLenum, GLint*);
fn glGetSamplerParameterfv(GLuint, GLenum, GLfloat*);
fn glGetSamplerParameterIuiv(GLuint, GLenum, GLuint*);
fn glQueryCounter(GLuint, GLenum);
fn glGetQueryObjecti64v(GLuint, GLenum, GLint64*);
fn glGetQueryObjectui64v(GLuint, GLenum, GLuint64*);
fn glVertexAttribDivisor(GLuint, GLuint);
fn glVertexAttribP1ui(GLuint, GLenum, GLboolean, GLuint);
fn glVertexAttribP1uiv(GLuint, GLenum, GLboolean, const(GLuint)*);
fn glVertexAttribP2ui(GLuint, GLenum, GLboolean, GLuint);
fn glVertexAttribP2uiv(GLuint, GLenum, GLboolean, const(GLuint)*);
fn glVertexAttribP3ui(GLuint, GLenum, GLboolean, GLuint);
fn glVertexAttribP3uiv(GLuint, GLenum, GLboolean, const(GLuint)*);
fn glVertexAttribP4ui(GLuint, GLenum, GLboolean, GLuint);
fn glVertexAttribP4uiv(GLuint, GLenum, GLboolean, const(GLuint)*);
fn glVertexP2ui(GLenum, GLuint);
fn glVertexP2uiv(GLenum, const(GLuint)*);
fn glVertexP3ui(GLenum, GLuint);
fn glVertexP3uiv(GLenum, const(GLuint)*);
fn glVertexP4ui(GLenum, GLuint);
fn glVertexP4uiv(GLenum, const(GLuint)*);
fn glTexCoordP1ui(GLenum, GLuint);
fn glTexCoordP1uiv(GLenum, const(GLuint)*);
fn glTexCoordP2ui(GLenum, GLuint);
fn glTexCoordP2uiv(GLenum, const(GLuint)*);
fn glTexCoordP3ui(GLenum, GLuint);
fn glTexCoordP3uiv(GLenum, const(GLuint)*);
fn glTexCoordP4ui(GLenum, GLuint);
fn glTexCoordP4uiv(GLenum, const(GLuint)*);
fn glMultiTexCoordP1ui(GLenum, GLenum, GLuint);
fn glMultiTexCoordP1uiv(GLenum, GLenum, const(GLuint)*);
fn glMultiTexCoordP2ui(GLenum, GLenum, GLuint);
fn glMultiTexCoordP2uiv(GLenum, GLenum, const(GLuint)*);
fn glMultiTexCoordP3ui(GLenum, GLenum, GLuint);
fn glMultiTexCoordP3uiv(GLenum, GLenum, const(GLuint)*);
fn glMultiTexCoordP4ui(GLenum, GLenum, GLuint);
fn glMultiTexCoordP4uiv(GLenum, GLenum, const(GLuint)*);
fn glNormalP3ui(GLenum, GLuint);
fn glNormalP3uiv(GLenum, const(GLuint)*);
fn glColorP3ui(GLenum, GLuint);
fn glColorP3uiv(GLenum, const(GLuint)*);
fn glColorP4ui(GLenum, GLuint);
fn glColorP4uiv(GLenum, const(GLuint)*);
fn glSecondaryColorP3ui(GLenum, GLuint);
fn glSecondaryColorP3uiv(GLenum, const(GLuint)*);
fn glMinSampleShading(GLfloat);
fn glBlendEquationi(GLuint, GLenum);
fn glBlendEquationSeparatei(GLuint, GLenum, GLenum);
fn glBlendFunci(GLuint, GLenum, GLenum);
fn glBlendFuncSeparatei(GLuint, GLenum, GLenum, GLenum, GLenum);
fn glDrawArraysIndirect(GLenum, const(void)*);
fn glDrawElementsIndirect(GLenum, GLenum, const(void)*);
fn glUniform1d(GLint, GLdouble);
fn glUniform2d(GLint, GLdouble, GLdouble);
fn glUniform3d(GLint, GLdouble, GLdouble, GLdouble);
fn glUniform4d(GLint, GLdouble, GLdouble, GLdouble, GLdouble);
fn glUniform1dv(GLint, GLsizei, const(GLdouble)*);
fn glUniform2dv(GLint, GLsizei, const(GLdouble)*);
fn glUniform3dv(GLint, GLsizei, const(GLdouble)*);
fn glUniform4dv(GLint, GLsizei, const(GLdouble)*);
fn glUniformMatrix2dv(GLint, GLsizei, GLboolean, const(GLdouble)*);
fn glUniformMatrix3dv(GLint, GLsizei, GLboolean, const(GLdouble)*);
fn glUniformMatrix4dv(GLint, GLsizei, GLboolean, const(GLdouble)*);
fn glUniformMatrix2x3dv(GLint, GLsizei, GLboolean, const(GLdouble)*);
fn glUniformMatrix2x4dv(GLint, GLsizei, GLboolean, const(GLdouble)*);
fn glUniformMatrix3x2dv(GLint, GLsizei, GLboolean, const(GLdouble)*);
fn glUniformMatrix3x4dv(GLint, GLsizei, GLboolean, const(GLdouble)*);
fn glUniformMatrix4x2dv(GLint, GLsizei, GLboolean, const(GLdouble)*);
fn glUniformMatrix4x3dv(GLint, GLsizei, GLboolean, const(GLdouble)*);
fn glGetUniformdv(GLuint, GLint, GLdouble*);
fn glGetSubroutineUniformLocation(GLuint, GLenum, const(GLchar)*) GLint;
fn glGetSubroutineIndex(GLuint, GLenum, const(GLchar)*) GLuint;
fn glGetActiveSubroutineUniformiv(GLuint, GLenum, GLuint, GLenum, GLint*);
fn glGetActiveSubroutineUniformName(GLuint, GLenum, GLuint, GLsizei, GLsizei*, GLchar*);
fn glGetActiveSubroutineName(GLuint, GLenum, GLuint, GLsizei, GLsizei*, GLchar*);
fn glUniformSubroutinesuiv(GLenum, GLsizei, const(GLuint)*);
fn glGetUniformSubroutineuiv(GLenum, GLint, GLuint*);
fn glGetProgramStageiv(GLuint, GLenum, GLenum, GLint*);
fn glPatchParameteri(GLenum, GLint);
fn glPatchParameterfv(GLenum, const(GLfloat)*);
fn glBindTransformFeedback(GLenum, GLuint);
fn glDeleteTransformFeedbacks(GLsizei, const(GLuint)*);
fn glGenTransformFeedbacks(GLsizei, GLuint*);
fn glIsTransformFeedback(GLuint) GLboolean;
fn glPauseTransformFeedback();
fn glResumeTransformFeedback();
fn glDrawTransformFeedback(GLenum, GLuint);
fn glDrawTransformFeedbackStream(GLenum, GLuint, GLuint);
fn glBeginQueryIndexed(GLenum, GLuint, GLuint);
fn glEndQueryIndexed(GLenum, GLuint);
fn glGetQueryIndexediv(GLenum, GLuint, GLenum, GLint*);
fn glReleaseShaderCompiler();
fn glShaderBinary(GLsizei, const(GLuint)*, GLenum, const(void)*, GLsizei);
fn glGetShaderPrecisionFormat(GLenum, GLenum, GLint*, GLint*);
fn glDepthRangef(GLfloat, GLfloat);
fn glClearDepthf(GLfloat);
fn glGetProgramBinary(GLuint, GLsizei, GLsizei*, GLenum*, void*);
fn glProgramBinary(GLuint, GLenum, const(void)*, GLsizei);
fn glProgramParameteri(GLuint, GLenum, GLint);
fn glUseProgramStages(GLuint, GLbitfield, GLuint);
fn glActiveShaderProgram(GLuint, GLuint);
fn glCreateShaderProgramv(GLenum, GLsizei, const(const(GLchar)*)*) GLuint;
fn glBindProgramPipeline(GLuint);
fn glDeleteProgramPipelines(GLsizei, const(GLuint)*);
fn glGenProgramPipelines(GLsizei, GLuint*);
fn glIsProgramPipeline(GLuint) GLboolean;
fn glGetProgramPipelineiv(GLuint, GLenum, GLint*);
fn glProgramUniform1i(GLuint, GLint, GLint);
fn glProgramUniform1iv(GLuint, GLint, GLsizei, const(GLint)*);
fn glProgramUniform1f(GLuint, GLint, GLfloat);
fn glProgramUniform1fv(GLuint, GLint, GLsizei, const(GLfloat)*);
fn glProgramUniform1d(GLuint, GLint, GLdouble);
fn glProgramUniform1dv(GLuint, GLint, GLsizei, const(GLdouble)*);
fn glProgramUniform1ui(GLuint, GLint, GLuint);
fn glProgramUniform1uiv(GLuint, GLint, GLsizei, const(GLuint)*);
fn glProgramUniform2i(GLuint, GLint, GLint, GLint);
fn glProgramUniform2iv(GLuint, GLint, GLsizei, const(GLint)*);
fn glProgramUniform2f(GLuint, GLint, GLfloat, GLfloat);
fn glProgramUniform2fv(GLuint, GLint, GLsizei, const(GLfloat)*);
fn glProgramUniform2d(GLuint, GLint, GLdouble, GLdouble);
fn glProgramUniform2dv(GLuint, GLint, GLsizei, const(GLdouble)*);
fn glProgramUniform2ui(GLuint, GLint, GLuint, GLuint);
fn glProgramUniform2uiv(GLuint, GLint, GLsizei, const(GLuint)*);
fn glProgramUniform3i(GLuint, GLint, GLint, GLint, GLint);
fn glProgramUniform3iv(GLuint, GLint, GLsizei, const(GLint)*);
fn glProgramUniform3f(GLuint, GLint, GLfloat, GLfloat, GLfloat);
fn glProgramUniform3fv(GLuint, GLint, GLsizei, const(GLfloat)*);
fn glProgramUniform3d(GLuint, GLint, GLdouble, GLdouble, GLdouble);
fn glProgramUniform3dv(GLuint, GLint, GLsizei, const(GLdouble)*);
fn glProgramUniform3ui(GLuint, GLint, GLuint, GLuint, GLuint);
fn glProgramUniform3uiv(GLuint, GLint, GLsizei, const(GLuint)*);
fn glProgramUniform4i(GLuint, GLint, GLint, GLint, GLint, GLint);
fn glProgramUniform4iv(GLuint, GLint, GLsizei, const(GLint)*);
fn glProgramUniform4f(GLuint, GLint, GLfloat, GLfloat, GLfloat, GLfloat);
fn glProgramUniform4fv(GLuint, GLint, GLsizei, const(GLfloat)*);
fn glProgramUniform4d(GLuint, GLint, GLdouble, GLdouble, GLdouble, GLdouble);
fn glProgramUniform4dv(GLuint, GLint, GLsizei, const(GLdouble)*);
fn glProgramUniform4ui(GLuint, GLint, GLuint, GLuint, GLuint, GLuint);
fn glProgramUniform4uiv(GLuint, GLint, GLsizei, const(GLuint)*);
fn glProgramUniformMatrix2fv(GLuint, GLint, GLsizei, GLboolean, const(GLfloat)*);
fn glProgramUniformMatrix3fv(GLuint, GLint, GLsizei, GLboolean, const(GLfloat)*);
fn glProgramUniformMatrix4fv(GLuint, GLint, GLsizei, GLboolean, const(GLfloat)*);
fn glProgramUniformMatrix2dv(GLuint, GLint, GLsizei, GLboolean, const(GLdouble)*);
fn glProgramUniformMatrix3dv(GLuint, GLint, GLsizei, GLboolean, const(GLdouble)*);
fn glProgramUniformMatrix4dv(GLuint, GLint, GLsizei, GLboolean, const(GLdouble)*);
fn glProgramUniformMatrix2x3fv(GLuint, GLint, GLsizei, GLboolean, const(GLfloat)*);
fn glProgramUniformMatrix3x2fv(GLuint, GLint, GLsizei, GLboolean, const(GLfloat)*);
fn glProgramUniformMatrix2x4fv(GLuint, GLint, GLsizei, GLboolean, const(GLfloat)*);
fn glProgramUniformMatrix4x2fv(GLuint, GLint, GLsizei, GLboolean, const(GLfloat)*);
fn glProgramUniformMatrix3x4fv(GLuint, GLint, GLsizei, GLboolean, const(GLfloat)*);
fn glProgramUniformMatrix4x3fv(GLuint, GLint, GLsizei, GLboolean, const(GLfloat)*);
fn glProgramUniformMatrix2x3dv(GLuint, GLint, GLsizei, GLboolean, const(GLdouble)*);
fn glProgramUniformMatrix3x2dv(GLuint, GLint, GLsizei, GLboolean, const(GLdouble)*);
fn glProgramUniformMatrix2x4dv(GLuint, GLint, GLsizei, GLboolean, const(GLdouble)*);
fn glProgramUniformMatrix4x2dv(GLuint, GLint, GLsizei, GLboolean, const(GLdouble)*);
fn glProgramUniformMatrix3x4dv(GLuint, GLint, GLsizei, GLboolean, const(GLdouble)*);
fn glProgramUniformMatrix4x3dv(GLuint, GLint, GLsizei, GLboolean, const(GLdouble)*);
fn glValidateProgramPipeline(GLuint);
fn glGetProgramPipelineInfoLog(GLuint, GLsizei, GLsizei*, GLchar*);
fn glVertexAttribL1d(GLuint, GLdouble);
fn glVertexAttribL2d(GLuint, GLdouble, GLdouble);
fn glVertexAttribL3d(GLuint, GLdouble, GLdouble, GLdouble);
fn glVertexAttribL4d(GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
fn glVertexAttribL1dv(GLuint, const(GLdouble)*);
fn glVertexAttribL2dv(GLuint, const(GLdouble)*);
fn glVertexAttribL3dv(GLuint, const(GLdouble)*);
fn glVertexAttribL4dv(GLuint, const(GLdouble)*);
fn glVertexAttribLPointer(GLuint, GLint, GLenum, GLsizei, const(void)*);
fn glGetVertexAttribLdv(GLuint, GLenum, GLdouble*);
fn glViewportArrayv(GLuint, GLsizei, const(GLfloat)*);
fn glViewportIndexedf(GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
fn glViewportIndexedfv(GLuint, const(GLfloat)*);
fn glScissorArrayv(GLuint, GLsizei, const(GLint)*);
fn glScissorIndexed(GLuint, GLint, GLint, GLsizei, GLsizei);
fn glScissorIndexedv(GLuint, const(GLint)*);
fn glDepthRangeArrayv(GLuint, GLsizei, const(GLdouble)*);
fn glDepthRangeIndexed(GLuint, GLdouble, GLdouble);
fn glGetFloati_v(GLenum, GLuint, GLfloat*);
fn glGetDoublei_v(GLenum, GLuint, GLdouble*);
fn glDrawArraysInstancedBaseInstance(GLenum, GLint, GLsizei, GLsizei, GLuint);
fn glDrawElementsInstancedBaseInstance(GLenum, GLsizei, GLenum, const(void)*, GLsizei, GLuint);
fn glDrawElementsInstancedBaseVertexBaseInstance(GLenum, GLsizei, GLenum, const(void)*, GLsizei, GLint, GLuint);
fn glGetInternalformativ(GLenum, GLenum, GLenum, GLsizei, GLint*);
fn glGetActiveAtomicCounterBufferiv(GLuint, GLuint, GLenum, GLint*);
fn glBindImageTexture(GLuint, GLuint, GLint, GLboolean, GLint, GLenum, GLenum);
fn glMemoryBarrier(GLbitfield);
fn glTexStorage1D(GLenum, GLsizei, GLenum, GLsizei);
fn glTexStorage2D(GLenum, GLsizei, GLenum, GLsizei, GLsizei);
fn glTexStorage3D(GLenum, GLsizei, GLenum, GLsizei, GLsizei, GLsizei);
fn glDrawTransformFeedbackInstanced(GLenum, GLuint, GLsizei);
fn glDrawTransformFeedbackStreamInstanced(GLenum, GLuint, GLuint, GLsizei);
fn glClearBufferData(GLenum, GLenum, GLenum, GLenum, const(void)*);
fn glClearBufferSubData(GLenum, GLenum, GLintptr, GLsizeiptr, GLenum, GLenum, const(void)*);
fn glDispatchCompute(GLuint, GLuint, GLuint);
fn glDispatchComputeIndirect(GLintptr);
fn glCopyImageSubData(GLuint, GLenum, GLint, GLint, GLint, GLint, GLuint, GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei);
fn glFramebufferParameteri(GLenum, GLenum, GLint);
fn glGetFramebufferParameteriv(GLenum, GLenum, GLint*);
fn glGetInternalformati64v(GLenum, GLenum, GLenum, GLsizei, GLint64*);
fn glInvalidateTexSubImage(GLuint, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei);
fn glInvalidateTexImage(GLuint, GLint);
fn glInvalidateBufferSubData(GLuint, GLintptr, GLsizeiptr);
fn glInvalidateBufferData(GLuint);
fn glInvalidateFramebuffer(GLenum, GLsizei, const(GLenum)*);
fn glInvalidateSubFramebuffer(GLenum, GLsizei, const(GLenum)*, GLint, GLint, GLsizei, GLsizei);
fn glMultiDrawArraysIndirect(GLenum, const(void)*, GLsizei, GLsizei);
fn glMultiDrawElementsIndirect(GLenum, GLenum, const(void)*, GLsizei, GLsizei);
fn glGetProgramInterfaceiv(GLuint, GLenum, GLenum, GLint*);
fn glGetProgramResourceIndex(GLuint, GLenum, const(GLchar)*) GLuint;
fn glGetProgramResourceName(GLuint, GLenum, GLuint, GLsizei, GLsizei*, GLchar*);
fn glGetProgramResourceiv(GLuint, GLenum, GLuint, GLsizei, const(GLenum)*, GLsizei, GLsizei*, GLint*);
fn glGetProgramResourceLocation(GLuint, GLenum, const(GLchar)*) GLint;
fn glGetProgramResourceLocationIndex(GLuint, GLenum, const(GLchar)*) GLint;
fn glShaderStorageBlockBinding(GLuint, GLuint, GLuint);
fn glTexBufferRange(GLenum, GLenum, GLuint, GLintptr, GLsizeiptr);
fn glTexStorage2DMultisample(GLenum, GLsizei, GLenum, GLsizei, GLsizei, GLboolean);
fn glTexStorage3DMultisample(GLenum, GLsizei, GLenum, GLsizei, GLsizei, GLsizei, GLboolean);
fn glTextureView(GLuint, GLenum, GLuint, GLenum, GLuint, GLuint, GLuint, GLuint);
fn glBindVertexBuffer(GLuint, GLuint, GLintptr, GLsizei);
fn glVertexAttribFormat(GLuint, GLint, GLenum, GLboolean, GLuint);
fn glVertexAttribIFormat(GLuint, GLint, GLenum, GLuint);
fn glVertexAttribLFormat(GLuint, GLint, GLenum, GLuint);
fn glVertexAttribBinding(GLuint, GLuint);
fn glVertexBindingDivisor(GLuint, GLuint);
fn glDebugMessageControl(GLenum, GLenum, GLenum, GLsizei, const(GLuint)*, GLboolean);
fn glDebugMessageInsert(GLenum, GLenum, GLuint, GLenum, GLsizei, const(GLchar)*);
fn glDebugMessageCallback(GLDEBUGPROC, const(void)*);
fn glGetDebugMessageLog(GLuint, GLsizei, GLenum*, GLenum*, GLuint*, GLenum*, GLsizei*, GLchar*) GLuint;
fn glPushDebugGroup(GLenum, GLuint, GLsizei, const(GLchar)*);
fn glPopDebugGroup();
fn glObjectLabel(GLenum, GLuint, GLsizei, const(GLchar)*);
fn glGetObjectLabel(GLenum, GLuint, GLsizei, GLsizei*, GLchar*);
fn glObjectPtrLabel(const(void)*, GLsizei, const(GLchar)*);
fn glGetObjectPtrLabel(const(void)*, GLsizei, GLsizei*, GLchar*);
fn glBufferStorage(GLenum, GLsizeiptr, const(void)*, GLbitfield);
fn glClearTexImage(GLuint, GLint, GLenum, GLenum, const(void)*);
fn glClearTexSubImage(GLuint, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const(void)*);
fn glBindBuffersBase(GLenum, GLuint, GLsizei, const(GLuint)*);
fn glBindBuffersRange(GLenum, GLuint, GLsizei, const(GLuint)*, const(GLintptr)*, const(GLsizeiptr)*);
fn glBindTextures(GLuint, GLsizei, const(GLuint)*);
fn glBindSamplers(GLuint, GLsizei, const(GLuint)*);
fn glBindImageTextures(GLuint, GLsizei, const(GLuint)*);
fn glBindVertexBuffers(GLuint, GLsizei, const(GLuint)*, const(GLintptr)*, const(GLsizei)*);
fn glClipControl(GLenum, GLenum);
fn glCreateTransformFeedbacks(GLsizei, GLuint*);
fn glTransformFeedbackBufferBase(GLuint, GLuint, GLuint);
fn glTransformFeedbackBufferRange(GLuint, GLuint, GLuint, GLintptr, GLsizeiptr);
fn glGetTransformFeedbackiv(GLuint, GLenum, GLint*);
fn glGetTransformFeedbacki_v(GLuint, GLenum, GLuint, GLint*);
fn glGetTransformFeedbacki64_v(GLuint, GLenum, GLuint, GLint64*);
fn glCreateBuffers(GLsizei, GLuint*);
fn glNamedBufferStorage(GLuint, GLsizeiptr, const(void)*, GLbitfield);
fn glNamedBufferData(GLuint, GLsizeiptr, const(void)*, GLenum);
fn glNamedBufferSubData(GLuint, GLintptr, GLsizeiptr, const(void)*);
fn glCopyNamedBufferSubData(GLuint, GLuint, GLintptr, GLintptr, GLsizeiptr);
fn glClearNamedBufferData(GLuint, GLenum, GLenum, GLenum, const(void)*);
fn glClearNamedBufferSubData(GLuint, GLenum, GLintptr, GLsizeiptr, GLenum, GLenum, const(void)*);
fn glMapNamedBuffer(GLuint, GLenum) void*;
fn glMapNamedBufferRange(GLuint, GLintptr, GLsizeiptr, GLbitfield) void*;
fn glUnmapNamedBuffer(GLuint) GLboolean;
fn glFlushMappedNamedBufferRange(GLuint, GLintptr, GLsizeiptr);
fn glGetNamedBufferParameteriv(GLuint, GLenum, GLint*);
fn glGetNamedBufferParameteri64v(GLuint, GLenum, GLint64*);
fn glGetNamedBufferPointerv(GLuint, GLenum, void**);
fn glGetNamedBufferSubData(GLuint, GLintptr, GLsizeiptr, void*);
fn glCreateFramebuffers(GLsizei, GLuint*);
fn glNamedFramebufferRenderbuffer(GLuint, GLenum, GLenum, GLuint);
fn glNamedFramebufferParameteri(GLuint, GLenum, GLint);
fn glNamedFramebufferTexture(GLuint, GLenum, GLuint, GLint);
fn glNamedFramebufferTextureLayer(GLuint, GLenum, GLuint, GLint, GLint);
fn glNamedFramebufferDrawBuffer(GLuint, GLenum);
fn glNamedFramebufferDrawBuffers(GLuint, GLsizei, const(GLenum)*);
fn glNamedFramebufferReadBuffer(GLuint, GLenum);
fn glInvalidateNamedFramebufferData(GLuint, GLsizei, const(GLenum)*);
fn glInvalidateNamedFramebufferSubData(GLuint, GLsizei, const(GLenum)*, GLint, GLint, GLsizei, GLsizei);
fn glClearNamedFramebufferiv(GLuint, GLenum, GLint, const(GLint)*);
fn glClearNamedFramebufferuiv(GLuint, GLenum, GLint, const(GLuint)*);
fn glClearNamedFramebufferfv(GLuint, GLenum, GLint, const(GLfloat)*);
fn glClearNamedFramebufferfi(GLuint, GLenum, GLint, GLfloat, GLint);
fn glBlitNamedFramebuffer(GLuint, GLuint, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLbitfield, GLenum);
fn glCheckNamedFramebufferStatus(GLuint, GLenum) GLenum;
fn glGetNamedFramebufferParameteriv(GLuint, GLenum, GLint*);
fn glGetNamedFramebufferAttachmentParameteriv(GLuint, GLenum, GLenum, GLint*);
fn glCreateRenderbuffers(GLsizei, GLuint*);
fn glNamedRenderbufferStorage(GLuint, GLenum, GLsizei, GLsizei);
fn glNamedRenderbufferStorageMultisample(GLuint, GLsizei, GLenum, GLsizei, GLsizei);
fn glGetNamedRenderbufferParameteriv(GLuint, GLenum, GLint*);
fn glCreateTextures(GLenum, GLsizei, GLuint*);
fn glTextureBuffer(GLuint, GLenum, GLuint);
fn glTextureBufferRange(GLuint, GLenum, GLuint, GLintptr, GLsizeiptr);
fn glTextureStorage1D(GLuint, GLsizei, GLenum, GLsizei);
fn glTextureStorage2D(GLuint, GLsizei, GLenum, GLsizei, GLsizei);
fn glTextureStorage3D(GLuint, GLsizei, GLenum, GLsizei, GLsizei, GLsizei);
fn glTextureStorage2DMultisample(GLuint, GLsizei, GLenum, GLsizei, GLsizei, GLboolean);
fn glTextureStorage3DMultisample(GLuint, GLsizei, GLenum, GLsizei, GLsizei, GLsizei, GLboolean);
fn glTextureSubImage1D(GLuint, GLint, GLint, GLsizei, GLenum, GLenum, const(void)*);
fn glTextureSubImage2D(GLuint, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const(void)*);
fn glTextureSubImage3D(GLuint, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const(void)*);
fn glCompressedTextureSubImage1D(GLuint, GLint, GLint, GLsizei, GLenum, GLsizei, const(void)*);
fn glCompressedTextureSubImage2D(GLuint, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const(void)*);
fn glCompressedTextureSubImage3D(GLuint, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const(void)*);
fn glCopyTextureSubImage1D(GLuint, GLint, GLint, GLint, GLint, GLsizei);
fn glCopyTextureSubImage2D(GLuint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei);
fn glCopyTextureSubImage3D(GLuint, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei);
fn glTextureParameterf(GLuint, GLenum, GLfloat);
fn glTextureParameterfv(GLuint, GLenum, const(GLfloat)*);
fn glTextureParameteri(GLuint, GLenum, GLint);
fn glTextureParameterIiv(GLuint, GLenum, const(GLint)*);
fn glTextureParameterIuiv(GLuint, GLenum, const(GLuint)*);
fn glTextureParameteriv(GLuint, GLenum, const(GLint)*);
fn glGenerateTextureMipmap(GLuint);
fn glBindTextureUnit(GLuint, GLuint);
fn glGetTextureImage(GLuint, GLint, GLenum, GLenum, GLsizei, void*);
fn glGetCompressedTextureImage(GLuint, GLint, GLsizei, void*);
fn glGetTextureLevelParameterfv(GLuint, GLint, GLenum, GLfloat*);
fn glGetTextureLevelParameteriv(GLuint, GLint, GLenum, GLint*);
fn glGetTextureParameterfv(GLuint, GLenum, GLfloat*);
fn glGetTextureParameterIiv(GLuint, GLenum, GLint*);
fn glGetTextureParameterIuiv(GLuint, GLenum, GLuint*);
fn glGetTextureParameteriv(GLuint, GLenum, GLint*);
fn glCreateVertexArrays(GLsizei, GLuint*);
fn glDisableVertexArrayAttrib(GLuint, GLuint);
fn glEnableVertexArrayAttrib(GLuint, GLuint);
fn glVertexArrayElementBuffer(GLuint, GLuint);
fn glVertexArrayVertexBuffer(GLuint, GLuint, GLuint, GLintptr, GLsizei);
fn glVertexArrayVertexBuffers(GLuint, GLuint, GLsizei, const(GLuint)*, const(GLintptr)*, const(GLsizei)*);
fn glVertexArrayAttribBinding(GLuint, GLuint, GLuint);
fn glVertexArrayAttribFormat(GLuint, GLuint, GLint, GLenum, GLboolean, GLuint);
fn glVertexArrayAttribIFormat(GLuint, GLuint, GLint, GLenum, GLuint);
fn glVertexArrayAttribLFormat(GLuint, GLuint, GLint, GLenum, GLuint);
fn glVertexArrayBindingDivisor(GLuint, GLuint, GLuint);
fn glGetVertexArrayiv(GLuint, GLenum, GLint*);
fn glGetVertexArrayIndexediv(GLuint, GLuint, GLenum, GLint*);
fn glGetVertexArrayIndexed64iv(GLuint, GLuint, GLenum, GLint64*);
fn glCreateSamplers(GLsizei, GLuint*);
fn glCreateProgramPipelines(GLsizei, GLuint*);
fn glCreateQueries(GLenum, GLsizei, GLuint*);
fn glGetQueryBufferObjecti64v(GLuint, GLuint, GLenum, GLintptr);
fn glGetQueryBufferObjectiv(GLuint, GLuint, GLenum, GLintptr);
fn glGetQueryBufferObjectui64v(GLuint, GLuint, GLenum, GLintptr);
fn glGetQueryBufferObjectuiv(GLuint, GLuint, GLenum, GLintptr);
fn glMemoryBarrierByRegion(GLbitfield);
fn glGetTextureSubImage(GLuint, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, GLsizei, void*);
fn glGetCompressedTextureSubImage(GLuint, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLsizei, void*);
fn glGetGraphicsResetStatus() GLenum;
fn glGetnCompressedTexImage(GLenum, GLint, GLsizei, void*);
fn glGetnTexImage(GLenum, GLint, GLenum, GLenum, GLsizei, void*);
fn glGetnUniformdv(GLuint, GLint, GLsizei, GLdouble*);
fn glGetnUniformfv(GLuint, GLint, GLsizei, GLfloat*);
fn glGetnUniformiv(GLuint, GLint, GLsizei, GLint*);
fn glGetnUniformuiv(GLuint, GLint, GLsizei, GLuint*);
fn glReadnPixels(GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, GLsizei, void*);
fn glGetnMapdv(GLenum, GLenum, GLsizei, GLdouble*);
fn glGetnMapfv(GLenum, GLenum, GLsizei, GLfloat*);
fn glGetnMapiv(GLenum, GLenum, GLsizei, GLint*);
fn glGetnPixelMapfv(GLenum, GLsizei, GLfloat*);
fn glGetnPixelMapuiv(GLenum, GLsizei, GLuint*);
fn glGetnPixelMapusv(GLenum, GLsizei, GLushort*);
fn glGetnPolygonStipple(GLsizei, GLubyte*);
fn glGetnColorTable(GLenum, GLenum, GLenum, GLsizei, void*);
fn glGetnConvolutionFilter(GLenum, GLenum, GLenum, GLsizei, void*);
fn glGetnSeparableFilter(GLenum, GLenum, GLenum, GLsizei, void*, GLsizei, void*, void*);
fn glGetnHistogram(GLenum, GLboolean, GLenum, GLenum, GLsizei, void*);
fn glGetnMinmax(GLenum, GLboolean, GLenum, GLenum, GLsizei, void*);
fn glTextureBarrier();
fn glSpecializeShader(GLuint, const(GLchar)*, GLuint, const(GLuint)*, const(GLuint)*);
fn glMultiDrawArraysIndirectCount(GLenum, const(void)*, GLintptr, GLsizei, GLsizei);
fn glMultiDrawElementsIndirectCount(GLenum, GLenum, const(void)*, GLintptr, GLsizei, GLsizei);
fn glPolygonOffsetClamp(GLfloat, GLfloat, GLfloat);

lib.gl.gl45

module lib.gl.gl45;

public import lib.gl.types;
public import lib.gl.funcs;
public import lib.gl.ext;
public import lib.gl.enums;

lib.gl.loader

module lib.gl.loader;


global GL_MAJOR: i32;
global GL_MINOR: i32;

fn gladLoadGL(load: Loader) bool { }

lib.gl.gl33

module lib.gl.gl33;

public import lib.gl.types;
public import lib.gl.funcs;
public import lib.gl.ext;
public import lib.gl.enums;

lib.gl.ext

module lib.gl.ext;


global GL_AMD_shader_atomic_counter_ops: bool;
global GL_ARB_ES2_compatibility: bool;
global GL_ARB_ES3_1_compatibility: bool;
global GL_ARB_ES3_2_compatibility: bool;
global GL_ARB_ES3_compatibility: bool;
global GL_ARB_direct_state_access: bool;
global GL_ARB_explicit_attrib_location: bool;
global GL_ARB_sampler_objects: bool;
global GL_ARB_shader_atomic_counter_ops: bool;
global GL_ARB_shader_ballot: bool;
global GL_ARB_texture_storage: bool;
global GL_EXT_memory_object: bool;
global GL_EXT_memory_object_fd: bool;
global GL_EXT_memory_object_win32: bool;
global GL_EXT_semaphore: bool;
global GL_EXT_semaphore_fd: bool;
global GL_EXT_semaphore_win32: bool;
global GL_EXT_texture_filter_anisotropic: bool;

fn glPrimitiveBoundingBoxARB(GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
fn glGetUnsignedBytevEXT(GLenum, GLubyte*);
fn glGetUnsignedBytei_vEXT(GLenum, GLuint, GLubyte*);
fn glDeleteMemoryObjectsEXT(GLsizei, const(GLuint)*);
fn glIsMemoryObjectEXT(GLuint) GLboolean;
fn glCreateMemoryObjectsEXT(GLsizei, GLuint*);
fn glMemoryObjectParameterivEXT(GLuint, GLenum, const(GLint)*);
fn glGetMemoryObjectParameterivEXT(GLuint, GLenum, GLint*);
fn glTexStorageMem2DEXT(GLenum, GLsizei, GLenum, GLsizei, GLsizei, GLuint, GLuint64);
fn glTexStorageMem2DMultisampleEXT(GLenum, GLsizei, GLenum, GLsizei, GLsizei, GLboolean, GLuint, GLuint64);
fn glTexStorageMem3DEXT(GLenum, GLsizei, GLenum, GLsizei, GLsizei, GLsizei, GLuint, GLuint64);
fn glTexStorageMem3DMultisampleEXT(GLenum, GLsizei, GLenum, GLsizei, GLsizei, GLsizei, GLboolean, GLuint, GLuint64);
fn glBufferStorageMemEXT(GLenum, GLsizeiptr, GLuint, GLuint64);
fn glTextureStorageMem2DEXT(GLuint, GLsizei, GLenum, GLsizei, GLsizei, GLuint, GLuint64);
fn glTextureStorageMem2DMultisampleEXT(GLuint, GLsizei, GLenum, GLsizei, GLsizei, GLboolean, GLuint, GLuint64);
fn glTextureStorageMem3DEXT(GLuint, GLsizei, GLenum, GLsizei, GLsizei, GLsizei, GLuint, GLuint64);
fn glTextureStorageMem3DMultisampleEXT(GLuint, GLsizei, GLenum, GLsizei, GLsizei, GLsizei, GLboolean, GLuint, GLuint64);
fn glNamedBufferStorageMemEXT(GLuint, GLsizeiptr, GLuint, GLuint64);
fn glTexStorageMem1DEXT(GLenum, GLsizei, GLenum, GLsizei, GLuint, GLuint64);
fn glTextureStorageMem1DEXT(GLuint, GLsizei, GLenum, GLsizei, GLuint, GLuint64);
fn glImportMemoryFdEXT(GLuint, GLuint64, GLenum, GLint);
fn glImportMemoryWin32HandleEXT(GLuint, GLuint64, GLenum, void*);
fn glImportMemoryWin32NameEXT(GLuint, GLuint64, GLenum, const(void)*);
fn glGenSemaphoresEXT(GLsizei, GLuint*);
fn glDeleteSemaphoresEXT(GLsizei, const(GLuint)*);
fn glIsSemaphoreEXT(GLuint) GLboolean;
fn glSemaphoreParameterui64vEXT(GLuint, GLenum, const(GLuint64)*);
fn glGetSemaphoreParameterui64vEXT(GLuint, GLenum, GLuint64*);
fn glWaitSemaphoreEXT(GLuint, GLuint, const(GLuint)*, GLuint, const(GLuint)*, const(GLenum)*);
fn glSignalSemaphoreEXT(GLuint, GLuint, const(GLuint)*, GLuint, const(GLuint)*, const(GLenum)*);
fn glImportSemaphoreFdEXT(GLuint, GLenum, GLint);
fn glImportSemaphoreWin32HandleEXT(GLuint, GLenum, void*);
fn glImportSemaphoreWin32NameEXT(GLuint, GLenum, const(void)*);

lib.ohmd.loader

module lib.ohmd.loader;


fn loadLibrary() Library { }
fn loadFunctions(l: void* delegate(string)) { }

lib.ohmd

//! OpenHMD - Free and Open Source API and drivers for immersive
//! technology. Copyright (C) 2013 Fredrik Hultin. Copyright (C) 2013 Jakob
//! Bornecrantz. Distributed under the Boost 1.0 licence, see
//! src/charge/license.volt for full text.
module lib.ohmd;


//! \file openhmd.h Main header for OpenHMD public API. Maximum length of a
//! string, including termination, in OpenHMD. *
enum OHMD_STR_SIZE;

//! Return status codes, used for all functions that can return an error.
//! *
enum ohmd_status
{
	OK,
	UNKNOWN_ERROR,
	INVALID_PARAMETER,
	UNSUPPORTED,
	INVALID_OPERATION,
	//! USER_RESERVED and below can be used for user purposes, such as errors
	//! within ohmd wrappers, etc. *
	USER_RESERVED,
}

//! A collection of string value information types, used for getting
//! information with ohmd_list_gets(). *
enum ohmd_string_value
{
	VENDOR,
	PRODUCT,
	PATH,
}

//! A collection of string descriptions, used for getting strings with
//! ohmd_gets(). *
enum ohmd_string_description
{
	GLSL_DISTORTION_VERT_SRC,
	GLSL_DISTORTION_FRAG_SRC,
}

//! A collection of float value information types, used for getting and
//! setting information with ohmd_device_getf() and ohmd_device_setf(). *
enum ohmd_float_value
{
	//! float[4] (get): Absolute rotation of the device, in space, as a
	//! quaternion (x, y, z, w). *
	ROTATION_QUAT,
	//! float[16] (get): A "ready to use" OpenGL style 4x4 matrix with a
	//! modelview matrix for the left eye of the HMD. *
	LEFT_EYE_GL_MODELVIEW_MATRIX,
	//! float[16] (get): A "ready to use" OpenGL style 4x4 matrix with a
	//! modelview matrix for the right eye of the HMD. *
	RIGHT_EYE_GL_MODELVIEW_MATRIX,
	//! float[16] (get): A "ready to use" OpenGL style 4x4 matrix with a
	//! projection matrix for the left eye of the HMD. *
	LEFT_EYE_GL_PROJECTION_MATRIX,
	//! float[16] (get): A "ready to use" OpenGL style 4x4 matrix with a
	//! projection matrix for the right eye of the HMD. *
	RIGHT_EYE_GL_PROJECTION_MATRIX,
	//! float[3] (get): A 3-D vector representing the absolute position of the
	//! device, in space. *
	POSITION_VECTOR,
	//! float[1] (get): Physical width of the device screen in metres. *
	SCREEN_HORIZONTAL_SIZE,
	//! float[1] (get): Physical height of the device screen in metres. *
	SCREEN_VERTICAL_SIZE,
	//! float[1] (get): Physical separation of the device lenses in metres. *
	LENS_HORIZONTAL_SEPARATION,
	//! float[1] (get): Physical vertical position of the lenses in metres. *
	LENS_VERTICAL_POSITION,
	//! float[1] (get): Physical field of view for the left eye in degrees. *
	LEFT_EYE_FOV,
	//! float[1] (get): Physical display aspect ratio for the left eye screen.
	//! *
	LEFT_EYE_ASPECT_RATIO,
	//! float[1] (get): Physical field of view for the left right in degrees.
	//! *
	RIGHT_EYE_FOV,
	//! float[1] (get): Physical display aspect ratio for the right eye
	//! screen. *
	RIGHT_EYE_ASPECT_RATIO,
	//! float[1] (get, set): Physical interpupillary distance of the user in
	//! metres. *
	EYE_IPD,
	//! float[1] (get, set): Z-far value for the projection matrix
	//! calculations (i.e. drawing distance). *
	PROJECTION_ZFAR,
	//! float[1] (get, set): Z-near value for the projection matrix
	//! calculations (i.e. close clipping distance). *
	PROJECTION_ZNEAR,
	//! float[6] (get): Device specific distortion value. *
	DISTORTION_K,
	//! float[10] (set): Perform sensor fusion on values from external
	//! sensors.
	EXTERNAL_SENSOR_FUSION,
	//! float[4] (get): Universal shader distortion coefficients (PanoTools
	//! model . *
	UNIVERSAL_DISTORTION_K,
	//! float[3] (get): Universal shader aberration coefficients (post warp
	//! scaling . *
	UNIVERSAL_ABERRATION_K,
}

//! A collection of int value information types used for getting
//! information with ohmd_device_geti(). *
enum ohmd_int_value
{
	//! int[1] (get): Physical horizontal resolution of the device screen. *
	SCREEN_HORIZONTAL_RESOLUTION,
	//! int[1] (get): Physical vertical resolution of the device screen. *
	SCREEN_VERTICAL_RESOLUTION,
	//! int[1] (get): Get number of events waiting in digital input event
	//! queue. *
	BUTTON_EVENT_COUNT,
	//! int[1] (get): Get if the there was an overflow in the event queue
	//! causing events to be dropped. *
	BUTTON_EVENT_OVERFLOW,
	//! int[1] (get): Get the number of physical digital input buttons on the
	//! device. *
	BUTTON_COUNT,
	//! int[2] (get): Performs an event pop action. Format: [button_index,
	//! button_state], where button_state is either OHMD_BUTTON_DOWN or
	//! OHMD_BUTTON_UP *
	BUTTON_POP_EVENT,
}

//! A collection of data information types used for setting information
//! with ohmd_set_data(). *
enum ohmd_data_value
{
	//! void* (set): Set void* data for use in the internal drivers. *
	DRIVER_DATA,
	//! ohmd_device_properties* (set): Set the device properties based on the
	//! ohmd_device_properties struct for use in the internal drivers.
	DRIVER_PROPERTIES,
}

enum ohmd_int_settings
{
	//! int[1] (set, default: 1): Set this to 0 to prevent OpenHMD from
	//! creating background threads to do automatic device ticking. Call
	//! ohmd_update(); must be called frequently, at least 10 times per
	//! second, if the background threads are disabled. *
	IDS_AUTOMATIC_UPDATE,
}

//! Button states for digital input events. *
enum ohmd_button_state
{
	//! Button was pressed. *
	BUTTON_DOWN,
	//! Button was released. *
	BUTTON_UP,
}

//! An opaque pointer to a context structure. *
struct ohmd_context
{
public:
	fn destroy() { }
	fn probe() i32 { }
	fn update() { }
	fn list_gets(index: i32, type: ohmd_string_value) const(char)* { }
	fn list_open_device(index: i32) ohmd_device* { }
	fn list_open_device_s(index: i32, settings: ohmd_device_settings*) ohmd_device* { }
}

//! An opaque pointer to a structure representing a device, such as an
//! HMD. *
struct ohmd_device
{
public:
	fn close() { }
	fn get_rot(vec: f32[4]) i32 { }
	fn get_pos(vec: f32[3]) i32 { }
	fn getf(type: ohmd_float_value, _out: f32*) i32 { }
	fn setf(type: ohmd_float_value, _in: const(f32)*) i32 { }
	fn geti(type: ohmd_float_value, _out: i32*) i32 { }
	fn seti(type: ohmd_float_value, _in: const(i32)*) i32 { }
}

//! An opaque pointer to a structure representing arguments for a device.
//! *
struct ohmd_device_settings
{
}

//! Create an OpenHMD context.
fn ohmd_ctx_create() ohmd_context*;
//! Destroy an OpenHMD context.
fn ohmd_ctx_destroy(ctx: ohmd_context*);
//! Get the last error as a human readable string.
fn ohmd_ctx_get_error(ctx: ohmd_context*, const(char)*);
//! Update a context.
fn ohmd_ctx_update(ctx: ohmd_context*);
//! Probe for devices.
fn ohmd_ctx_probe(ctx: ohmd_context*) i32;
//! Get string from openhmd.
fn ohmd_gets(type: ohmd_string_description, _out: const(char)**) i32;
//! Get device description from enumeration list index.
fn ohmd_list_gets(ctx: ohmd_context*, index: i32, type: ohmd_string_value) const(char)*;
//! Open a device.
fn ohmd_list_open_device(ctx: ohmd_context*, index: i32) ohmd_device*;
//! Open a device with additional settings provided.
fn ohmd_list_open_device_s(ctx: ohmd_context*, index: i32, settings: ohmd_device_settings*) ohmd_device*;
//! Specify int settings in a device settings struct.
fn ohmd_device_settings_seti(settings: ohmd_device_settings*, key: ohmd_int_settings, val: const(i32)*) ohmd_status;
//! Create a device settings instance.
fn ohmd_device_settings_create(ctx: ohmd_context*) ohmd_device_settings*;
//! Destroy a device settings instance.
fn ohmd_device_settings_destroy(settings: ohmd_device_settings*);
//! Close a device.
fn ohmd_close_device(device: ohmd_device*) i32;
//! Get a floating point value from a device.
fn ohmd_device_getf(device: ohmd_device*, type: ohmd_float_value, _out: f32*) i32;
//! Set a floating point value for a device.
fn ohmd_device_setf(device: ohmd_device*, type: ohmd_float_value, _in: const(f32)*) i32;
//! Get an integer value from a device.
fn ohmd_device_geti(device: ohmd_device*, type: ohmd_int_value, _out: i32*) i32;
//! Set an integer value for a device.
fn ohmd_device_seti(device: ohmd_device*, type: ohmd_int_value, _in: const(i32)*) i32;
//! Set an void* data value for a device.
fn ohmd_device_set_data(device: ohmd_device*, type: ohmd_data_value, _in: const(void)*) i32;

lib.sdl2.scancode

module lib.sdl2.scancode;


enum SDL_SCANCODE_UNKNOWN;
enum SDL_SCANCODE_A;
enum SDL_SCANCODE_B;
enum SDL_SCANCODE_C;
enum SDL_SCANCODE_D;
enum SDL_SCANCODE_E;
enum SDL_SCANCODE_F;
enum SDL_SCANCODE_G;
enum SDL_SCANCODE_H;
enum SDL_SCANCODE_I;
enum SDL_SCANCODE_J;
enum SDL_SCANCODE_K;
enum SDL_SCANCODE_L;
enum SDL_SCANCODE_M;
enum SDL_SCANCODE_N;
enum SDL_SCANCODE_O;
enum SDL_SCANCODE_P;
enum SDL_SCANCODE_Q;
enum SDL_SCANCODE_R;
enum SDL_SCANCODE_S;
enum SDL_SCANCODE_T;
enum SDL_SCANCODE_U;
enum SDL_SCANCODE_V;
enum SDL_SCANCODE_W;
enum SDL_SCANCODE_X;
enum SDL_SCANCODE_Y;
enum SDL_SCANCODE_Z;
enum SDL_SCANCODE_1;
enum SDL_SCANCODE_2;
enum SDL_SCANCODE_3;
enum SDL_SCANCODE_4;
enum SDL_SCANCODE_5;
enum SDL_SCANCODE_6;
enum SDL_SCANCODE_7;
enum SDL_SCANCODE_8;
enum SDL_SCANCODE_9;
enum SDL_SCANCODE_0;
enum SDL_SCANCODE_RETURN;
enum SDL_SCANCODE_ESCAPE;
enum SDL_SCANCODE_BACKSPACE;
enum SDL_SCANCODE_TAB;
enum SDL_SCANCODE_SPACE;
enum SDL_SCANCODE_MINUS;
enum SDL_SCANCODE_EQUALS;
enum SDL_SCANCODE_LEFTBRACKET;
enum SDL_SCANCODE_RIGHTBRACKET;
enum SDL_SCANCODE_BACKSLASH;
enum SDL_SCANCODE_NONUSHASH;
enum SDL_SCANCODE_SEMICOLON;
enum SDL_SCANCODE_APOSTROPHE;
enum SDL_SCANCODE_GRAVE;
enum SDL_SCANCODE_COMMA;
enum SDL_SCANCODE_PERIOD;
enum SDL_SCANCODE_SLASH;
enum SDL_SCANCODE_CAPSLOCK;
enum SDL_SCANCODE_F1;
enum SDL_SCANCODE_F2;
enum SDL_SCANCODE_F3;
enum SDL_SCANCODE_F4;
enum SDL_SCANCODE_F5;
enum SDL_SCANCODE_F6;
enum SDL_SCANCODE_F7;
enum SDL_SCANCODE_F8;
enum SDL_SCANCODE_F9;
enum SDL_SCANCODE_F10;
enum SDL_SCANCODE_F11;
enum SDL_SCANCODE_F12;
enum SDL_SCANCODE_PRINTSCREEN;
enum SDL_SCANCODE_SCROLLLOCK;
enum SDL_SCANCODE_PAUSE;
enum SDL_SCANCODE_INSERT;
enum SDL_SCANCODE_HOME;
enum SDL_SCANCODE_PAGEUP;
enum SDL_SCANCODE_DELETE;
enum SDL_SCANCODE_END;
enum SDL_SCANCODE_PAGEDOWN;
enum SDL_SCANCODE_RIGHT;
enum SDL_SCANCODE_LEFT;
enum SDL_SCANCODE_DOWN;
enum SDL_SCANCODE_UP;
enum SDL_SCANCODE_NUMLOCKCLEAR;
enum SDL_SCANCODE_KP_DIVIDE;
enum SDL_SCANCODE_KP_MULTIPLY;
enum SDL_SCANCODE_KP_MINUS;
enum SDL_SCANCODE_KP_PLUS;
enum SDL_SCANCODE_KP_ENTER;
enum SDL_SCANCODE_KP_1;
enum SDL_SCANCODE_KP_2;
enum SDL_SCANCODE_KP_3;
enum SDL_SCANCODE_KP_4;
enum SDL_SCANCODE_KP_5;
enum SDL_SCANCODE_KP_6;
enum SDL_SCANCODE_KP_7;
enum SDL_SCANCODE_KP_8;
enum SDL_SCANCODE_KP_9;
enum SDL_SCANCODE_KP_0;
enum SDL_SCANCODE_KP_PERIOD;
enum SDL_SCANCODE_NONUSBACKSLASH;
enum SDL_SCANCODE_APPLICATION;
enum SDL_SCANCODE_POWER;
enum SDL_SCANCODE_KP_EQUALS;
enum SDL_SCANCODE_F13;
enum SDL_SCANCODE_F14;
enum SDL_SCANCODE_F15;
enum SDL_SCANCODE_F16;
enum SDL_SCANCODE_F17;
enum SDL_SCANCODE_F18;
enum SDL_SCANCODE_F19;
enum SDL_SCANCODE_F20;
enum SDL_SCANCODE_F21;
enum SDL_SCANCODE_F22;
enum SDL_SCANCODE_F23;
enum SDL_SCANCODE_F24;
enum SDL_SCANCODE_EXECUTE;
enum SDL_SCANCODE_HELP;
enum SDL_SCANCODE_MENU;
enum SDL_SCANCODE_SELECT;
enum SDL_SCANCODE_STOP;
enum SDL_SCANCODE_AGAIN;
enum SDL_SCANCODE_UNDO;
enum SDL_SCANCODE_CUT;
enum SDL_SCANCODE_COPY;
enum SDL_SCANCODE_PASTE;
enum SDL_SCANCODE_FIND;
enum SDL_SCANCODE_MUTE;
enum SDL_SCANCODE_VOLUMEUP;
enum SDL_SCANCODE_VOLUMEDOWN;
enum SDL_SCANCODE_KP_COMMA;
enum SDL_SCANCODE_KP_EQUALSAS400;
enum SDL_SCANCODE_INTERNATIONAL1;
enum SDL_SCANCODE_INTERNATIONAL2;
enum SDL_SCANCODE_INTERNATIONAL3;
enum SDL_SCANCODE_INTERNATIONAL4;
enum SDL_SCANCODE_INTERNATIONAL5;
enum SDL_SCANCODE_INTERNATIONAL6;
enum SDL_SCANCODE_INTERNATIONAL7;
enum SDL_SCANCODE_INTERNATIONAL8;
enum SDL_SCANCODE_INTERNATIONAL9;
enum SDL_SCANCODE_LANG1;
enum SDL_SCANCODE_LANG2;
enum SDL_SCANCODE_LANG3;
enum SDL_SCANCODE_LANG4;
enum SDL_SCANCODE_LANG5;
enum SDL_SCANCODE_LANG6;
enum SDL_SCANCODE_LANG7;
enum SDL_SCANCODE_LANG8;
enum SDL_SCANCODE_LANG9;
enum SDL_SCANCODE_ALTERASE;
enum SDL_SCANCODE_SYSREQ;
enum SDL_SCANCODE_CANCEL;
enum SDL_SCANCODE_CLEAR;
enum SDL_SCANCODE_PRIOR;
enum SDL_SCANCODE_RETURN2;
enum SDL_SCANCODE_SEPARATOR;
enum SDL_SCANCODE_OUT;
enum SDL_SCANCODE_OPER;
enum SDL_SCANCODE_CLEARAGAIN;
enum SDL_SCANCODE_CRSEL;
enum SDL_SCANCODE_EXSEL;
enum SDL_SCANCODE_KP_00;
enum SDL_SCANCODE_KP_000;
enum SDL_SCANCODE_THOUSANDSSEPARATOR;
enum SDL_SCANCODE_DECIMALSEPARATOR;
enum SDL_SCANCODE_CURRENCYUNIT;
enum SDL_SCANCODE_CURRENCYSUBUNIT;
enum SDL_SCANCODE_KP_LEFTPAREN;
enum SDL_SCANCODE_KP_RIGHTPAREN;
enum SDL_SCANCODE_KP_LEFTBRACE;
enum SDL_SCANCODE_KP_RIGHTBRACE;
enum SDL_SCANCODE_KP_TAB;
enum SDL_SCANCODE_KP_BACKSPACE;
enum SDL_SCANCODE_KP_A;
enum SDL_SCANCODE_KP_B;
enum SDL_SCANCODE_KP_C;
enum SDL_SCANCODE_KP_D;
enum SDL_SCANCODE_KP_E;
enum SDL_SCANCODE_KP_F;
enum SDL_SCANCODE_KP_XOR;
enum SDL_SCANCODE_KP_POWER;
enum SDL_SCANCODE_KP_PERCENT;
enum SDL_SCANCODE_KP_LESS;
enum SDL_SCANCODE_KP_GREATER;
enum SDL_SCANCODE_KP_AMPERSAND;
enum SDL_SCANCODE_KP_DBLAMPERSAND;
enum SDL_SCANCODE_KP_VERTICALBAR;
enum SDL_SCANCODE_KP_DBLVERTICALBAR;
enum SDL_SCANCODE_KP_COLON;
enum SDL_SCANCODE_KP_HASH;
enum SDL_SCANCODE_KP_SPACE;
enum SDL_SCANCODE_KP_AT;
enum SDL_SCANCODE_KP_EXCLAM;
enum SDL_SCANCODE_KP_MEMSTORE;
enum SDL_SCANCODE_KP_MEMRECALL;
enum SDL_SCANCODE_KP_MEMCLEAR;
enum SDL_SCANCODE_KP_MEMADD;
enum SDL_SCANCODE_KP_MEMSUBTRACT;
enum SDL_SCANCODE_KP_MEMMULTIPLY;
enum SDL_SCANCODE_KP_MEMDIVIDE;
enum SDL_SCANCODE_KP_PLUSMINUS;
enum SDL_SCANCODE_KP_CLEAR;
enum SDL_SCANCODE_KP_CLEARENTRY;
enum SDL_SCANCODE_KP_BINARY;
enum SDL_SCANCODE_KP_OCTAL;
enum SDL_SCANCODE_KP_DECIMAL;
enum SDL_SCANCODE_KP_HEXADECIMAL;
enum SDL_SCANCODE_LCTRL;
enum SDL_SCANCODE_LSHIFT;
enum SDL_SCANCODE_LALT;
enum SDL_SCANCODE_LGUI;
enum SDL_SCANCODE_RCTRL;
enum SDL_SCANCODE_RSHIFT;
enum SDL_SCANCODE_RALT;
enum SDL_SCANCODE_RGUI;
enum SDL_SCANCODE_MODE;
enum SDL_SCANCODE_AUDIONEXT;
enum SDL_SCANCODE_AUDIOPREV;
enum SDL_SCANCODE_AUDIOSTOP;
enum SDL_SCANCODE_AUDIOPLAY;
enum SDL_SCANCODE_AUDIOMUTE;
enum SDL_SCANCODE_MEDIASELECT;
enum SDL_SCANCODE_WWW;
enum SDL_SCANCODE_MAIL;
enum SDL_SCANCODE_CALCULATOR;
enum SDL_SCANCODE_COMPUTER;
enum SDL_SCANCODE_AC_SEARCH;
enum SDL_SCANCODE_AC_HOME;
enum SDL_SCANCODE_AC_BACK;
enum SDL_SCANCODE_AC_FORWARD;
enum SDL_SCANCODE_AC_STOP;
enum SDL_SCANCODE_AC_REFRESH;
enum SDL_SCANCODE_AC_BOOKMARKS;
enum SDL_SCANCODE_BRIGHTNESSDOWN;
enum SDL_SCANCODE_BRIGHTNESSUP;
enum SDL_SCANCODE_DISPLAYSWITCH;
enum SDL_SCANCODE_KBDILLUMTOGGLE;
enum SDL_SCANCODE_KBDILLUMDOWN;
enum SDL_SCANCODE_KBDILLUMUP;
enum SDL_SCANCODE_EJECT;
enum SDL_SCANCODE_SLEEP;
enum SDL_SCANCODE_APP1;
enum SDL_SCANCODE_APP2;
enum SDL_NUM_SCANCODES;

//! \brief The SDL keyboard scancode representation.
alias SDL_Scancode = i32;

lib.sdl2.shape

module lib.sdl2.shape;


enum SDL_NONSHAPEABLE_WINDOW;
enum SDL_INVALID_SHAPE_ARGUMENT;
enum SDL_WINDOW_LACKS_SHAPE;
enum ShapeModeDefault;
enum ShapeModeBinarizeAlpha;
enum ShapeModeReverseBinarizeAlpha;
enum ShapeModeColorKey;

//! \brief An enum denoting the specific type of contents present in an
//! SDL_WindowShapeParams union. *
alias WindowShapeMode = i32;

//! \brief A struct that tags the SDL_WindowShapeParams union with an enum
//! describing the type of its contents. *
struct SDL_WindowShapeMode
{
public:
	mode: WindowShapeMode;
	parameters: SDL_WindowShapeParams;
}

//! \brief A union containing parameters for shaped windows. *
union SDL_WindowShapeParams
{
public:
	binarizationCutoff: Uint8;
	colorKey: SDL_Color;
}

//! \brief Create a window that can be shaped with the specified position,
//! dimensions, and flags.
fn SDL_CreateShapedWindow(title: const(const(char)*), x: u32, y: u32, w: u32, h: u32, flags: Uint32) SDL_Window*;
//! \brief Return whether the given window is a shaped window.
fn SDL_IsShapedWindow(window: const(const(SDL_Window)*)) SDL_bool;
fn SDL_SHAPEMODEALPHA(mode: WindowShapeMode) bool { }
//! \brief Set the shape and parameters of a shaped window.
fn SDL_SetWindowShape(window: SDL_Window*, shape: SDL_Surface*, shape_mode: SDL_WindowShapeMode*) i32;
//! \brief Get the shape parameters of a shaped window.
fn SDL_GetShapedWindowMode(window: SDL_Window*, shape_mode: SDL_WindowShapeMode*) i32;

lib.sdl2.video

module lib.sdl2.video;


enum SDL_WINDOW_FULLSCREEN;
enum SDL_WINDOW_OPENGL;
enum SDL_WINDOW_SHOWN;
enum SDL_WINDOW_HIDDEN;
enum SDL_WINDOW_BORDERLESS;
enum SDL_WINDOW_RESIZABLE;
enum SDL_WINDOW_MINIMIZED;
enum SDL_WINDOW_MAXIMIZED;
enum SDL_WINDOW_INPUT_GRABBED;
enum SDL_WINDOW_INPUT_FOCUS;
enum SDL_WINDOW_MOUSE_FOCUS;
enum SDL_WINDOW_FULLSCREEN_DESKTOP;
enum SDL_WINDOW_FOREIGN;
enum SDL_WINDOW_ALLOW_HIGHDPI;
enum SDL_WINDOW_MOUSE_CAPTURE;
enum SDL_WINDOW_ALWAYS_ON_TOP;
enum SDL_WINDOW_SKIP_TASKBAR;
enum SDL_WINDOW_UTILITY;
enum SDL_WINDOW_POPUP_MENU;
//! \brief Used to indicate that you don't care what the window position
//! is.
enum SDL_WINDOWPOS_UNDEFINED_MASK;
//! \brief Used to indicate that the window position should be centered.
enum SDL_WINDOWPOS_CENTERED_MASK;
enum SDL_WINDOWPOS_CENTERED;
enum SDL_WINDOWEVENT_NONE;
enum SDL_WINDOWEVENT_SHOWN;
enum SDL_WINDOWEVENT_HIDDEN;
enum SDL_WINDOWEVENT_EXPOSED;
enum SDL_WINDOWEVENT_MOVED;
enum SDL_WINDOWEVENT_RESIZED;
enum SDL_WINDOWEVENT_SIZE_CHANGED;
enum SDL_WINDOWEVENT_MINIMIZED;
enum SDL_WINDOWEVENT_MAXIMIZED;
enum SDL_WINDOWEVENT_RESTORED;
enum SDL_WINDOWEVENT_ENTER;
enum SDL_WINDOWEVENT_LEAVE;
enum SDL_WINDOWEVENT_FOCUS_GAINED;
enum SDL_WINDOWEVENT_FOCUS_LOST;
enum SDL_WINDOWEVENT_CLOSE;
enum SDL_WINDOWEVENT_TAKE_FOCUS;
enum SDL_WINDOWEVENT_HIT_TEST;
enum SDL_GL_RED_SIZE;
enum SDL_GL_GREEN_SIZE;
enum SDL_GL_BLUE_SIZE;
enum SDL_GL_ALPHA_SIZE;
enum SDL_GL_BUFFER_SIZE;
enum SDL_GL_DOUBLEBUFFER;
enum SDL_GL_DEPTH_SIZE;
enum SDL_GL_STENCIL_SIZE;
enum SDL_GL_ACCUM_RED_SIZE;
enum SDL_GL_ACCUM_GREEN_SIZE;
enum SDL_GL_ACCUM_BLUE_SIZE;
enum SDL_GL_ACCUM_ALPHA_SIZE;
enum SDL_GL_STEREO;
enum SDL_GL_MULTISAMPLEBUFFERS;
enum SDL_GL_MULTISAMPLESAMPLES;
enum SDL_GL_ACCELERATED_VISUAL;
enum SDL_GL_RETAINED_BACKING;
enum SDL_GL_CONTEXT_MAJOR_VERSION;
enum SDL_GL_CONTEXT_MINOR_VERSION;
enum SDL_GL_CONTEXT_EGL;
enum SDL_GL_CONTEXT_FLAGS;
enum SDL_GL_CONTEXT_PROFILE_MASK;
enum SDL_GL_SHARE_WITH_CURRENT_CONTEXT;
enum SDL_GL_CONTEXT_PROFILE_CORE;
enum SDL_GL_CONTEXT_PROFILE_COMPATIBILITY;
enum SDL_GL_CONTEXT_PROFILE_ES;
enum SDL_GL_CONTEXT_DEBUG_FLAG;
enum SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG;
enum SDL_GL_CONTEXT_ROBUST_ACCESS_FLAG;
enum SDL_GL_CONTEXT_RESET_ISOLATION_FLAG;

//! \brief The flags on a window
alias SDL_WindowFlags = i32;
//! \brief Event subtype for window events
alias SDL_WindowEventID = i32;
//! \brief An opaque handle to an OpenGL context.
alias SDL_GLContext = void*;
//! \brief OpenGL configuration attributes
alias SDL_GLattr = i32;
alias SDL_GLprofile = i32;
alias SDL_GLcontextFlag = i32;

//! \brief The structure that defines a display mode
struct SDL_DisplayMode
{
public:
	format: Uint32;
	w: i32;
	h: i32;
	refresh_rate: i32;
	driverdata: void*;
}

struct SDL_Window
{
}

fn SDL_WINDOWPOS_UNDEFINED_DISPLAY(X: i32) i32 { }
fn SDL_WINDOWPOS_UNDEFINED() i32 { }
fn SDL_WINDOWPOS_ISUNDEFINED(X: i32) bool { }
fn SDL_WINDOWPOS_CENTERED_DISPLAY(X: i32) i32 { }
fn SDL_WINDOWPOS_ISCENTERED(X: i32) bool { }
//! \brief Get the number of video drivers compiled into SDL
fn SDL_GetNumVideoDrivers() i32;
//! \brief Get the name of a built in video driver.
fn SDL_GetVideoDriver(index: i32) char*;
//! \brief Initialize the video subsystem, optionally specifying a video
//! driver.
fn SDL_VideoInit(driver_name: const(const(char)*)) i32;
//! \brief Shuts down the video subsystem.
fn SDL_VideoQuit();
//! \brief Returns the name of the currently initialized video driver.
fn SDL_GetCurrentVideoDriver() char*;
//! \brief Returns the number of available video displays.
fn SDL_GetNumVideoDisplays() i32;
//! \brief Get the name of a display in UTF-8 encoding
fn SDL_GetDisplayName(displayIndex: i32) char*;
//! \brief Get the desktop area represented by a display, with the primary
//! display located at 0,0
fn SDL_GetDisplayBounds(displayIndex: i32, rect: SDL_Rect*) i32;
//! \brief Get the usable desktop area represented by a display, with the
//! primary display located at 0,0
fn SDL_GetDisplayUsableBounds(displayIndex: i32, rect: SDL_Rect*) i32;
//! \brief Returns the number of available display modes.
fn SDL_GetNumDisplayModes(displayIndex: i32) i32;
//! \brief Fill in information about a specific display mode.
fn SDL_GetDisplayMode(displayIndex: i32, modeIndex: i32, mode: SDL_DisplayMode*) i32;
//! \brief Fill in information about the desktop display mode.
fn SDL_GetDesktopDisplayMode(displayIndex: i32, mode: SDL_DisplayMode*) i32;
//! \brief Fill in information about the current display mode.
fn SDL_GetCurrentDisplayMode(displayIndex: i32, mode: SDL_DisplayMode*) i32;
//! \brief Get the closest match to the requested display mode.
fn SDL_GetClosestDisplayMode(displayIndex: i32, mode: const(const(SDL_DisplayMode)*), closest: SDL_DisplayMode*) SDL_DisplayMode*;
//! \brief Get the display index associated with a window.
fn SDL_GetWindowDisplayIndex(window: SDL_Window*) i32;
//! \brief Set the display mode used when a fullscreen window is visible.
fn SDL_SetWindowDisplayMode(window: SDL_Window*, mode: const(const(SDL_DisplayMode)*)) i32;
//! \brief Fill in information about the display mode used when a
//! fullscreen window is visible.
fn SDL_GetWindowDisplayMode(window: SDL_Window*, mode: SDL_DisplayMode*) i32;
//! \brief Get the pixel format associated with the window.
fn SDL_GetWindowPixelFormat(window: SDL_Window*) Uint32;
//! \brief Create a window with the specified position, dimensions, and
//! flags.
fn SDL_CreateWindow(title: const(const(char)*), x: i32, y: i32, w: i32, h: i32, flags: Uint32) SDL_Window*;
//! \brief Create an SDL window from an existing native window.
fn SDL_CreateWindowFrom(data: const(const(void)*)) SDL_Window*;
//! \brief Get the numeric ID of a window, for logging purposes.
fn SDL_GetWindowID(window: SDL_Window*) Uint32;
//! \brief Get a window from a stored ID, or NULL if it doesn't exist.
fn SDL_GetWindowFromID(id: Uint32) SDL_Window*;
//! \brief Get the window flags.
fn SDL_GetWindowFlags(window: SDL_Window*) Uint32;
//! \brief Set the title of a window, in UTF-8 format.
fn SDL_SetWindowTitle(window: SDL_Window*, title: const(const(char)*));
//! \brief Get the title of a window, in UTF-8 format.
fn SDL_GetWindowTitle(window: SDL_Window*) char*;
//! \brief Set the icon for a window.
fn SDL_SetWindowIcon(window: SDL_Window*, icon: SDL_Surface*);
//! \brief Associate an arbitrary named pointer with a window.
fn SDL_SetWindowData(window: SDL_Window*, name: const(const(char)*), userdata: void*) void*;
//! \brief Retrieve the data pointer associated with a window.
fn SDL_GetWindowData(window: SDL_Window*, name: const(const(char)*)) void*;
//! \brief Set the position of a window.
fn SDL_SetWindowPosition(window: SDL_Window*, x: i32, y: i32);
//! \brief Get the position of a window.
fn SDL_GetWindowPosition(window: SDL_Window*, x: i32*, y: i32*);
//! \brief Set the size of a window's client area.
fn SDL_SetWindowSize(window: SDL_Window*, w: i32, h: i32);
//! \brief Get the size of a window's client area.
fn SDL_GetWindowSize(window: SDL_Window*, w: i32*, h: i32*);
//! \brief Get the size of a window's borders (decorations) around the
//! client area.
fn SDL_GetWindowBordersSize(window: SDL_Window*, top: i32*, left: i32*, bottom: i32*, right: i32*) i32;
//! \brief Set the minimum size of a window's client area.
fn SDL_SetWindowMinimumSize(window: SDL_Window*, min_w: i32, min_h: i32);
//! \brief Get the minimum size of a window's client area.
fn SDL_GetWindowMinimumSize(window: SDL_Window*, w: i32*, h: i32*);
//! \brief Set the maximum size of a window's client area.
fn SDL_SetWindowMaximumSize(window: SDL_Window*, max_w: i32, max_h: i32);
//! \brief Get the maximum size of a window's client area.
fn SDL_GetWindowMaximumSize(window: SDL_Window*, w: i32*, h: i32*);
//! \brief Set the border state of a window.
fn SDL_SetWindowBordered(window: SDL_Window*, bordered: SDL_bool);
//! \brief Set the user-resizable state of a window.
fn SDL_SetWindowResizable(window: SDL_Window*, resizable: SDL_bool);
//! \brief Show a window.
fn SDL_ShowWindow(window: SDL_Window*);
//! \brief Hide a window.
fn SDL_HideWindow(window: SDL_Window*);
//! \brief Raise a window above other windows and set the input focus.
fn SDL_RaiseWindow(window: SDL_Window*);
//! \brief Make a window as large as possible.
fn SDL_MaximizeWindow(window: SDL_Window*);
//! \brief Minimize a window to an iconic representation.
fn SDL_MinimizeWindow(window: SDL_Window*);
//! \brief Restore the size and position of a minimized or maximized
//! window.
fn SDL_RestoreWindow(window: SDL_Window*);
//! \brief Set a window's fullscreen state.
fn SDL_SetWindowFullscreen(window: SDL_Window*, flags: Uint32) i32;
//! \brief Get the SDL surface associated with the window.
fn SDL_GetWindowSurface(window: SDL_Window*) SDL_Surface*;
//! \brief Copy the window surface to the screen.
fn SDL_UpdateWindowSurface(window: SDL_Window*) i32;
//! \brief Copy a number of rectangles on the window surface to the
//! screen.
fn SDL_UpdateWindowSurfaceRects(window: SDL_Window*, rects: const(const(SDL_Rect)*), numrects: i32) i32;
//! \brief Set a window's input grab mode.
fn SDL_SetWindowGrab(window: SDL_Window*, grabbed: SDL_bool);
//! \brief Get a window's input grab mode.
fn SDL_GetWindowGrab(window: SDL_Window*) SDL_bool;
//! \brief Set the brightness (gamma correction) for a window.
fn SDL_SetWindowBrightness(window: SDL_Window*, brightness: f32) i32;
//! \brief Get the brightness (gamma correction) for a window.
fn SDL_GetWindowBrightness(window: SDL_Window*) f32;
//! \brief Set the opacity for a window
fn SDL_SetWindowOpacity(window: SDL_Window*, opacity: f32) i32;
//! \brief Get the opacity of a window.
fn SDL_GetWindowOpacity(window: SDL_Window*, out_opacity: f32*) i32;
//! \brief Sets the window as a modal for another window (TODO: reconsider
//! this function and/or its name)
fn SDL_SetWindowModalFor(modal_window: SDL_Window*, parent_window: SDL_Window*) i32;
//! \brief Explicitly sets input focus to the window.
fn SDL_SetWindowInputFocus(window: SDL_Window*) i32;
//! \brief Set the gamma ramp for a window.
fn SDL_SetWindowGammaRamp(window: SDL_Window*, red: const(const(Uint16)*), green: const(const(Uint16)*), blue: const(const(Uint16)*)) i32;
//! \brief Get the gamma ramp for a window.
fn SDL_GetWindowGammaRamp(window: SDL_Window*, red: Uint16*, green: Uint16*, blue: Uint16*) i32;
//! \brief Destroy a window.
fn SDL_DestroyWindow(window: SDL_Window*);
//! \brief Returns whether the screensaver is currently enabled (default
//! on).
fn SDL_IsScreenSaverEnabled() SDL_bool;
//! \brief Allow the screen to be blanked by a screensaver
fn SDL_EnableScreenSaver();
//! \brief Prevent the screen from being blanked by a screensaver
fn SDL_DisableScreenSaver();
//! \name OpenGL support functions
fn SDL_GL_LoadLibrary(path: const(const(char)*)) i32;
//! \brief Get the address of an OpenGL function.
fn SDL_GL_GetProcAddress(proc: const(const(char)*)) void*;
//! \brief Unload the OpenGL library previously loaded by
//! SDL_GL_LoadLibrary().
fn SDL_GL_UnloadLibrary();
//! \brief Return true if an OpenGL extension is supported for the current
//! context.
fn SDL_GL_ExtensionSupported(extension: const(const(char)*)) SDL_bool;
//! \brief Set an OpenGL window attribute before window creation.
fn SDL_GL_SetAttribute(attr: SDL_GLattr, value: i32) i32;
//! \brief Get the actual value for an attribute from the current context.
fn SDL_GL_GetAttribute(attr: SDL_GLattr, value: i32*) i32;
//! \brief Create an OpenGL context for use with an OpenGL window, and
//! make it current.
fn SDL_GL_CreateContext(window: SDL_Window*) SDL_GLContext;
//! \brief Set up an OpenGL context for rendering into an OpenGL window.
fn SDL_GL_MakeCurrent(window: SDL_Window*, context: SDL_GLContext) i32;
//! \brief Get the currently active OpenGL window.
fn SDL_GL_GetCurrentWindow() SDL_Window*;
//! \brief Get the currently active OpenGL context.
fn SDL_GL_GetCurrentContext() SDL_GLContext;
//! \brief Set the swap interval for the current OpenGL context.
fn SDL_GL_SetSwapInterval(interval: i32) i32;
//! \brief Get the swap interval for the current OpenGL context.
fn SDL_GL_GetSwapInterval() i32;
//! \brief Swap the OpenGL buffers for a window, if double-buffering is
//! supported.
fn SDL_GL_SwapWindow(window: SDL_Window*);
//! \brief Delete an OpenGL context.
fn SDL_GL_DeleteContext(context: SDL_GLContext);

lib.sdl2.haptic

module lib.sdl2.haptic;


//! \name Haptic features
enum SDL_HAPTIC_CONSTANT;
//! \brief Sine wave effect supported.
enum SDL_HAPTIC_SINE;
//! \brief Square wave effect supported.
enum SDL_HAPTIC_SQUARE;
//! \brief Triangle wave effect supported.
enum SDL_HAPTIC_TRIANGLE;
//! \brief Sawtoothup wave effect supported.
enum SDL_HAPTIC_SAWTOOTHUP;
//! \brief Sawtoothdown wave effect supported.
enum SDL_HAPTIC_SAWTOOTHDOWN;
//! \brief Ramp effect supported.
enum SDL_HAPTIC_RAMP;
//! \brief Spring effect supported - uses axes position.
enum SDL_HAPTIC_SPRING;
//! \brief Damper effect supported - uses axes velocity.
enum SDL_HAPTIC_DAMPER;
//! \brief Inertia effect supported - uses axes acceleration.
enum SDL_HAPTIC_INERTIA;
//! \brief Friction effect supported - uses axes movement.
enum SDL_HAPTIC_FRICTION;
//! \brief Custom effect is supported.
enum SDL_HAPTIC_CUSTOM;
//! \brief Device can set global gain.
enum SDL_HAPTIC_GAIN;
//! \brief Device can set autocenter.
enum SDL_HAPTIC_AUTOCENTER;
//! \brief Device can be queried for effect status.
enum SDL_HAPTIC_STATUS;
//! \brief Device can be paused.
enum SDL_HAPTIC_PAUSE;
//! \name Direction encodings
enum SDL_HAPTIC_POLAR;
//! \brief Uses cartesian coordinates for the direction.
enum SDL_HAPTIC_CARTESIAN;
//! \brief Uses spherical coordinates for the direction.
enum SDL_HAPTIC_SPHERICAL;

//! \typedef SDL_Haptic
struct SDL_Haptic
{
}

//! \brief Structure that represents a haptic direction.
struct SDL_HapticDirection
{
public:
	type: Uint8;
	dir: Sint32[3];
}

//! \brief A structure containing a template for a Constant effect.
struct SDL_HapticConstant
{
public:
	type: Uint16;
	direction: SDL_HapticDirection;
	length: Uint32;
	delay: Uint16;
	button: Uint16;
	interval: Uint16;
	level: Sint16;
	attack_length: Uint16;
	attack_level: Uint16;
	fade_length: Uint16;
	fade_level: Uint16;
}

//! \brief A structure containing a template for a Periodic effect.
struct SDL_HapticPeriodic
{
public:
	type: Uint16;
	direction: SDL_HapticDirection;
	length: Uint32;
	delay: Uint16;
	button: Uint16;
	interval: Uint16;
	period: Uint16;
	magnitude: Sint16;
	offset: Sint16;
	phase: Uint16;
	attack_length: Uint16;
	attack_level: Uint16;
	fade_length: Uint16;
	fade_level: Uint16;
}

//! \brief A structure containing a template for a Condition effect.
struct SDL_HapticCondition
{
public:
	type: Uint16;
	direction: SDL_HapticDirection;
	length: Uint32;
	delay: Uint16;
	button: Uint16;
	interval: Uint16;
	right_sat: Uint16[3];
	left_sat: Uint16[3];
	right_coeff: Sint16[3];
	left_coeff: Sint16[3];
	deadband: Uint16[3];
	center: Sint16[3];
}

//! \brief A structure containing a template for a Ramp effect.
struct SDL_HapticRamp
{
public:
	type: Uint16;
	direction: SDL_HapticDirection;
	length: Uint32;
	delay: Uint16;
	button: Uint16;
	interval: Uint16;
	start: Sint16;
	end: Sint16;
	attack_length: Uint16;
	attack_level: Uint16;
	fade_length: Uint16;
	fade_level: Uint16;
}

//! \brief A structure containing a template for the ::SDL_HAPTIC_CUSTOM
//! effect.
struct SDL_HapticCustom
{
public:
	type: Uint16;
	direction: SDL_HapticDirection;
	length: Uint32;
	delay: Uint16;
	button: Uint16;
	interval: Uint16;
	channels: Uint8;
	period: Uint16;
	samples: Uint16;
	data: Uint16*;
	attack_length: Uint16;
	attack_level: Uint16;
	fade_length: Uint16;
	fade_level: Uint16;
}

//! \brief The generic template for any haptic effect.
union SDL_HapticEffect
{
public:
	type: Uint16;
	constant: SDL_HapticConstant;
	periodic: SDL_HapticPeriodic;
	condition: SDL_HapticCondition;
	ramp: SDL_HapticRamp;
	custom: SDL_HapticCustom;
}

//! \brief Used to play a device an infinite number of times.
fn SDL_HAPTIC_INFINITY() u32 { }
//! \brief Count the number of haptic devices attached to the system.
fn SDL_NumHaptics() i32;
//! \brief Get the implementation dependent name of a Haptic device.
fn SDL_HapticName(device_index: i32) char*;
//! \brief Opens a Haptic device for usage.
fn SDL_HapticOpen(device_index: i32) SDL_Haptic*;
//! \brief Checks if the haptic device at index has been opened.
fn SDL_HapticOpened(device_index: i32) i32;
//! \brief Gets the index of a haptic device.
fn SDL_HapticIndex(haptic: SDL_Haptic*) i32;
//! \brief Gets whether or not the current mouse has haptic capabilities.
fn SDL_MouseIsHaptic() i32;
//! \brief Tries to open a haptic device from the current mouse.
fn SDL_HapticOpenFromMouse() SDL_Haptic*;
//! \brief Checks to see if a joystick has haptic features.
fn SDL_JoystickIsHaptic(joystick: SDL_Joystick*) i32;
//! \brief Opens a Haptic device for usage from a Joystick device.
fn SDL_HapticOpenFromJoystick(joystick: SDL_Joystick*) SDL_Haptic*;
//! \brief Closes a Haptic device previously opened with SDL_HapticOpen().
fn SDL_HapticClose(haptic: SDL_Haptic*);
//! \brief Returns the number of effects a haptic device can store.
fn SDL_HapticNumEffects(haptic: SDL_Haptic*) i32;
//! \brief Returns the number of effects a haptic device can play at the
//! same time.
fn SDL_HapticNumEffectsPlaying(haptic: SDL_Haptic*) i32;
//! \brief Gets the haptic devices supported features in bitwise matter.
fn SDL_HapticQuery(haptic: SDL_Haptic*) u32;
//! \brief Gets the number of haptic axes the device has.
fn SDL_HapticNumAxes(haptic: SDL_Haptic*) i32;
//! \brief Checks to see if effect is supported by haptic.
fn SDL_HapticEffectSupported(haptic: SDL_Haptic*, effect: SDL_HapticEffect*) i32;
//! \brief Creates a new haptic effect on the device.
fn SDL_HapticNewEffect(haptic: SDL_Haptic*, effect: SDL_HapticEffect*) i32;
//! \brief Updates the properties of an effect.
fn SDL_HapticUpdateEffect(haptic: SDL_Haptic*, effect: i32, data: SDL_HapticEffect*) i32;
//! \brief Runs the haptic effect on its associated haptic device.
fn SDL_HapticRunEffect(haptic: SDL_Haptic*, effect: i32, iterations: Uint32) i32;
//! \brief Stops the haptic effect on its associated haptic device.
fn SDL_HapticStopEffect(haptic: SDL_Haptic*, effect: i32) i32;
//! \brief Destroys a haptic effect on the device.
fn SDL_HapticDestroyEffect(haptic: SDL_Haptic*, effect: i32);
//! \brief Gets the status of the current effect on the haptic device.
fn SDL_HapticGetEffectStatus(haptic: SDL_Haptic*, effect: i32) i32;
//! \brief Sets the global gain of the device.
fn SDL_HapticSetGain(haptic: SDL_Haptic*, gain: i32) i32;
//! \brief Sets the global autocenter of the device.
fn SDL_HapticSetAutocenter(haptic: SDL_Haptic*, autocenter: i32) i32;
//! \brief Pauses a haptic device.
fn SDL_HapticPause(haptic: SDL_Haptic*) i32;
//! \brief Unpauses a haptic device.
fn SDL_HapticUnpause(haptic: SDL_Haptic*) i32;
//! \brief Stops all the currently playing effects on a haptic device.
fn SDL_HapticStopAll(haptic: SDL_Haptic*) i32;
//! \brief Checks to see if rumble is supported on a haptic device..
fn SDL_HapticRumbleSupported(haptic: SDL_Haptic*) i32;
//! \brief Initializes the haptic device for simple rumble playback.
fn SDL_HapticRumbleInit(haptic: SDL_Haptic*) i32;
//! \brief Runs simple rumble on a haptic device
fn SDL_HapticRumblePlay(haptic: SDL_Haptic*, strength: f32, length: Uint32) i32;
//! \brief Stops the simple rumble on a haptic device.
fn SDL_HapticRumbleStop(haptic: SDL_Haptic*) i32;

lib.sdl2.thread

module lib.sdl2.thread;


enum SDL_THREAD_PRIORITY_LOW;
enum SDL_THREAD_PRIORITY_NORMAL;
enum SDL_THREAD_PRIORITY_HIGH;

alias SDL_threadID = u32;
alias SDL_TLSID = u32;
alias SDL_ThreadPriority = i32;
alias SDL_ThreadFunction = fn (void*) (i32);

struct SDL_Thread
{
}

//! Create a thread.
fn SDL_CreateThread(func: SDL_ThreadFunction, name: const(const(char)*), data: void*) SDL_Thread*;
//! Get the thread name, as it was specified in SDL_CreateThread(). This
//! function returns a pointer to a UTF-8 string that names the specified
//! thread, or NULL if it doesn't have a name. This is internal memory, not
//! to be free()'d by the caller, and remains valid until the specified
//! thread is cleaned up by SDL_WaitThread().
fn SDL_GetThreadName(thread: SDL_Thread*) char*;
//! Get the thread identifier for the current thread.
fn SDL_ThreadID() SDL_threadID;
//! Get the thread identifier for the specified thread.
fn SDL_GetThreadID(thread: SDL_Thread*) SDL_threadID;
//! Set the priority for the current thread
fn SDL_SetThreadPriority(priority: SDL_ThreadPriority) i32;
//! Wait for a thread to finish.
fn SDL_WaitThread(thread: SDL_Thread*, status: i32*);
//! \brief Create an identifier that is globally visible to all threads
//! but refers to data that is thread-specific.
fn SDL_TLSCreate() SDL_TLSID;
//! \brief Get the value associated with a thread local storage ID for the
//! current thread.
fn SDL_TLSGet(id: SDL_TLSID) void*;
//! \brief Set the value associated with a thread local storage ID for the
//! current thread.
fn SDL_TLSSet(id: SDL_TLSID, value: const(const(void)*), destructor: fn (void*) (void)) i32;

lib.sdl2.mutex

module lib.sdl2.mutex;


//! Synchronization functions which can time out return this value if they
//! time out.
enum SDL_MUTEX_TIMEDOUT;

//! \name Mutex functions
struct SDL_mutex
{
}

//! \name Semaphore functions
struct SDL_semaphore
{
}

//! \name Condition variable functions
struct SDL_cond
{
}

//! This is the timeout value which corresponds to never time out.
fn SDL_MUTEX_MAXWAIT() Uint32 { }
//! Create a mutex, initialized unlocked.
fn SDL_CreateMutex() SDL_mutex*;
//! Lock the mutex.
fn SDL_LockMutex(mutex: SDL_mutex*) i32;
//! Try to lock the mutex
fn SDL_TryLockMutex(mutex: SDL_mutex*) i32;
//! Unlock the mutex.
fn SDL_UnlockMutex(mutex: SDL_mutex*) i32;
//! Destroy a mutex.
fn SDL_DestroyMutex(mutex: SDL_mutex*);
//! Create a semaphore, initialized with value, returns NULL on failure.
fn SDL_CreateSemaphore(initial_value: Uint32) SDL_semaphore*;
//! Destroy a semaphore.
fn SDL_DestroySemaphore(sem: SDL_semaphore*);
//! This function suspends the calling thread until the semaphore pointed
//! to by \c sem has a positive count. It then atomically decreases the
//! semaphore count.
fn SDL_SemWait(sem: SDL_semaphore*) i32;
//! Non-blocking variant of SDL_SemWait().
fn SDL_SemTryWait(sem: SDL_semaphore*) i32;
//! Variant of SDL_SemWait() with a timeout in milliseconds.
fn SDL_SemWaitTimeout(sem: SDL_semaphore*, ms: Uint32) i32;
//! Atomically increases the semaphore's count (not blocking).
fn SDL_SemPost(sem: SDL_semaphore*) i32;
//! Returns the current count of the semaphore.
fn SDL_SemValue(sem: SDL_semaphore*) Uint32;
//! Create a condition variable.
fn SDL_CreateCond() SDL_cond*;
//! Destroy a condition variable.
fn SDL_DestroyCond(cond: SDL_cond*);
//! Restart one of the threads that are waiting on the condition variable.
fn SDL_CondSignal(cond: SDL_cond*) i32;
//! Restart all threads that are waiting on the condition variable.
fn SDL_CondBroadcast(cond: SDL_cond*) i32;
//! Wait on the condition variable, unlocking the provided mutex.
fn SDL_CondWait(cond: SDL_cond*, mutex: SDL_mutex*) i32;
//! Waits for at most \c ms milliseconds, and returns 0 if the condition
//! variable is signaled, ::SDL_MUTEX_TIMEDOUT if the condition is not
//! signaled in the allotted time, and -1 on error.
fn SDL_CondWaitTimeout(cond: SDL_cond*, mutex: SDL_mutex*, ms: Uint32) i32;

lib.sdl2.gesture

module lib.sdl2.gesture;


alias SDL_GestureID = Sint64;

//! \brief Begin Recording a gesture on the specified touch, or all
//! touches (-1)
fn SDL_RecordGesture(touchId: SDL_TouchID) i32;
//! \brief Save all currently loaded Dollar Gesture templates
fn SDL_SaveAllDollarTemplates(src: SDL_RWops*) i32;
//! \brief Save a currently loaded Dollar Gesture template
fn SDL_SaveDollarTemplate(gestureId: SDL_GestureID, src: SDL_RWops*) i32;
//! \brief Load Dollar Gesture templates from a file
fn SDL_LoadDollarTemplates(touchId: SDL_TouchID, src: SDL_RWops*) i32;

lib.sdl2.rect

module lib.sdl2.rect;


struct SDL_Point
{
public:
	x: i32;
	y: i32;
}

struct SDL_Rect
{
public:
	x: i32;
	y: i32;
	w: i32;
	h: i32;
}

fn SDL_RectEmpty(r: SDL_Rect*) bool { }
fn SDL_RectEquals(a: SDL_Rect*, b: SDL_Rect*) bool { }
fn SDL_HasIntersection(const(const(SDL_Rect)*), const(const(SDL_Rect)*)) bool;
fn SDL_IntersectRect(const(const(SDL_Rect)*), const(const(SDL_Rect)*), SDL_Rect*) bool;
fn SDL_UnionRect(const(const(SDL_Rect)*), const(const(SDL_Rect)*), SDL_Rect*) bool;
fn SDL_EnclosePoints(const(const(SDL_Point)*), i32, const(const(SDL_Rect)*), SDL_Rect*) bool;
fn SDL_IntersectRectAndLine(const(const(SDL_Rect)*), i32*, i32*, i32*, i32*) bool;

lib.sdl2.image

module lib.sdl2.image;


enum SDL_IMAGE_MAJOR_VERSION;
enum SDL_IMAGE_MINOR_VERSION;
enum SDL_IMAGE_PATCHLEVEL;
enum IMG_INIT_JPG;
enum IMG_INIT_PNG;
enum IMG_INIT_TIF;
enum IMG_INIT_WEBP;

alias IMG_InitFlags = i32;

fn IMG_Init(flags: i32) i32;
fn IMG_Quit();
fn IMG_LoadTyped_RW(src: SDL_RWops*, freesrc: i32, type: const(const(char)*)) SDL_Surface*;
fn IMG_Load(file: const(const(char)*)) SDL_Surface*;
fn IMG_Load_RW(src: SDL_RWops*, freesrc: i32) SDL_Surface*;
fn IMG_LoadTexture(renderer: SDL_Renderer*, file: const(const(char)*)) SDL_Texture*;
fn IMG_LoadTexture_RW(renderer: SDL_Renderer*, src: SDL_RWops*, freesrc: i32) SDL_Texture*;
fn IMG_LoadTextureTyped_RW(renderer: SDL_Renderer*, src: SDL_RWops*, freesrc: i32, type: const(const(char)*)) SDL_Texture*;
fn IMG_isICO(src: SDL_RWops*) i32;
fn IMG_isCUR(src: SDL_RWops*) i32;
fn IMG_isBMP(src: SDL_RWops*) i32;
fn IMG_isGIF(src: SDL_RWops*) i32;
fn IMG_isJPG(src: SDL_RWops*) i32;
fn IMG_isLBM(src: SDL_RWops*) i32;
fn IMG_isPCX(src: SDL_RWops*) i32;
fn IMG_isPNG(src: SDL_RWops*) i32;
fn IMG_isPNM(src: SDL_RWops*) i32;
fn IMG_isTIF(src: SDL_RWops*) i32;
fn IMG_isXCF(src: SDL_RWops*) i32;
fn IMG_isXPM(src: SDL_RWops*) i32;
fn IMG_isXV(src: SDL_RWops*) i32;
fn IMG_isWEBP(src: SDL_RWops*) i32;
fn IMG_LoadICO_RW(src: SDL_RWops*) SDL_Surface*;
fn IMG_LoadCUR_RW(src: SDL_RWops*) SDL_Surface*;
fn IMG_LoadBMP_RW(src: SDL_RWops*) SDL_Surface*;
fn IMG_LoadGIF_RW(src: SDL_RWops*) SDL_Surface*;
fn IMG_LoadJPG_RW(src: SDL_RWops*) SDL_Surface*;
fn IMG_LoadLBM_RW(src: SDL_RWops*) SDL_Surface*;
fn IMG_LoadPCX_RW(src: SDL_RWops*) SDL_Surface*;
fn IMG_LoadPNG_RW(src: SDL_RWops*) SDL_Surface*;
fn IMG_LoadPNM_RW(src: SDL_RWops*) SDL_Surface*;
fn IMG_LoadTGA_RW(src: SDL_RWops*) SDL_Surface*;
fn IMG_LoadTIF_RW(src: SDL_RWops*) SDL_Surface*;
fn IMG_LoadXCF_RW(src: SDL_RWops*) SDL_Surface*;
fn IMG_LoadXPM_RW(src: SDL_RWops*) SDL_Surface*;
fn IMG_LoadXV_RW(src: SDL_RWops*) SDL_Surface*;
fn IMG_LoadWEBP_RW(src: SDL_RWops*) SDL_Surface*;
fn IMG_ReadXPMFromArray(xpm: char**) SDL_Surface*;
fn IMG_SavePNG(surface: SDL_Surface*, file: const(const(char)*)) i32;
fn IMG_SavePNG_RW(surface: SDL_Surface*, dst: SDL_RWops*, freedst: i32) i32;
fn IMG_SetError(msg: const(char)*) { }
fn IMG_GetError() const(char)* { }

lib.sdl2.stdinc

module lib.sdl2.stdinc;


enum SDL_FALSE;
enum SDL_TRUE;

//! \file SDL_stdinc.h
alias SDL_bool = i32;
//! \brief A signed 8-bit integer type.
alias Sint8 = i8;
//! \brief An unsigned 8-bit integer type.
alias Uint8 = u8;
//! \brief A signed 16-bit integer type.
alias Sint16 = i16;
//! \brief An unsigned 16-bit integer type.
alias Uint16 = u16;
//! \brief A signed 32-bit integer type.
alias Sint32 = i32;
//! \brief An unsigned 32-bit integer type.
alias Uint32 = u32;
//! \brief A signed 64-bit integer type.
alias Sint64 = i64;
//! \brief An unsigned 64-bit integer type.
alias Uint64 = u64;

fn SDL_malloc(size: size_t) void*;
fn SDL_calloc(nmemb: size_t, size: size_t) void*;
fn SDL_realloc(mem: void*, size: size_t) void*;
fn SDL_free(mem: void*);
fn SDL_getenv(name: const(const(char)*)) char*;
fn SDL_setenv(name: const(const(char)*), value: const(const(char)*), overwrite: i32) i32;
fn SDL_qsort(base: void*, nmemb: size_t, size: size_t, fn (const(const(void)*), const(const(void)*)) (i32));
fn SDL_abs(x: i32) i32;
fn SDL_isdigit(x: i32) i32;
fn SDL_isspace(x: i32) i32;
fn SDL_toupper(x: i32) i32;
fn SDL_tolower(x: i32) i32;
fn SDL_memset(dst: void*, c: i32, len: size_t) void*;
fn SDL_memcpy(dst: void*, src: const(const(void)*), len: size_t) void*;
fn SDL_memcpy4(dst: void*, src: const(const(void)*), dwords: size_t) void* { }
fn SDL_memmove(dst: void*, src: const(const(void)*), len: size_t) void*;
fn SDL_memcmp(s1: const(const(void)*), s2: const(const(void)*), len: size_t) i32;
fn SDL_strlen(str: const(const(char)*)) size_t;
fn SDL_strlcpy(dst: char*, src: const(const(char)*), maxlen: size_t) size_t;
fn SDL_utf8strlcpy(dst: char*, src: const(const(char)*), dst_bytes: size_t) size_t;
fn SDL_strlcat(dst: char*, src: const(const(char)*), maxlen: size_t) size_t;
fn SDL_strdup(str: const(const(char)*)) char*;
fn SDL_strrev(str: char*) char*;
fn SDL_strupr(str: char*) char*;
fn SDL_strlwr(str: char*) char*;
fn SDL_strchr(str: const(const(char)*), c: i32) char*;
fn SDL_strrchr(str: const(const(char)*), c: i32) char*;
fn SDL_strstr(haystack: const(const(char)*), needle: const(const(char)*)) char*;
fn SDL_itoa(value: i32, str: char*, radix: i32) char*;
fn SDL_uitoa(value: u32, str: char*, radix: i32) char*;
fn SDL_ltoa(value: i64, str: char*, radix: i32) char*;
fn SDL_ultoa(value: u64, str: char*, radix: i32) char*;
fn SDL_lltoa(value: Sint64, str: char*, radix: i32) char*;
fn SDL_ulltoa(value: Uint64, str: char*, radix: i32) char*;
fn SDL_atoi(str: const(const(char)*)) i32;
fn SDL_atof(str: const(const(char)*)) f64;
fn SDL_strtol(str: const(const(char)*), endp: char**, base: i32) i64;
fn SDL_strtoul(str: const(const(char)*), endp: char**, base: i32) u64;
fn SDL_strtoll(str: const(const(char)*), endp: char**, base: i32) Sint64;
fn SDL_strtoull(str: const(const(char)*), endp: char**, base: i32) Uint64;
fn SDL_strtod(str: const(const(char)*), endp: char**) f64;
fn SDL_strcmp(str1: const(const(char)*), str2: const(const(char)*)) i32;
fn SDL_strncmp(str1: const(const(char)*), str2: const(const(char)*), maxlen: size_t) i32;
fn SDL_strcasecmp(str1: const(const(char)*), str2: const(const(char)*)) i32;
fn SDL_strncasecmp(str1: const(const(char)*), str2: const(const(char)*), len: size_t) i32;
fn SDL_sscanf(text: const(const(char)*), fmt: const(const(char)*)) i32;
fn SDL_snprintf(text: char*, maxlen: size_t, fmt: const(const(char)*)) i32;
fn SDL_atan(x: f64) f64;
fn SDL_atan2(x: f64, y: f64) f64;
fn SDL_ceil(x: f64) f64;
fn SDL_copysign(x: f64, y: f64) f64;
fn SDL_cos(x: f64) f64;
fn SDL_cosf(x: f32) f32;
fn SDL_fabs(x: f64) f64;
fn SDL_floor(x: f64) f64;
fn SDL_log(x: f64) f64;
fn SDL_pow(x: f64, y: f64) f64;
fn SDL_scalbn(x: f64, n: i32) f64;
fn SDL_sin(x: f64) f64;
fn SDL_sinf(x: f32) f32;
fn SDL_sqrt(x: f64) f64;

lib.sdl2.render

module lib.sdl2.render;


enum SDL_RENDERER_SOFTWARE;
enum SDL_RENDERER_ACCELERATED;
enum SDL_RENDERER_PRESENTVSYNC;
enum SDL_RENDERER_TARGETTEXTURE;
enum SDL_TEXTUREACCESS_STATIC;
enum SDL_TEXTUREACCESS_STREAMING;
enum SDL_TEXTUREACCESS_TARGET;
enum SDL_TEXTUREMODULATE_NONE;
enum SDL_TEXTUREMODULATE_COLOR;
enum SDL_TEXTUREMODULATE_ALPHA;
enum SDL_FLIP_NONE;
enum SDL_FLIP_HORIZONTAL;
enum SDL_FLIP_VERTICAL;

//! \brief Flags used when creating a rendering context
alias SDL_RendererFlags = i32;
//! \brief The access pattern allowed for a texture.
alias SDL_TextureAccess = i32;
//! \brief The texture channel modulation used in SDL_RenderCopy().
alias SDL_TextureModulate = i32;
//! \brief Flip constants for SDL_RenderCopyEx
alias SDL_RendererFlip = i32;

//! \brief Information on the capabilities of a render driver or context.
struct SDL_RendererInfo
{
public:
	name: char*;
	flags: Uint32;
	num_texture_formats: Uint32;
	texture_formats: Uint32[16];
	max_texture_width: i32;
	max_texture_height: i32;
}

//! \brief A structure representing rendering state
struct SDL_Renderer
{
}

//! \brief An efficient driver-specific representation of pixel data
struct SDL_Texture
{
}

//! \brief Get the number of 2D rendering drivers available for the
//! current display.
fn SDL_GetNumRenderDrivers() i32;
//! \brief Get information about a specific 2D rendering driver for the
//! current display.
fn SDL_GetRenderDriverInfo(index: i32, info: SDL_RendererInfo*) i32;
//! \brief Create a window and default renderer
fn SDL_CreateWindowAndRenderer(width: i32, height: i32, window_flags: Uint32, window: SDL_Window**, renderer: SDL_Renderer**) i32;
//! \brief Create a 2D rendering context for a window.
fn SDL_CreateRenderer(window: SDL_Window*, index: i32, flags: Uint32) SDL_Renderer*;
//! \brief Create a 2D software rendering context for a surface.
fn SDL_CreateSoftwareRenderer(surface: SDL_Surface*) SDL_Renderer*;
//! \brief Get the renderer associated with a window.
fn SDL_GetRenderer(window: SDL_Window*) SDL_Renderer*;
//! \brief Get information about a rendering context.
fn SDL_GetRendererInfo(renderer: SDL_Renderer*, info: SDL_RendererInfo*) i32;
//! \brief Get the output size of a rendering context.
fn SDL_GetRendererOutputSize(renderer: SDL_Renderer*, w: i32*, h: i32*) i32;
//! \brief Create a texture for a rendering context.
fn SDL_CreateTexture(renderer: SDL_Renderer*, format: Uint32, access: i32, w: i32, h: i32) SDL_Texture*;
//! \brief Create a texture from an existing surface.
fn SDL_CreateTextureFromSurface(renderer: SDL_Renderer*, surface: SDL_Surface*) SDL_Texture*;
//! \brief Query the attributes of a texture
fn SDL_QueryTexture(texture: SDL_Texture*, format: Uint32*, access: i32*, w: i32*, h: i32*) i32;
//! \brief Set an additional color value used in render copy operations.
fn SDL_SetTextureColorMod(texture: SDL_Texture*, r: Uint8, g: Uint8, b: Uint8) i32;
//! \brief Get the additional color value used in render copy operations.
fn SDL_GetTextureColorMod(texture: SDL_Texture*, r: Uint8*, g: Uint8*, b: Uint8*) i32;
//! \brief Set an additional alpha value used in render copy operations.
fn SDL_SetTextureAlphaMod(texture: SDL_Texture*, alpha: Uint8) i32;
//! \brief Get the additional alpha value used in render copy operations.
fn SDL_GetTextureAlphaMod(texture: SDL_Texture*, alpha: Uint8*) i32;
//! \brief Set the blend mode used for texture copy operations.
fn SDL_SetTextureBlendMode(texture: SDL_Texture*, blendMode: SDL_BlendMode) i32;
//! \brief Get the blend mode used for texture copy operations.
fn SDL_GetTextureBlendMode(texture: SDL_Texture*, blendMode: SDL_BlendMode*) i32;
//! \brief Update the given texture rectangle with new pixel data.
fn SDL_UpdateTexture(texture: SDL_Texture*, rect: const(const(SDL_Rect)*), pixels: const(const(void)*), pitch: i32) i32;
//! \brief Lock a portion of the texture for write-only pixel access.
fn SDL_LockTexture(texture: SDL_Texture*, rect: const(const(SDL_Rect)*), pixels: void**, pitch: i32*) i32;
//! \brief Unlock a texture, uploading the changes to video memory, if
//! needed.
fn SDL_UnlockTexture(texture: SDL_Texture*);
//! \brief Determines whether a window supports the use of render targets
fn SDL_RenderTargetSupported(renderer: SDL_Renderer*) SDL_bool;
//! \brief Set a texture as the current rendering target.
fn SDL_SetRenderTarget(renderer: SDL_Renderer*, texture: SDL_Texture*) i32;
//! \brief Get the current render target or NULL for the default render
//! target.
fn SDL_GetRenderTarget(renderer: SDL_Renderer*) SDL_Texture*;
//! \brief Set device independent resolution for rendering
fn SDL_RenderSetLogicalSize(renderer: SDL_Renderer*, w: i32, h: i32) i32;
//! \brief Set whether to force integer scales for resolution-independent
//! rendering
fn SDL_RenderSetIntegerScale(renderer: SDL_Renderer*, enable: SDL_bool) i32;
//! \brief Get whether integer scales are forced for
//! resolution-independent rendering
fn SDL_RenderGetIntegerScale(renderer: SDL_Renderer*) SDL_bool;
//! \brief Get device independent resolution for rendering
fn SDL_RenderGetLogicalSize(renderer: SDL_Renderer*, w: i32*, h: i32*);
//! \brief Set the drawing area for rendering on the current target.
fn SDL_RenderSetViewport(renderer: SDL_Renderer*, rect: const(const(SDL_Rect)*)) i32;
//! \brief Get the drawing area for the current target.
fn SDL_RenderGetViewport(renderer: SDL_Renderer*, rect: SDL_Rect*);
//! \brief Set the clip rectangle for the current target.
fn SDL_RenderSetClipRect(renderer: SDL_Renderer*, rect: const(const(SDL_Rect)*)) i32;
//! \brief Get the clip rectangle for the current target.
fn SDL_RenderGetClipRect(renderer: SDL_Renderer*, rect: SDL_Rect*);
//! \brief Set the drawing scale for rendering on the current target.
fn SDL_RenderSetScale(renderer: SDL_Renderer*, scaleX: f32, scaleY: f32) i32;
//! \brief Get the drawing scale for the current target.
fn SDL_RenderGetScale(renderer: SDL_Renderer*, scaleX: f32*, scaleY: f32*);
//! \brief Set the color used for drawing operations (Rect, Line and
//! Clear).
fn SDL_SetRenderDrawColor(renderer: SDL_Renderer*, r: Uint8, g: Uint8, b: Uint8, a: Uint8) i32;
//! \brief Get the color used for drawing operations (Rect, Line and
//! Clear).
fn SDL_GetRenderDrawColor(renderer: SDL_Renderer*, r: Uint8*, g: Uint8*, b: Uint8*, a: Uint8*) i32;
//! \brief Set the blend mode used for drawing operations (Fill and Line).
fn SDL_SetRenderDrawBlendMode(renderer: SDL_Renderer*, blendMode: SDL_BlendMode) i32;
//! \brief Get the blend mode used for drawing operations.
fn SDL_GetRenderDrawBlendMode(renderer: SDL_Renderer*, blendMode: SDL_BlendMode*) i32;
//! \brief Clear the current rendering target with the drawing color
fn SDL_RenderClear(renderer: SDL_Renderer*) i32;
//! \brief Draw a point on the current rendering target.
fn SDL_RenderDrawPoint(renderer: SDL_Renderer*, x: i32, y: i32) i32;
//! \brief Draw multiple points on the current rendering target.
fn SDL_RenderDrawPoints(renderer: SDL_Renderer*, points: const(const(SDL_Point)*), count: i32) i32;
//! \brief Draw a line on the current rendering target.
fn SDL_RenderDrawLine(renderer: SDL_Renderer*, x1: i32, y1: i32, x2: i32, y2: i32) i32;
//! \brief Draw a series of connected lines on the current rendering
//! target.
fn SDL_RenderDrawLines(renderer: SDL_Renderer*, points: const(const(SDL_Point)*), count: i32) i32;
//! \brief Draw a rectangle on the current rendering target.
fn SDL_RenderDrawRect(renderer: SDL_Renderer*, rect: const(const(SDL_Rect)*)) i32;
//! \brief Draw some number of rectangles on the current rendering target.
fn SDL_RenderDrawRects(renderer: SDL_Renderer*, rects: const(const(SDL_Rect)*), count: i32) i32;
//! \brief Fill a rectangle on the current rendering target with the
//! drawing color.
fn SDL_RenderFillRect(renderer: SDL_Renderer*, rect: const(const(SDL_Rect)*)) i32;
//! \brief Fill some number of rectangles on the current rendering target
//! with the drawing color.
fn SDL_RenderFillRects(renderer: SDL_Renderer*, rects: const(const(SDL_Rect)*), count: i32) i32;
//! \brief Copy a portion of the texture to the current rendering target.
fn SDL_RenderCopy(renderer: SDL_Renderer*, texture: SDL_Texture*, srcrect: const(const(SDL_Rect)*), dstrect: const(const(SDL_Rect)*)) i32;
//! \brief Copy a portion of the source texture to the current rendering
//! target, rotating it by angle around the given center
fn SDL_RenderCopyEx(renderer: SDL_Renderer*, texture: SDL_Texture*, srcrect: const(const(SDL_Rect)*), dstrect: const(const(SDL_Rect)*), angle: const(f64), center: const(const(SDL_Point)*), flip: const(SDL_RendererFlip)) i32;
//! \brief Read pixels from the current rendering target.
fn SDL_RenderReadPixels(renderer: SDL_Renderer*, rect: const(const(SDL_Rect)*), format: Uint32, pixels: void*, pitch: i32) i32;
//! \brief Update the screen with rendering performed.
fn SDL_RenderPresent(renderer: SDL_Renderer*);
//! \brief Destroy the specified texture.
fn SDL_DestroyTexture(texture: SDL_Texture*);
//! \brief Destroy the rendering context for a window and free associated
//! textures.
fn SDL_DestroyRenderer(renderer: SDL_Renderer*);
//! \brief Bind the texture to the current OpenGL/ES/ES2 context for use
//! with OpenGL instructions.
fn SDL_GL_BindTexture(texture: SDL_Texture*, texw: f32*, texh: f32*) i32;
//! \brief Unbind a texture from the current OpenGL/ES/ES2 context.
fn SDL_GL_UnbindTexture(texture: SDL_Texture*) i32;

lib.sdl2.touch

module lib.sdl2.touch;


alias SDL_TouchID = Sint64;
alias SDL_FingerID = Sint64;

struct SDL_Finger
{
public:
	id: SDL_FingerID;
	x: f32;
	y: f32;
	pressure: f32;
}

fn SDL_TOUCH_MOUSEID() u32 { }
//! \brief Get the number of registered touch devices.
fn SDL_GetNumTouchDevices() i32;
//! \brief Get the touch ID with the given index, or 0 if the index is
//! invalid.
fn SDL_GetTouchDevice(index: i32) SDL_TouchID;
//! \brief Get the number of active fingers for a given touch device.
fn SDL_GetNumTouchFingers(touchID: SDL_TouchID) i32;
//! \brief Get the finger object of the given touch, with the given index.
fn SDL_GetTouchFinger(touchID: SDL_TouchID, index: i32) SDL_Finger*;

lib.sdl2.error

module lib.sdl2.error;


//! \file SDL_error.h
fn SDL_SetError(fmt: const(const(char)*)) i32;
fn SDL_GetError() char*;
fn SDL_ClearError();

lib.sdl2.pixels

module lib.sdl2.pixels;


enum SDL_ALPHA_OPAQUE;
enum SDL_ALPHA_TRANSPARENT;
enum SDL_PIXELTYPE_UNKNOWN;
enum SDL_PIXELTYPE_INDEX1;
enum SDL_PIXELTYPE_INDEX4;
enum SDL_PIXELTYPE_INDEX8;
enum SDL_PIXELTYPE_PACKED8;
enum SDL_PIXELTYPE_PACKED16;
enum SDL_PIXELTYPE_PACKED32;
enum SDL_PIXELTYPE_ARRAYU8;
enum SDL_PIXELTYPE_ARRAYU16;
enum SDL_PIXELTYPE_ARRAYU32;
enum SDL_PIXELTYPE_ARRAYF16;
enum SDL_PIXELTYPE_ARRAYF32;
enum SDL_BITMAPORDER_NONE;
enum SDL_BITMAPORDER_4321;
enum SDL_BITMAPORDER_1234;
enum SDL_PACKEDORDER_NONE;
enum SDL_PACKEDORDER_XRGB;
enum SDL_PACKEDORDER_RGBX;
enum SDL_PACKEDORDER_ARGB;
enum SDL_PACKEDORDER_RGBA;
enum SDL_PACKEDORDER_XBGR;
enum SDL_PACKEDORDER_BGRX;
enum SDL_PACKEDORDER_ABGR;
enum SDL_PACKEDORDER_BGRA;
enum SDL_ARRAYORDER_NONE;
enum SDL_ARRAYORDER_RGB;
enum SDL_ARRAYORDER_RGBA;
enum SDL_ARRAYORDER_ARGB;
enum SDL_ARRAYORDER_BGR;
enum SDL_ARRAYORDER_BGRA;
enum SDL_ARRAYORDER_ABGR;
enum SDL_PACKEDLAYOUT_NONE;
enum SDL_PACKEDLAYOUT_332;
enum SDL_PACKEDLAYOUT_4444;
enum SDL_PACKEDLAYOUT_1555;
enum SDL_PACKEDLAYOUT_5551;
enum SDL_PACKEDLAYOUT_565;
enum SDL_PACKEDLAYOUT_8888;
enum SDL_PACKEDLAYOUT_2101010;
enum SDL_PACKEDLAYOUT_1010102;
enum SDL_PIXELFORMAT_UNKNOWN;
enum SDL_PIXELFORMAT_INDEX1LSB;
enum SDL_PIXELFORMAT_INDEX1MSB;
enum SDL_PIXELFORMAT_INDEX4LSB;
enum SDL_PIXELFORMAT_INDEX4MSB;
enum SDL_PIXELFORMAT_INDEX8;
enum SDL_PIXELFORMAT_RGB332;
enum SDL_PIXELFORMAT_RGB444;
enum SDL_PIXELFORMAT_RGB555;
enum SDL_PIXELFORMAT_BGR555;
enum SDL_PIXELFORMAT_ARGB4444;
enum SDL_PIXELFORMAT_RGBA4444;
enum SDL_PIXELFORMAT_ABGR4444;
enum SDL_PIXELFORMAT_BGRA4444;
enum SDL_PIXELFORMAT_ARGB1555;
enum SDL_PIXELFORMAT_RGBA5551;
enum SDL_PIXELFORMAT_ABGR1555;
enum SDL_PIXELFORMAT_BGRA5551;
enum SDL_PIXELFORMAT_RGB565;
enum SDL_PIXELFORMAT_BGR565;
enum SDL_PIXELFORMAT_RGB24;
enum SDL_PIXELFORMAT_BGR24;
enum SDL_PIXELFORMAT_RGB888;
enum SDL_PIXELFORMAT_RGBX8888;
enum SDL_PIXELFORMAT_BGR888;
enum SDL_PIXELFORMAT_BGRX8888;
enum SDL_PIXELFORMAT_ARGB8888;
enum SDL_PIXELFORMAT_RGBA8888;
enum SDL_PIXELFORMAT_ABGR8888;
enum SDL_PIXELFORMAT_BGRA8888;
enum SDL_PIXELFORMAT_ARGB2101010;
enum SDL_PIXELFORMAT_RGBA32;
enum SDL_PIXELFORMAT_ARGB32;
enum SDL_PIXELFORMAT_BGRA32;
enum SDL_PIXELFORMAT_ABGR32;

struct SDL_Color
{
public:
	r: u8;
	g: u8;
	b: u8;
	a: u8;
}

struct SDL_Palette
{
public:
	ncolors: i32;
	colors: SDL_Color*;
	_version: u32;
	refcount: i32;
}

struct SDL_PixelFormat
{
public:
	format: u32;
	palette: SDL_Palette*;
	BitsPerPixel: u8;
	BytesPerPixel: u8;
	padding: u16;
	Rmask: u32;
	Gmask: u32;
	Bmask: u32;
	Amask: u32;
	Rloss: u8;
	Gloss: u8;
	Bloss: u8;
	Aloss: u8;
	Rshift: u8;
	Gshift: u8;
	Bshift: u8;
	Ashift: u8;
	refcount: i32;
	next: SDL_PixelFormat*;
}

fn SDL_GetPixelFormatName(u32) const(char)*;
fn SDL_PixelFormatEnumToMasks(u32, i32*, u32*, u32*, u32*, u32*) bool;
fn SDL_MasksToPixelFormatEnum(i32, u32, u32, u32, u32) u32;
fn SDL_AllocFormat(u32) SDL_PixelFormat*;
fn SDL_FreeFormat(SDL_PixelFormat*);
fn SDL_AllocPalette(i32) SDL_Palette*;
fn SDL_SetPixelFormatPalette(SDL_PixelFormat*, SDL_Palette*) i32;
fn SDL_SetPaletteColors(SDL_Palette*, const(const(SDL_Color)*), i32, i32) i32;
fn SDL_FreePalette(SDL_Palette*);
fn SDL_MapRGB(const(const(SDL_PixelFormat)*), u8, u8, u8) u32;
fn SDL_MapRGBA(const(const(SDL_PixelFormat)*), u8, u8, u8, u8) u32;
fn SDL_CalculateGammaRamp(f32, u16*);

lib.sdl2.audio

module lib.sdl2.audio;


//! \name Audio flags
enum SDL_AUDIO_MASK_BITSIZE;
enum SDL_AUDIO_MASK_DATATYPE;
enum SDL_AUDIO_MASK_ENDIAN;
enum SDL_AUDIO_MASK_SIGNED;
//! \name Audio format flags
enum AUDIO_U8;
enum AUDIO_S8;
enum AUDIO_U16LSB;
enum AUDIO_S16LSB;
enum AUDIO_U16MSB;
enum AUDIO_S16MSB;
enum AUDIO_U16;
enum AUDIO_S16;
//! \name int32 support
enum AUDIO_S32LSB;
enum AUDIO_S32MSB;
enum AUDIO_S32;
//! \name float32 support
enum AUDIO_F32LSB;
enum AUDIO_F32MSB;
enum AUDIO_F32;
enum AUDIO_U16SYS;
enum AUDIO_S16SYS;
enum AUDIO_S32SYS;
enum AUDIO_F32SYS;
//! \name Allow change flags
enum SDL_AUDIO_ALLOW_FREQUENCY_CHANGE;
enum SDL_AUDIO_ALLOW_FORMAT_CHANGE;
enum SDL_AUDIO_ALLOW_CHANNELS_CHANGE;
enum SDL_AUDIO_ALLOW_ANY_CHANGE;
enum SDL_AUDIO_STOPPED;
enum SDL_AUDIO_PLAYING;
enum SDL_AUDIO_PAUSED;
enum SDL_MIX_MAXVOLUME;

//! \brief Audio format flags.
alias SDL_AudioFormat = Uint16;
//! This function is called when the audio device needs more data.
alias SDL_AudioCallback = fn (void*, Uint8*, i32) (void);
alias SDL_AudioFilter = fn (void*, SDL_AudioFormat) (void);
//! SDL Audio Device IDs.
alias SDL_AudioDeviceID = Uint32;
//! \name Audio state
alias SDL_AudioStatus = i32;

//! The calculated values in this structure are calculated by
//! SDL_OpenAudio().
struct SDL_AudioSpec
{
public:
	//! DSP frequency -- samples per second *
	freq: i32;
	//! Audio data format *
	format: SDL_AudioFormat;
	//! Number of channels: 1 mono, 2 stereo *
	channels: Uint8;
	//! Audio buffer silence value (calculated) *
	silence: Uint8;
	//! Audio buffer size in samples (power of 2) *
	samples: Uint16;
	//! Necessary for some compile environments *
	padding: Uint16;
	//! Audio buffer size in bytes (calculated) *
	size: Uint32;
	callback: SDL_AudioCallback;
	userdata: void*;
}

//! A structure to hold a set of audio conversion filters and buffers.
struct SDL_AudioCVT
{
public:
	needed: i32;
	src_format: SDL_AudioFormat;
	dst_format: SDL_AudioFormat;
	rate_incr: f64;
	buf: Uint8*;
	len: i32;
	len_cvt: i32;
	len_mult: i32;
	len_ratio: f64;
	filters: SDL_AudioFilter[10];
	filter_index: i32;
}

fn SDL_AUDIO_BITSIZE(x: i32) i32 { }
fn SDL_AUDIO_ISFLOAT(x: i32) bool { }
fn SDL_AUDIO_ISBIGENDIAN(x: i32) bool { }
fn SDL_AUDIO_ISSIGNED(x: i32) bool { }
fn SDL_AUDIO_ISINT(x: i32) bool { }
fn SDL_AUDIO_ISLITTLEENDIAN(x: i32) bool { }
fn SDL_AUDIO_ISUNSIGNED(x: i32) bool { }
//! \name Driver discovery functions
fn SDL_GetNumAudioDrivers() i32;
fn SDL_GetAudioDriver(index: i32) char*;
//! \name Initialization and cleanup
fn SDL_AudioInit(driver_name: const(const(char)*)) i32;
fn SDL_AudioQuit();
//! This function returns the name of the current audio driver, or NULL if
//! no driver has been initialized.
fn SDL_GetCurrentAudioDriver() char*;
//! This function opens the audio device with the desired parameters, and
//! returns 0 if successful, placing the actual hardware parameters in the
//! structure pointed to by \c obtained. If \c obtained is NULL, the audio
//! data passed to the callback function will be guaranteed to be in the
//! requested format, and will be automatically converted to the hardware
//! audio format if necessary. This function returns -1 if it failed to
//! open the audio device, or couldn't set up the audio thread.
fn SDL_OpenAudio(desired: SDL_AudioSpec*, obtained: SDL_AudioSpec*) i32;
//! Get the number of available devices exposed by the current driver. Only
//! valid after a successfully initializing the audio subsystem. Returns -1
//! if an explicit list of devices can't be determined; this is not an
//! error. For example, if SDL is set up to talk to a remote audio server,
//! it can't list every one available on the Internet, but it will still
//! allow a specific host to be specified to SDL_OpenAudioDevice().
fn SDL_GetNumAudioDevices(iscapture: i32) i32;
//! Get the human-readable name of a specific audio device. Must be a value
//! between 0 and (number of audio devices-1). Only valid after a
//! successfully initializing the audio subsystem. The values returned by
//! this function reflect the latest call to SDL_GetNumAudioDevices();
//! recall that function to redetect available hardware.
fn SDL_GetAudioDeviceName(index: i32, iscapture: i32) char*;
//! Open a specific audio device. Passing in a device name of NULL
//! requests the most reasonable default (and is equivalent to calling
//! SDL_OpenAudio()).
fn SDL_OpenAudioDevice(device: const(const(char)*), iscapture: i32, desired: const(const(SDL_AudioSpec)*), obtained: SDL_AudioSpec*, allowed_changes: i32) SDL_AudioDeviceID;
fn SDL_GetAudioStatus() SDL_AudioStatus;
fn SDL_GetAudioDeviceStatus(dev: SDL_AudioDeviceID) SDL_AudioStatus;
//! \name Pause audio functions
fn SDL_PauseAudio(pause_on: i32);
fn SDL_PauseAudioDevice(dev: SDL_AudioDeviceID, pause_on: i32);
//! This function loads a WAVE from the data source, automatically freeing
//! that source if \c freesrc is non-zero. For example, to load a WAVE
//! file, you could do: \code SDL_LoadWAV_RW(SDL_RWFromFile("sample.wav",
//! "rb"), 1, ...); \endcode
fn SDL_LoadWAV_RW(src: SDL_RWops*, freesrc: i32, spec: SDL_AudioSpec*, audio_buf: Uint8**, audio_len: Uint32*) SDL_AudioSpec*;
//! This function frees data previously allocated with SDL_LoadWAV_RW()
fn SDL_FreeWAV(audio_buf: Uint8*);
//! This function takes a source format and rate and a destination format
//! and rate, and initializes the \c cvt structure with information needed
//! by SDL_ConvertAudio() to convert a buffer of audio data from one
//! format to the other.
fn SDL_BuildAudioCVT(cvt: SDL_AudioCVT*, src_format: SDL_AudioFormat, src_channels: Uint8, src_rate: i32, dst_format: SDL_AudioFormat, dst_channels: Uint8, dst_rate: i32) i32;
//! Once you have initialized the \c cvt structure using
//! SDL_BuildAudioCVT(), created an audio buffer \c cvt->buf, and filled it
//! with \c cvt->len bytes of audio data in the source format, this
//! function will convert it in-place to the desired format.
fn SDL_ConvertAudio(cvt: SDL_AudioCVT*) i32;
//! This takes two audio buffers of the playing audio format and mixes
//! them, performing addition, volume adjustment, and overflow clipping.
//! The volume ranges from 0 - 128, and should be set to
//! ::SDL_MIX_MAXVOLUME for full audio volume. Note this does not change
//! hardware volume. This is provided for convenience -- you can mix your
//! own audio data.
fn SDL_MixAudio(dst: Uint8*, src: const(const(Uint8)*), len: Uint32, volume: i32);
//! This works like SDL_MixAudio(), but you specify the audio format
//! instead of using the format of audio device 1. Thus it can be used when
//! no audio device is open at all.
fn SDL_MixAudioFormat(dst: Uint8*, src: const(const(Uint8)*), format: SDL_AudioFormat, len: Uint32, volume: i32);
//! \name Audio lock functions
fn SDL_LockAudio();
fn SDL_LockAudioDevice(dev: SDL_AudioDeviceID);
fn SDL_UnlockAudio();
fn SDL_UnlockAudioDevice(dev: SDL_AudioDeviceID);
//! This function shuts down audio processing and closes the audio device.
fn SDL_CloseAudio();
fn SDL_CloseAudioDevice(dev: SDL_AudioDeviceID);
//! \return 1 if audio device is still functioning, zero if not, -1 on
//! error.
fn SDL_AudioDeviceConnected(dev: SDL_AudioDeviceID) i32;
//! Queue more audio on non-callback devices.
fn SDL_QueueAudio(dev: SDL_AudioDeviceID, data: const(const(void)*), len: Uint32) i32;
//! Dequeue more audio on non-callback devices.
fn SDL_DequeueAudio(dev: SDL_AudioDeviceID, data: void*, len: Uint32) Uint32;
//! Get the number of bytes of still-queued audio.
fn SDL_GetQueuedAudioSize(dev: SDL_AudioDeviceID) Uint32;
//! Drop any queued audio data. For playback devices, this is any queued
//! data still waiting to be submitted to the hardware. For capture
//! devices, this is any data that was queued by the device that hasn't yet
//! been dequeued by the application.
fn SDL_ClearQueuedAudio(dev: SDL_AudioDeviceID);

lib.sdl2.power

module lib.sdl2.power;


enum SDL_POWERSTATE_UNKNOWN;
enum SDL_POWERSTATE_ON_BATTERY;
enum SDL_POWERSTATE_NO_BATTERY;
enum SDL_POWERSTATE_CHARGING;
enum SDL_POWERSTATE_CHARGED;

//! \brief The basic state for the system's power supply.
alias SDL_PowerState = i32;

//! \brief Get the current power supply details.
fn SDL_GetPowerInfo(secs: i32*, pct: i32*) SDL_PowerState;

lib.sdl2.surface

module lib.sdl2.surface;


//! \name Surface flags
enum SDL_SWSURFACE;
enum SDL_PREALLOC;
enum SDL_RLEACCEL;
enum SDL_DONTFREE;

//! \brief The type of function used for surface blitting functions.
alias SDL_blit = fn (SDL_Surface*, SDL_Rect*, SDL_Surface*, SDL_Rect*) (i32);

//! \brief A collection of pixels used in software blitting.
struct SDL_Surface
{
public:
	flags: Uint32;
	format: SDL_PixelFormat*;
	w: i32;
	h: i32;
	pitch: i32;
	pixels: void*;
	userdata: void*;
	locked: i32;
	lock_data: void*;
	clip_rect: SDL_Rect;
	map: void*;
	refcount: i32;
}

//! Evaluates to true if the surface needs to be locked before access.
fn SDL_MUSTLOCK(s: SDL_Surface*) bool { }
//! Allocate and free an RGB surface.
fn SDL_CreateRGBSurface(flags: Uint32, width: i32, height: i32, depth: i32, Rmask: Uint32, Gmask: Uint32, Bmask: Uint32, Amask: Uint32) SDL_Surface*;
fn SDL_CreateRGBSurfaceWithFormat(flags: Uint32, width: i32, height: i32, depth: i32, format: Uint32) SDL_Surface*;
fn SDL_CreateRGBSurfaceFrom(pixels: void*, width: i32, height: i32, depth: i32, pitch: i32, Rmask: Uint32, Gmask: Uint32, Bmask: Uint32, Amask: Uint32) SDL_Surface*;
fn SDL_CreateRGBSurfaceWithFormatFrom(pixels: void*, width: i32, height: i32, depth: i32, pitch: i32, format: Uint32) SDL_Surface*;
fn SDL_FreeSurface(surface: SDL_Surface*);
//! \brief Set the palette used by a surface.
fn SDL_SetSurfacePalette(surface: SDL_Surface*, palette: SDL_Palette*) i32;
//! \brief Sets up a surface for directly accessing the pixels.
fn SDL_LockSurface(surface: SDL_Surface*) i32;
//! \sa SDL_LockSurface() *
fn SDL_UnlockSurface(surface: SDL_Surface*);
//! Load a surface from a seekable SDL data stream (memory or file).
fn SDL_LoadBMP_RW(src: SDL_RWops*, freesrc: i32) SDL_Surface*;
//! Load a surface from a file.
fn SDL_LoadBMP(s: const(char)*) SDL_Surface* { }
//! Save a surface to a seekable SDL data stream (memory or file).
fn SDL_SaveBMP_RW(surface: SDL_Surface*, dst: SDL_RWops*, freedst: i32) i32;
//! Save a surface to a file.
fn SDL_SaveBMP(surface: SDL_Surface*, s: const(char)*) i32 { }
//! \brief Sets the RLE acceleration hint for a surface.
fn SDL_SetSurfaceRLE(surface: SDL_Surface*, flag: i32) i32;
//! \brief Sets the color key (transparent pixel) in a blittable surface.
fn SDL_SetColorKey(surface: SDL_Surface*, flag: i32, key: Uint32) i32;
//! \brief Gets the color key (transparent pixel) in a blittable surface.
fn SDL_GetColorKey(surface: SDL_Surface*, key: Uint32*) i32;
//! \brief Set an additional color value used in blit operations.
fn SDL_SetSurfaceColorMod(surface: SDL_Surface*, r: Uint8, g: Uint8, b: Uint8) i32;
//! \brief Get the additional color value used in blit operations.
fn SDL_GetSurfaceColorMod(surface: SDL_Surface*, r: Uint8*, g: Uint8*, b: Uint8*) i32;
//! \brief Set an additional alpha value used in blit operations.
fn SDL_SetSurfaceAlphaMod(surface: SDL_Surface*, alpha: Uint8) i32;
//! \brief Get the additional alpha value used in blit operations.
fn SDL_GetSurfaceAlphaMod(surface: SDL_Surface*, alpha: Uint8*) i32;
//! \brief Set the blend mode used for blit operations.
fn SDL_SetSurfaceBlendMode(surface: SDL_Surface*, blendMode: SDL_BlendMode) i32;
//! \brief Get the blend mode used for blit operations.
fn SDL_GetSurfaceBlendMode(surface: SDL_Surface*, blendMode: SDL_BlendMode*) i32;
//! Sets the clipping rectangle for the destination surface in a blit.
fn SDL_SetClipRect(surface: SDL_Surface*, rect: const(const(SDL_Rect)*)) SDL_bool;
//! Gets the clipping rectangle for the destination surface in a blit.
fn SDL_GetClipRect(surface: SDL_Surface*, rect: SDL_Rect*);
//! Creates a new surface of the specified format, and then copies and
//! maps the given surface to it so the blit of the converted surface will
//! be as fast as possible. If this function fails, it returns NULL.
fn SDL_ConvertSurface(src: SDL_Surface*, fmt: SDL_PixelFormat*, flags: Uint32) SDL_Surface*;
fn SDL_ConvertSurfaceFormat(src: SDL_Surface*, pixel_format: Uint32, flags: Uint32) SDL_Surface*;
//! \brief Copy a block of pixels of one format to another format
fn SDL_ConvertPixels(width: i32, height: i32, src_format: Uint32, src: const(const(void)*), src_pitch: i32, dst_format: Uint32, dst: void*, dst_pitch: i32) i32;
//! Performs a fast fill of the given rectangle with \c color.
fn SDL_FillRect(dst: SDL_Surface*, rect: const(const(SDL_Rect)*), color: Uint32) i32;
fn SDL_FillRects(dst: SDL_Surface*, rects: const(const(SDL_Rect)*), count: i32, color: Uint32) i32;
//! Performs a fast blit from the source surface to the destination
//! surface.
fn SDL_BlitSurface(a: SDL_Surface*, b: const(const(SDL_Rect)*), c: SDL_Surface*, d: SDL_Rect*) i32 { }
//! This is the public blit function, SDL_BlitSurface(), and it performs
//! rectangle validation and clipping before passing it to SDL_LowerBlit()
fn SDL_UpperBlit(src: SDL_Surface*, srcrect: const(const(SDL_Rect)*), dst: SDL_Surface*, dstrect: SDL_Rect*) i32;
//! This is a semi-private blit function and it performs low-level surface
//! blitting only.
fn SDL_LowerBlit(src: SDL_Surface*, srcrect: SDL_Rect*, dst: SDL_Surface*, dstrect: SDL_Rect*) i32;
//! \brief Perform a fast, low quality, stretch blit between two surfaces
//! of the same pixel format.
fn SDL_SoftStretch(src: SDL_Surface*, srcrect: const(const(SDL_Rect)*), dst: SDL_Surface*, dstrect: const(const(SDL_Rect)*)) i32;
fn SDL_BlitScaled(a: SDL_Surface*, b: const(const(SDL_Rect)*), c: SDL_Surface*, d: SDL_Rect*) i32 { }
//! This is the public scaled blit function, SDL_BlitScaled(), and it
//! performs rectangle validation and clipping before passing it to
//! SDL_LowerBlitScaled()
fn SDL_UpperBlitScaled(src: SDL_Surface*, srcrect: const(const(SDL_Rect)*), dst: SDL_Surface*, dstrect: SDL_Rect*) i32;
//! This is a semi-private blit function and it performs low-level surface
//! scaled blitting only.
fn SDL_LowerBlitScaled(src: SDL_Surface*, srcrect: SDL_Rect*, dst: SDL_Surface*, dstrect: SDL_Rect*) i32;

lib.sdl2.platform

module lib.sdl2.platform;


//! \file SDL_platform.h
fn SDL_GetPlatform() char*;

lib.sdl2.messagebox

module lib.sdl2.messagebox;


enum SDL_MESSAGEBOX_ERROR;
enum SDL_MESSAGEBOX_WARNING;
enum SDL_MESSAGEBOX_INFORMATION;
enum SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT;
enum SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT;
enum SDL_MESSAGEBOX_COLOR_BACKGROUND;
enum SDL_MESSAGEBOX_COLOR_TEXT;
enum SDL_MESSAGEBOX_COLOR_BUTTON_BORDER;
enum SDL_MESSAGEBOX_COLOR_BUTTON_BACKGROUND;
enum SDL_MESSAGEBOX_COLOR_BUTTON_SELECTED;
enum SDL_MESSAGEBOX_COLOR_MAX;

//! \brief SDL_MessageBox flags. If supported will display warning icon,
//! etc.
alias SDL_MessageBoxFlags = i32;
//! \brief Flags for SDL_MessageBoxButtonData.
alias SDL_MessageBoxButtonFlags = i32;
alias SDL_MessageBoxColorType = i32;

//! \brief Individual button data.
struct SDL_MessageBoxButtonData
{
public:
	flags: Uint32;
	buttonid: i32;
	text: char*;
}

//! \brief RGB value used in a message box color scheme
struct SDL_MessageBoxColor
{
public:
	r: Uint8;
	g: Uint8;
	b: Uint8;
}

//! \brief A set of colors to use for message box dialogs
struct SDL_MessageBoxColorScheme
{
public:
	colors: SDL_MessageBoxColor[6];
}

//! \brief MessageBox structure containing title, text, window, etc.
struct SDL_MessageBoxData
{
public:
	flags: Uint32;
	window: SDL_Window*;
	title: char*;
	message: char*;
	numbuttons: i32;
	buttons: SDL_MessageBoxButtonData*;
	colorScheme: SDL_MessageBoxColorScheme*;
}

//! \brief Create a modal message box.
fn SDL_ShowMessageBox(messageboxdata: const(const(SDL_MessageBoxData)*), buttonid: i32*) i32;
//! \brief Create a simple modal message box
fn SDL_ShowSimpleMessageBox(flags: Uint32, title: const(const(char)*), message: const(const(char)*), window: SDL_Window*) i32;

lib.sdl2.ttf

module lib.sdl2.ttf;


enum SDL_TTF_MAJOR_VERSION;
enum SDL_TTF_MINOR_VERSION;
enum SDL_TTF_PATCHLEVEL;
enum UNICODE_BOM_NATIVE;
enum UNICODE_BOM_SWAPPED;
enum TTF_STYLE_NORMAL;
enum TTF_STYLE_BOLD;
enum TTF_STYLE_ITALIC;
enum TTF_STYLE_UNDERLINE;
enum TTF_STYLE_STRIKETHROUGH;
enum TTF_HINTING_NORMAL;
enum TTF_HINTING_LIGHT;
enum TTF_HINTING_MONO;
enum TTF_HINTING_NONE;

struct TTF_Font
{
}

fn TTF_ByteSwappedUNICODE(swapped: i32);
fn TTF_Init() i32;
fn TTF_OpenFont(file: const(const(char)*), ptsize: i32) TTF_Font*;
fn TTF_OpenFontIndex(file: const(const(char)*), ptsize: i32, index: i32) TTF_Font*;
fn TTF_OpenFontRW(src: SDL_RWops*, freesrc: i32, ptsize: i32) TTF_Font*;
fn TTF_OpenFontIndexRW(src: SDL_RWops*, freesrc: i32, ptsize: i32, index: i32) TTF_Font*;
fn TTF_GetFontStyle(font: const(const(TTF_Font)*)) i32;
fn TTF_SetFontStyle(font: TTF_Font*, style: i32);
fn TTF_GetFontOutline(font: const(const(TTF_Font)*)) i32;
fn TTF_SetFontOutline(font: TTF_Font*, outline: i32);
fn TTF_GetFontHinting(font: const(const(TTF_Font)*)) i32;
fn TTF_SetFontHinting(font: TTF_Font*, hinting: i32);
fn TTF_FontHeight(font: const(const(TTF_Font)*)) i32;
fn TTF_FontAscent(font: const(const(TTF_Font)*)) i32;
fn TTF_FontDescent(font: const(const(TTF_Font)*)) i32;
fn TTF_FontLineSkip(font: const(const(TTF_Font)*)) i32;
fn TTF_GetFontKerning(font: const(const(TTF_Font)*)) i32;
fn TTF_SetFontKerning(font: TTF_Font*, allowed: i32);
fn TTF_FontFaces(font: const(const(TTF_Font)*)) i64;
fn TTF_FontFaceIsFixedWidth(font: const(const(TTF_Font)*)) i32;
fn TTF_FontFaceFamilyName(font: const(const(TTF_Font)*)) char*;
fn TTF_FontFaceStyleName(font: const(const(TTF_Font)*)) char*;
fn TTF_GlyphIsProvided(font: const(const(TTF_Font)*), ch: Uint16) i32;
fn TTF_GlyphMetrics(font: TTF_Font*, ch: Uint16, minx: i32*, maxx: i32*, miny: i32*, maxy: i32*, advance: i32*) i32;
fn TTF_SizeText(font: TTF_Font*, text: const(const(char)*), w: i32*, h: i32*) i32;
fn TTF_SizeUTF8(font: TTF_Font*, text: const(const(char)*), w: i32*, h: i32*) i32;
fn TTF_SizeUNICODE(font: TTF_Font*, text: const(const(Uint16)*), w: i32*, h: i32*) i32;
fn TTF_RenderText_Solid(font: TTF_Font*, text: const(const(char)*), fg: SDL_Color) SDL_Surface*;
fn TTF_RenderUTF8_Solid(font: TTF_Font*, text: const(const(char)*), fg: SDL_Color) SDL_Surface*;
fn TTF_RenderUNICODE_Solid(font: TTF_Font*, text: const(const(Uint16)*), fg: SDL_Color) SDL_Surface*;
fn TTF_RenderGlyph_Solid(font: TTF_Font*, ch: Uint16, fg: SDL_Color) SDL_Surface*;
fn TTF_RenderText_Shaded(font: TTF_Font*, text: const(const(char)*), fg: SDL_Color, bg: SDL_Color) SDL_Surface*;
fn TTF_RenderUTF8_Shaded(font: TTF_Font*, text: const(const(char)*), fg: SDL_Color, bg: SDL_Color) SDL_Surface*;
fn TTF_RenderUNICODE_Shaded(font: TTF_Font*, text: const(const(Uint16)*), fg: SDL_Color, bg: SDL_Color) SDL_Surface*;
fn TTF_RenderGlyph_Shaded(font: TTF_Font*, ch: Uint16, fg: SDL_Color, bg: SDL_Color) SDL_Surface*;
fn TTF_RenderText_Blended(font: TTF_Font*, text: const(const(char)*), fg: SDL_Color) SDL_Surface*;
fn TTF_RenderUTF8_Blended(font: TTF_Font*, text: const(const(char)*), fg: SDL_Color) SDL_Surface*;
fn TTF_RenderUNICODE_Blended(font: TTF_Font*, text: const(const(Uint16)*), fg: SDL_Color) SDL_Surface*;
fn TTF_RenderText_Blended_Wrapped(font: TTF_Font*, text: const(const(char)*), fg: SDL_Color, wrapLength: Uint32) SDL_Surface*;
fn TTF_RenderUTF8_Blended_Wrapped(font: TTF_Font*, text: const(const(char)*), fg: SDL_Color, wrapLength: Uint32) SDL_Surface*;
fn TTF_RenderUNICODE_Blended_Wrapped(font: TTF_Font*, text: const(const(Uint16)*), fg: SDL_Color, wrapLength: Uint32) SDL_Surface*;
fn TTF_RenderGlyph_Blended(font: TTF_Font*, ch: Uint16, fg: SDL_Color) SDL_Surface*;
fn TTF_CloseFont(font: TTF_Font*);
fn TTF_Quit();
fn TTF_WasInit() i32;
fn TTF_GetFontKerningSize(font: TTF_Font*, prev_index: i32, index: i32) i32;
fn TTF_GetFontKerningSizeGlyphs(font: TTF_Font*, previous_ch: Uint16, ch: Uint16) i32;

lib.sdl2.keycode

module lib.sdl2.keycode;

public import lib.sdl2.scancode;


enum SDLK_SCANCODE_MASK;
enum SDLK_UNKNOWN;
enum SDLK_RETURN;
enum SDLK_ESCAPE;
enum SDLK_BACKSPACE;
enum SDLK_TAB;
enum SDLK_SPACE;
enum SDLK_EXCLAIM;
enum SDLK_QUOTEDBL;
enum SDLK_HASH;
enum SDLK_PERCENT;
enum SDLK_DOLLAR;
enum SDLK_AMPERSAND;
enum SDLK_QUOTE;
enum SDLK_LEFTPAREN;
enum SDLK_RIGHTPAREN;
enum SDLK_ASTERISK;
enum SDLK_PLUS;
enum SDLK_COMMA;
enum SDLK_MINUS;
enum SDLK_PERIOD;
enum SDLK_SLASH;
enum SDLK_0;
enum SDLK_1;
enum SDLK_2;
enum SDLK_3;
enum SDLK_4;
enum SDLK_5;
enum SDLK_6;
enum SDLK_7;
enum SDLK_8;
enum SDLK_9;
enum SDLK_COLON;
enum SDLK_SEMICOLON;
enum SDLK_LESS;
enum SDLK_EQUALS;
enum SDLK_GREATER;
enum SDLK_QUESTION;
enum SDLK_AT;
enum SDLK_LEFTBRACKET;
enum SDLK_BACKSLASH;
enum SDLK_RIGHTBRACKET;
enum SDLK_CARET;
enum SDLK_UNDERSCORE;
enum SDLK_BACKQUOTE;
enum SDLK_a;
enum SDLK_b;
enum SDLK_c;
enum SDLK_d;
enum SDLK_e;
enum SDLK_f;
enum SDLK_g;
enum SDLK_h;
enum SDLK_i;
enum SDLK_j;
enum SDLK_k;
enum SDLK_l;
enum SDLK_m;
enum SDLK_n;
enum SDLK_o;
enum SDLK_p;
enum SDLK_q;
enum SDLK_r;
enum SDLK_s;
enum SDLK_t;
enum SDLK_u;
enum SDLK_v;
enum SDLK_w;
enum SDLK_x;
enum SDLK_y;
enum SDLK_z;
enum SDLK_CAPSLOCK;
enum SDLK_F1;
enum SDLK_F2;
enum SDLK_F3;
enum SDLK_F4;
enum SDLK_F5;
enum SDLK_F6;
enum SDLK_F7;
enum SDLK_F8;
enum SDLK_F9;
enum SDLK_F10;
enum SDLK_F11;
enum SDLK_F12;
enum SDLK_PRINTSCREEN;
enum SDLK_SCROLLLOCK;
enum SDLK_PAUSE;
enum SDLK_INSERT;
enum SDLK_HOME;
enum SDLK_PAGEUP;
enum SDLK_DELETE;
enum SDLK_END;
enum SDLK_PAGEDOWN;
enum SDLK_RIGHT;
enum SDLK_LEFT;
enum SDLK_DOWN;
enum SDLK_UP;
enum SDLK_NUMLOCKCLEAR;
enum SDLK_KP_DIVIDE;
enum SDLK_KP_MULTIPLY;
enum SDLK_KP_MINUS;
enum SDLK_KP_PLUS;
enum SDLK_KP_ENTER;
enum SDLK_KP_1;
enum SDLK_KP_2;
enum SDLK_KP_3;
enum SDLK_KP_4;
enum SDLK_KP_5;
enum SDLK_KP_6;
enum SDLK_KP_7;
enum SDLK_KP_8;
enum SDLK_KP_9;
enum SDLK_KP_0;
enum SDLK_KP_PERIOD;
enum SDLK_APPLICATION;
enum SDLK_POWER;
enum SDLK_KP_EQUALS;
enum SDLK_F13;
enum SDLK_F14;
enum SDLK_F15;
enum SDLK_F16;
enum SDLK_F17;
enum SDLK_F18;
enum SDLK_F19;
enum SDLK_F20;
enum SDLK_F21;
enum SDLK_F22;
enum SDLK_F23;
enum SDLK_F24;
enum SDLK_EXECUTE;
enum SDLK_HELP;
enum SDLK_MENU;
enum SDLK_SELECT;
enum SDLK_STOP;
enum SDLK_AGAIN;
enum SDLK_UNDO;
enum SDLK_CUT;
enum SDLK_COPY;
enum SDLK_PASTE;
enum SDLK_FIND;
enum SDLK_MUTE;
enum SDLK_VOLUMEUP;
enum SDLK_VOLUMEDOWN;
enum SDLK_KP_COMMA;
enum SDLK_KP_EQUALSAS400;
enum SDLK_ALTERASE;
enum SDLK_SYSREQ;
enum SDLK_CANCEL;
enum SDLK_CLEAR;
enum SDLK_PRIOR;
enum SDLK_RETURN2;
enum SDLK_SEPARATOR;
enum SDLK_OUT;
enum SDLK_OPER;
enum SDLK_CLEARAGAIN;
enum SDLK_CRSEL;
enum SDLK_EXSEL;
enum SDLK_KP_00;
enum SDLK_KP_000;
enum SDLK_THOUSANDSSEPARATOR;
enum SDLK_DECIMALSEPARATOR;
enum SDLK_CURRENCYUNIT;
enum SDLK_CURRENCYSUBUNIT;
enum SDLK_KP_LEFTPAREN;
enum SDLK_KP_RIGHTPAREN;
enum SDLK_KP_LEFTBRACE;
enum SDLK_KP_RIGHTBRACE;
enum SDLK_KP_TAB;
enum SDLK_KP_BACKSPACE;
enum SDLK_KP_A;
enum SDLK_KP_B;
enum SDLK_KP_C;
enum SDLK_KP_D;
enum SDLK_KP_E;
enum SDLK_KP_F;
enum SDLK_KP_XOR;
enum SDLK_KP_POWER;
enum SDLK_KP_PERCENT;
enum SDLK_KP_LESS;
enum SDLK_KP_GREATER;
enum SDLK_KP_AMPERSAND;
enum SDLK_KP_DBLAMPERSAND;
enum SDLK_KP_VERTICALBAR;
enum SDLK_KP_DBLVERTICALBAR;
enum SDLK_KP_COLON;
enum SDLK_KP_HASH;
enum SDLK_KP_SPACE;
enum SDLK_KP_AT;
enum SDLK_KP_EXCLAM;
enum SDLK_KP_MEMSTORE;
enum SDLK_KP_MEMRECALL;
enum SDLK_KP_MEMCLEAR;
enum SDLK_KP_MEMADD;
enum SDLK_KP_MEMSUBTRACT;
enum SDLK_KP_MEMMULTIPLY;
enum SDLK_KP_MEMDIVIDE;
enum SDLK_KP_PLUSMINUS;
enum SDLK_KP_CLEAR;
enum SDLK_KP_CLEARENTRY;
enum SDLK_KP_BINARY;
enum SDLK_KP_OCTAL;
enum SDLK_KP_DECIMAL;
enum SDLK_KP_HEXADECIMAL;
enum SDLK_LCTRL;
enum SDLK_LSHIFT;
enum SDLK_LALT;
enum SDLK_LGUI;
enum SDLK_RCTRL;
enum SDLK_RSHIFT;
enum SDLK_RALT;
enum SDLK_RGUI;
enum SDLK_MODE;
enum SDLK_AUDIONEXT;
enum SDLK_AUDIOPREV;
enum SDLK_AUDIOSTOP;
enum SDLK_AUDIOPLAY;
enum SDLK_AUDIOMUTE;
enum SDLK_MEDIASELECT;
enum SDLK_WWW;
enum SDLK_MAIL;
enum SDLK_CALCULATOR;
enum SDLK_COMPUTER;
enum SDLK_AC_SEARCH;
enum SDLK_AC_HOME;
enum SDLK_AC_BACK;
enum SDLK_AC_FORWARD;
enum SDLK_AC_STOP;
enum SDLK_AC_REFRESH;
enum SDLK_AC_BOOKMARKS;
enum SDLK_BRIGHTNESSDOWN;
enum SDLK_BRIGHTNESSUP;
enum SDLK_DISPLAYSWITCH;
enum SDLK_KBDILLUMTOGGLE;
enum SDLK_KBDILLUMDOWN;
enum SDLK_KBDILLUMUP;
enum SDLK_EJECT;
enum SDLK_SLEEP;
enum KMOD_NONE;
enum KMOD_LSHIFT;
enum KMOD_RSHIFT;
enum KMOD_LCTRL;
enum KMOD_RCTRL;
enum KMOD_LALT;
enum KMOD_RALT;
enum KMOD_LGUI;
enum KMOD_RGUI;
enum KMOD_NUM;
enum KMOD_CAPS;
enum KMOD_MODE;
enum KMOD_RESERVED;
enum KMOD_CTRL;
enum KMOD_SHIFT;
enum KMOD_ALT;
enum KMOD_GUI;

//! \brief The SDL virtual key representation.
alias SDL_Keycode = i32;
//! \brief Enumeration of valid key mods (possibly OR'd together).
alias SDL_Keymod = i32;

lib.sdl2._assert

module lib.sdl2._assert;


enum SDL_ASSERTION_RETRY;
enum SDL_ASSERTION_BREAK;
enum SDL_ASSERTION_ABORT;
enum SDL_ASSERTION_IGNORE;
enum SDL_ASSERTION_ALWAYS_IGNORE;

alias SDL_assert_state = i32;
alias SDL_AssertionHandler = fn (const(const(SDL_assert_data)*), void*) (SDL_assert_state);

struct SDL_assert_data
{
public:
	always_ignore: i32;
	trigger_count: u32;
	condition: char*;
	filename: char*;
	linenum: i32;
	_function: char*;
	next: SDL_assert_data*;
}

//! \brief Set an application-defined assertion handler.
fn SDL_SetAssertionHandler(handler: SDL_AssertionHandler, userdata: void*);
//! \brief Get a list of all assertion failures.
fn SDL_GetAssertionReport() SDL_assert_data*;
//! \brief Reset the list of all assertion failures.
fn SDL_ResetAssertionReport();

lib.sdl2._version

module lib.sdl2._version;


enum SDL_MAJOR_VERSION;
enum SDL_MINOR_VERSION;
enum SDL_PATCHLEVEL;

struct SDL_version
{
public:
	//! major version *
	major: Uint8;
	//! minor version *
	minor: Uint8;
	//! update version *
	patch: Uint8;
}

//! \brief Get the version of SDL that is linked against your program.
fn SDL_GetVersion(ver: SDL_version*);
//! \brief Get the code revision of SDL that is linked against your
//! program.
fn SDL_GetRevision() char*;
//! \brief Get the revision number of SDL that is linked against your
//! program.
fn SDL_GetRevisionNumber() i32;

lib.sdl2

module lib.sdl2;

public import lib.sdl2._assert;
public import lib.sdl2.audio;
public import lib.sdl2.blendmode;
public import lib.sdl2.clipboard;
public import lib.sdl2.cpuinfo;
public import lib.sdl2.error;
public import lib.sdl2.events;
public import lib.sdl2.filesystem;
public import lib.sdl2.gamecontroller;
public import lib.sdl2.gesture;
public import lib.sdl2.haptic;
public import lib.sdl2.hints;
public import lib.sdl2.joystick;
public import lib.sdl2.keyboard;
public import lib.sdl2.keycode;
public import lib.sdl2.loadso;
public import lib.sdl2.log;
public import lib.sdl2.messagebox;
public import lib.sdl2.mouse;
public import lib.sdl2.mutex;
public import lib.sdl2.pixels;
public import lib.sdl2.platform;
public import lib.sdl2.power;
public import lib.sdl2.quit;
public import lib.sdl2.rect;
public import lib.sdl2.render;
public import lib.sdl2.rwops;
public import lib.sdl2.scancode;
public import lib.sdl2.shape;
public import lib.sdl2.stdinc;
public import lib.sdl2.surface;
public import lib.sdl2.thread;
public import lib.sdl2.timer;
public import lib.sdl2.touch;
public import lib.sdl2.video;


//! \name SDL_INIT_*
enum SDL_INIT_TIMER;
enum SDL_INIT_AUDIO;
enum SDL_INIT_VIDEO;
enum SDL_INIT_JOYSTICK;
enum SDL_INIT_HAPTIC;
enum SDL_INIT_GAMECONTROLLER;
enum SDL_INIT_EVENTS;
enum SDL_INIT_NOPARACHUTE;
enum SDL_INIT_EVERYTHING;

//! This function initializes the subsystems specified by \c flags Unless
//! the ::SDL_INIT_NOPARACHUTE flag is set, it will install cleanup signal
//! handlers for some commonly ignored fatal signals (like SIGSEGV).
fn SDL_Init(flags: Uint32) i32;
//! This function initializes specific SDL subsystems
fn SDL_InitSubSystem(flags: Uint32) i32;
//! This function cleans up specific SDL subsystems
fn SDL_QuitSubSystem(flags: Uint32);
//! This function returns a mask of the specified subsystems which have
//! previously been initialized.
fn SDL_WasInit(flags: Uint32) Uint32;
//! This function cleans up all initialized subsystems. You should call it
//! upon all exit conditions.
fn SDL_Quit();

lib.sdl2.clipboard

module lib.sdl2.clipboard;


//! \brief Put UTF-8 text into the clipboard
fn SDL_SetClipboardText(text: const(const(char)*)) i32;
//! \brief Get UTF-8 text from the clipboard, which must be freed with
//! SDL_free()
fn SDL_GetClipboardText() char*;
//! \brief Returns a flag indicating whether the clipboard exists and
//! contains a text string that is non-empty
fn SDL_HasClipboardText() SDL_bool;

lib.sdl2.mouse

module lib.sdl2.mouse;


enum SDL_SYSTEM_CURSOR_ARROW;
enum SDL_SYSTEM_CURSOR_IBEAM;
enum SDL_SYSTEM_CURSOR_WAIT;
enum SDL_SYSTEM_CURSOR_CROSSHAIR;
enum SDL_SYSTEM_CURSOR_WAITARROW;
enum SDL_SYSTEM_CURSOR_SIZENWSE;
enum SDL_SYSTEM_CURSOR_SIZENESW;
enum SDL_SYSTEM_CURSOR_SIZEWE;
enum SDL_SYSTEM_CURSOR_SIZENS;
enum SDL_SYSTEM_CURSOR_SIZEALL;
enum SDL_SYSTEM_CURSOR_NO;
enum SDL_SYSTEM_CURSOR_HAND;
enum SDL_NUM_SYSTEM_CURSORS;
//! Used as a mask when testing buttons in buttonstate.
enum SDL_BUTTON_LEFT;
enum SDL_BUTTON_MIDDLE;
enum SDL_BUTTON_RIGHT;
enum SDL_BUTTON_X1;
enum SDL_BUTTON_X2;
enum SDL_BUTTON_LMASK;
enum SDL_BUTTON_MMASK;
enum SDL_BUTTON_RMASK;
enum SDL_BUTTON_X1MASK;
enum SDL_BUTTON_X2MASK;

//! \brief Cursor types for SDL_CreateSystemCursor.
alias SDL_SystemCursor = i32;

struct SDL_Cursor
{
}

//! \brief Get the window which currently has mouse focus.
fn SDL_GetMouseFocus() SDL_Window*;
//! \brief Retrieve the current state of the mouse.
fn SDL_GetMouseState(x: i32*, y: i32*) Uint32;
//! \brief Retrieve the relative state of the mouse.
fn SDL_GetRelativeMouseState(x: i32*, y: i32*) Uint32;
//! \brief Moves the mouse to the given position within the window.
fn SDL_WarpMouseInWindow(window: SDL_Window*, x: i32, y: i32);
//! \brief Set relative mouse mode.
fn SDL_SetRelativeMouseMode(enabled: SDL_bool) i32;
//! \brief Query whether relative mouse mode is enabled.
fn SDL_GetRelativeMouseMode() SDL_bool;
//! \brief Create a cursor, using the specified bitmap data and mask (in
//! MSB format).
fn SDL_CreateCursor(data: const(const(Uint8)*), mask: const(const(Uint8)*), w: i32, h: i32, hot_x: i32, hot_y: i32) SDL_Cursor*;
//! \brief Create a color cursor.
fn SDL_CreateColorCursor(surface: SDL_Surface*, hot_x: i32, hot_y: i32) SDL_Cursor*;
//! \brief Create a system cursor.
fn SDL_CreateSystemCursor(id: SDL_SystemCursor) SDL_Cursor*;
//! \brief Set the active cursor.
fn SDL_SetCursor(cursor: SDL_Cursor*);
//! \brief Return the active cursor.
fn SDL_GetCursor() SDL_Cursor*;
//! \brief Return the default cursor.
fn SDL_GetDefaultCursor() SDL_Cursor*;
//! \brief Frees a cursor created with SDL_CreateCursor().
fn SDL_FreeCursor(cursor: SDL_Cursor*);
//! \brief Toggle whether or not the cursor is shown.
fn SDL_ShowCursor(toggle: i32) i32;

lib.sdl2.log

module lib.sdl2.log;


//! \brief The maximum size of a log message
enum SDL_MAX_LOG_MESSAGE;
//! \brief The predefined log categories
enum SDL_LOG_CATEGORY_APPLICATION;
enum SDL_LOG_CATEGORY_ERROR;
enum SDL_LOG_CATEGORY_ASSERT;
enum SDL_LOG_CATEGORY_SYSTEM;
enum SDL_LOG_CATEGORY_AUDIO;
enum SDL_LOG_CATEGORY_VIDEO;
enum SDL_LOG_CATEGORY_RENDER;
enum SDL_LOG_CATEGORY_INPUT;
enum SDL_LOG_CATEGORY_TEST;
enum SDL_LOG_CATEGORY_RESERVED1;
enum SDL_LOG_CATEGORY_RESERVED2;
enum SDL_LOG_CATEGORY_RESERVED3;
enum SDL_LOG_CATEGORY_RESERVED4;
enum SDL_LOG_CATEGORY_RESERVED5;
enum SDL_LOG_CATEGORY_RESERVED6;
enum SDL_LOG_CATEGORY_RESERVED7;
enum SDL_LOG_CATEGORY_RESERVED8;
enum SDL_LOG_CATEGORY_RESERVED9;
enum SDL_LOG_CATEGORY_RESERVED10;
enum SDL_LOG_CATEGORY_CUSTOM;
enum SDL_LOG_PRIORITY_VERBOSE;
enum SDL_LOG_PRIORITY_DEBUG;
enum SDL_LOG_PRIORITY_INFO;
enum SDL_LOG_PRIORITY_WARN;
enum SDL_LOG_PRIORITY_ERROR;
enum SDL_LOG_PRIORITY_CRITICAL;
enum SDL_NUM_LOG_PRIORITIES;

//! \brief The predefined log priorities
alias SDL_LogPriority = i32;
//! \brief The prototype for the log output function
alias SDL_LogOutputFunction = fn (void*, i32, SDL_LogPriority, const(char)*) (void);

//! \brief Set the priority of all log categories
fn SDL_LogSetAllPriority(priority: SDL_LogPriority);
//! \brief Set the priority of a particular log category
fn SDL_LogSetPriority(category: i32, priority: SDL_LogPriority);
//! \brief Get the priority of a particular log category
fn SDL_LogGetPriority(category: i32) SDL_LogPriority;
//! \brief Reset all priorities to default.
fn SDL_LogResetPriorities();
//! \brief Log a message with SDL_LOG_CATEGORY_APPLICATION and
//! SDL_LOG_PRIORITY_INFO
fn SDL_Log(fmt: const(const(char)*));
//! \brief Log a message with SDL_LOG_PRIORITY_VERBOSE
fn SDL_LogVerbose(category: i32, fmt: const(const(char)*));
//! \brief Log a message with SDL_LOG_PRIORITY_DEBUG
fn SDL_LogDebug(category: i32, fmt: const(const(char)*));
//! \brief Log a message with SDL_LOG_PRIORITY_INFO
fn SDL_LogInfo(category: i32, fmt: const(const(char)*));
//! \brief Log a message with SDL_LOG_PRIORITY_WARN
fn SDL_LogWarn(category: i32, fmt: const(const(char)*));
//! \brief Log a message with SDL_LOG_PRIORITY_ERROR
fn SDL_LogError(category: i32, fmt: const(const(char)*));
//! \brief Log a message with SDL_LOG_PRIORITY_CRITICAL
fn SDL_LogCritical(category: i32, fmt: const(const(char)*));
//! \brief Log a message with the specified category and priority.
fn SDL_LogMessage(category: i32, priority: SDL_LogPriority, fmt: const(const(char)*));
//! \brief Log a message with the specified category and priority.
fn SDL_LogMessageV(category: i32, priority: SDL_LogPriority, fmt: const(const(char)*), ap: va_list);
//! \brief Get the current log output function.
fn SDL_LogGetOutputFunction(callback: SDL_LogOutputFunction*, userdata: void**);
//! \brief This function allows you to replace the default log output
//! function with one of your own.
fn SDL_LogSetOutputFunction(callback: SDL_LogOutputFunction, userdata: void*);

lib.sdl2.hints

module lib.sdl2.hints;


//! \brief A variable controlling how 3D acceleration is used to
//! accelerate the SDL screen surface.
enum SDL_HINT_FRAMEBUFFER_ACCELERATION;
//! \brief A variable specifying which render driver to use.
enum SDL_HINT_RENDER_DRIVER;
//! \brief A variable controlling whether the OpenGL render driver uses
//! shaders if they are available.
enum SDL_HINT_RENDER_OPENGL_SHADERS;
//! \brief A variable controlling the scaling quality
enum SDL_HINT_RENDER_SCALE_QUALITY;
//! \brief A variable controlling whether updates to the SDL screen
//! surface should be synchronized with the vertical refresh, to avoid
//! tearing.
enum SDL_HINT_RENDER_VSYNC;
//! \brief A variable controlling whether the X11 VidMode extension should
//! be used.
enum SDL_HINT_VIDEO_X11_XVIDMODE;
//! \brief A variable controlling whether the X11 Xinerama extension
//! should be used.
enum SDL_HINT_VIDEO_X11_XINERAMA;
//! \brief A variable controlling whether the X11 XRandR extension should
//! be used.
enum SDL_HINT_VIDEO_X11_XRANDR;
//! \brief A variable controlling whether grabbing input grabs the
//! keyboard
enum SDL_HINT_GRAB_KEYBOARD;
//! \brief Minimize your SDL_Window if it loses key focus when in
//! Fullscreen mode. Defaults to true.
enum SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS;
//! \brief A variable controlling whether the idle timer is disabled on
//! iOS.
enum SDL_HINT_IDLE_TIMER_DISABLED;
//! \brief A variable controlling which orientations are allowed on iOS.
enum SDL_HINT_ORIENTATIONS;
//! \brief A variable that lets you disable the detection and use of
//! Xinput gamepad devices
enum SDL_HINT_XINPUT_ENABLED;
//! \brief A variable that lets you manually hint extra gamecontroller db
//! entries
enum SDL_HINT_GAMECONTROLLERCONFIG;
//! \brief A variable that lets you enable joystick (and gamecontroller)
//! events even when your app is in the background.
enum SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS;
//! \brief If set to 0 then never set the top most bit on a SDL Window,
//! even if the video mode expects it. This is a debugging aid for
//! developers and not expected to be used by end users. The default is
//! "1"
enum SDL_HINT_ALLOW_TOPMOST;
enum SDL_HINT_DEFAULT;
enum SDL_HINT_NORMAL;
enum SDL_HINT_OVERRIDE;

//! \brief An enumeration of hint priorities
alias SDL_HintPriority = i32;

//! \brief Set a hint with a specific priority
fn SDL_SetHintWithPriority(name: const(const(char)*), value: const(const(char)*), priority: SDL_HintPriority) SDL_bool;
//! \brief Set a hint with normal priority
fn SDL_SetHint(name: const(const(char)*), value: const(const(char)*)) SDL_bool;
//! \brief Get a hint
fn SDL_GetHint(name: const(const(char)*)) char*;
//! \brief Get a hint
fn SDL_GetHintBoolean(name: const(const(char)*), default_value: SDL_bool) SDL_bool;
//! \brief Clear all hints
fn SDL_ClearHints();

lib.sdl2.filesystem

module lib.sdl2.filesystem;


//! \brief Get the path where the application resides.
fn SDL_GetBasePath() char*;
//! \brief Get the user-and-app-specific path where files can be written.
fn SDL_GetPrefPath(org: const(const(char)*), app: const(const(char)*)) char*;

lib.sdl2.timer

module lib.sdl2.timer;


//! Function prototype for the timer callback function.
alias SDL_TimerCallback = fn (Uint32, void*) (Uint32);
//! Definition of the timer ID type.
alias SDL_TimerID = i32;

//! \brief Get the number of milliseconds since the SDL library
//! initialization.
fn SDL_GetTicks() Uint32;
//! \brief Get the current value of the high resolution counter
fn SDL_GetPerformanceCounter() Uint64;
//! \brief Get the count per second of the high resolution counter
fn SDL_GetPerformanceFrequency() Uint64;
//! \brief Wait a specified number of milliseconds before returning.
fn SDL_Delay(ms: Uint32);
//! \brief Add a new timer to the pool of timers already running.
fn SDL_AddTimer(interval: Uint32, callback: SDL_TimerCallback, param: void*) SDL_TimerID;
//! \brief Remove a timer knowing its ID.
fn SDL_RemoveTimer(id: SDL_TimerID) SDL_bool;

lib.sdl2.cpuinfo

module lib.sdl2.cpuinfo;


enum SDL_CACHELINE_SIZE;

//! This function returns the number of CPU cores available.
fn SDL_GetCPUCount() i32;
//! This function returns the L1 cache line size of the CPU
fn SDL_GetCPUCacheLineSize() i32;
//! This function returns true if the CPU has the RDTSC instruction.
fn SDL_HasRDTSC() SDL_bool;
//! This function returns true if the CPU has AltiVec features.
fn SDL_HasAltiVec() SDL_bool;
//! This function returns true if the CPU has MMX features.
fn SDL_HasMMX() SDL_bool;
//! This function returns true if the CPU has 3DNow! features.
fn SDL_Has3DNow() SDL_bool;
//! This function returns true if the CPU has SSE features.
fn SDL_HasSSE() SDL_bool;
//! This function returns true if the CPU has SSE2 features.
fn SDL_HasSSE2() SDL_bool;
//! This function returns true if the CPU has SSE3 features.
fn SDL_HasSSE3() SDL_bool;
//! This function returns true if the CPU has SSE4.1 features.
fn SDL_HasSSE41() SDL_bool;
//! This function returns true if the CPU has SSE4.2 features.
fn SDL_HasSSE42() SDL_bool;

lib.sdl2.keyboard

module lib.sdl2.keyboard;


//! \brief The SDL keysym structure, used in key events.
struct SDL_Keysym
{
public:
	scancode: SDL_Scancode;
	sym: SDL_Keycode;
	mod: Uint16;
	unused: Uint32;
}

//! \brief Get the window which currently has keyboard focus.
fn SDL_GetKeyboardFocus() SDL_Window*;
//! \brief Get a snapshot of the current state of the keyboard.
fn SDL_GetKeyboardState(numkeys: i32*) Uint8*;
//! \brief Get the current key modifier state for the keyboard.
fn SDL_GetModState() SDL_Keymod;
//! \brief Set the current key modifier state for the keyboard.
fn SDL_SetModState(modstate: SDL_Keymod);
//! \brief Get the key code corresponding to the given scancode according
//! to the current keyboard layout.
fn SDL_GetKeyFromScancode(scancode: SDL_Scancode) SDL_Keycode;
//! \brief Get the scancode corresponding to the given key code according
//! to the current keyboard layout.
fn SDL_GetScancodeFromKey(key: SDL_Keycode) SDL_Scancode;
//! \brief Get a human-readable name for a scancode.
fn SDL_GetScancodeName(scancode: SDL_Scancode) char*;
//! \brief Get a scancode from a human-readable name
fn SDL_GetScancodeFromName(name: const(const(char)*)) SDL_Scancode;
//! \brief Get a human-readable name for a key.
fn SDL_GetKeyName(key: SDL_Keycode) char*;
//! \brief Get a key code from a human-readable name
fn SDL_GetKeyFromName(name: const(const(char)*)) SDL_Keycode;
//! \brief Start accepting Unicode text input events. This function will
//! show the on-screen keyboard if supported.
fn SDL_StartTextInput();
//! \brief Return whether or not Unicode text input events are enabled.
fn SDL_IsTextInputActive() SDL_bool;
//! \brief Stop receiving any text input events. This function will hide
//! the on-screen keyboard if supported.
fn SDL_StopTextInput();
//! \brief Set the rectangle used to type Unicode text inputs. This is used
//! as a hint for IME and on-screen keyboard placement.
fn SDL_SetTextInputRect(rect: SDL_Rect*);
//! \brief Returns whether the platform has some screen keyboard support.
fn SDL_HasScreenKeyboardSupport() SDL_bool;
//! \brief Returns whether the screen keyboard is shown for given window.
fn SDL_IsScreenKeyboardShown(window: SDL_Window*) SDL_bool;

lib.sdl2.blendmode

module lib.sdl2.blendmode;


enum SDL_BLENDMODE_NONE;
enum SDL_BLENDMODE_BLEND;
enum SDL_BLENDMODE_ADD;
enum SDL_BLENDMODE_MOD;

//! \file SDL_blendmode.h
alias SDL_BlendMode = i32;

lib.sdl2.rwops

module lib.sdl2.rwops;


enum SDL_RWOPS_UNKNOWN;
enum SDL_RWOPS_WINFILE;
enum SDL_RWOPS_STDFILE;
enum SDL_RWOPS_JNIFILE;
enum SDL_RWOPS_MEMORY;
enum SDL_RWOPS_MEMORY_RO;
//! Seek from the beginning of data *
enum RW_SEEK_SET;
//! Seek relative to current read point *
enum RW_SEEK_CUR;
//! Seek relative to the end of data *
enum RW_SEEK_END;

//! This is the read/write operation structure -- very basic.
struct SDL_RWops
{
public:
	size: fn (SDL_RWops*) (Sint64);
	seek: fn (SDL_RWops*, Sint64, i32) (Sint64);
	read: fn (SDL_RWops*, void*, size_t, size_t) (size_t);
	write: fn (SDL_RWops*, const(void)*, size_t, size_t) (size_t);
	close: fn (SDL_RWops*) (i32);
	type: Uint32;
	a: void*;
	b: void*;
	c: void*;
}

//! \name RWFrom functions
fn SDL_RWFromFile(file: const(const(char)*), mode: const(const(char)*)) SDL_RWops*;
fn SDL_RWFromFP(fp: FILE*, autoclose: SDL_bool) SDL_RWops*;
fn SDL_RWFromMem(mem: void*, size: i32) SDL_RWops*;
fn SDL_RWFromConstMem(mem: const(const(void)*), size: i32) SDL_RWops*;
fn SDL_AllocRW() SDL_RWops*;
fn SDL_FreeRW(area: SDL_RWops*);
//! \name Read/write macros
fn SDL_ReadU8(src: SDL_RWops*) Uint8;
fn SDL_ReadLE16(src: SDL_RWops*) Uint16;
fn SDL_ReadBE16(src: SDL_RWops*) Uint16;
fn SDL_ReadLE32(src: SDL_RWops*) Uint32;
fn SDL_ReadBE32(src: SDL_RWops*) Uint32;
fn SDL_ReadLE64(src: SDL_RWops*) Uint64;
fn SDL_ReadBE64(src: SDL_RWops*) Uint64;
//! \name Write endian functions
fn SDL_WriteU8(dst: SDL_RWops*, value: Uint8) size_t;
fn SDL_WriteLE16(dst: SDL_RWops*, value: Uint16) size_t;
fn SDL_WriteBE16(dst: SDL_RWops*, value: Uint16) size_t;
fn SDL_WriteLE32(dst: SDL_RWops*, value: Uint32) size_t;
fn SDL_WriteBE32(dst: SDL_RWops*, value: Uint32) size_t;
fn SDL_WriteLE64(dst: SDL_RWops*, value: Uint64) size_t;
fn SDL_WriteBE64(dst: SDL_RWops*, value: Uint64) size_t;

lib.sdl2.joystick

//! \file SDL_joystick.h
module lib.sdl2.joystick;


//! \name Hat positions
enum SDL_HAT_CENTERED;
enum SDL_HAT_UP;
enum SDL_HAT_RIGHT;
enum SDL_HAT_DOWN;
enum SDL_HAT_LEFT;
enum SDL_HAT_RIGHTUP;
enum SDL_HAT_RIGHTDOWN;
enum SDL_HAT_LEFTUP;
enum SDL_HAT_LEFTDOWN;

alias SDL_Joystick = _SDL_Joystick;
alias SDL_JoystickID = Sint32;

//! \file SDL_joystick.h
struct _SDL_Joystick
{
}

struct SDL_JoystickGUID
{
public:
	data: Uint8[16];
}

//! Count the number of joysticks attached to the system right now
fn SDL_NumJoysticks() i32;
//! Get the implementation dependent name of a joystick. This can be called
//! before any joysticks are opened. If no name can be found, this function
//! returns NULL.
fn SDL_JoystickNameForIndex(device_index: i32) char*;
//! Open a joystick for use. The index passed as an argument refers tothe
//! N'th joystick on the system. This index is the value which will
//! identify this joystick in future joystick events.
fn SDL_JoystickOpen(device_index: i32) SDL_Joystick*;
//! Return the name for this currently opened joystick. If no name can be
//! found, this function returns NULL.
fn SDL_JoystickName(joystick: SDL_Joystick*) char*;
//! Return the GUID for the joystick at this index
fn SDL_JoystickGetDeviceGUID(device_index: i32) SDL_JoystickGUID;
//! Return the GUID for this opened joystick
fn SDL_JoystickGetGUID(joystick: SDL_Joystick*) SDL_JoystickGUID;
//! Return a string representation for this guid. pszGUID must point to at
//! least 33 bytes (32 for the string plus a NULL terminator).
fn SDL_JoystickGetGUIDString(guid: SDL_JoystickGUID, pszGUID: char*, cbGUID: i32);
//! convert a string into a joystick formatted guid
fn SDL_JoystickGetGUIDFromString(pchGUID: const(const(char)*)) SDL_JoystickGUID;
//! Returns SDL_TRUE if the joystick has been opened and currently
//! connected, or SDL_FALSE if it has not.
fn SDL_JoystickGetAttached(joystick: SDL_Joystick*) SDL_bool;
//! Get the instance ID of an opened joystick or -1 if the joystick is
//! invalid.
fn SDL_JoystickInstanceID(joystick: SDL_Joystick*) SDL_JoystickID;
//! Get the number of general axis controls on a joystick.
fn SDL_JoystickNumAxes(joystick: SDL_Joystick*) i32;
//! Get the number of trackballs on a joystick.
fn SDL_JoystickNumBalls(joystick: SDL_Joystick*) i32;
//! Get the number of POV hats on a joystick.
fn SDL_JoystickNumHats(joystick: SDL_Joystick*) i32;
//! Get the number of buttons on a joystick.
fn SDL_JoystickNumButtons(joystick: SDL_Joystick*) i32;
//! Update the current state of the open joysticks.
fn SDL_JoystickUpdate();
//! Enable/disable joystick event polling.
fn SDL_JoystickEventState(state: i32) i32;
//! Get the current state of an axis control on a joystick.
fn SDL_JoystickGetAxis(joystick: SDL_Joystick*, axis: i32) Sint16;
//! Get the current state of a POV hat on a joystick.
fn SDL_JoystickGetHat(joystick: SDL_Joystick*, hat: i32) Uint8;
//! Get the ball axis change since the last poll.
fn SDL_JoystickGetBall(joystick: SDL_Joystick*, ball: i32, dx: i32*, dy: i32*) i32;
//! Get the current state of a button on a joystick.
fn SDL_JoystickGetButton(joystick: SDL_Joystick*, button: i32) Uint8;
//! Close a joystick previously opened with SDL_JoystickOpen().
fn SDL_JoystickClose(joystick: SDL_Joystick*);

lib.sdl2.quit

module lib.sdl2.quit;


//! \file SDL_quit.h
fn SDL_QuitRequested() bool { }

lib.sdl2.events

module lib.sdl2.events;


enum SDL_RELEASED;
enum SDL_PRESSED;
enum SDL_FIRSTEVENT;
enum SDL_QUIT;
enum SDL_APP_TERMINATING;
enum SDL_APP_LOWMEMORY;
enum SDL_APP_WILLENTERBACKGROUND;
enum SDL_APP_DIDENTERBACKGROUND;
enum SDL_APP_WILLENTERFOREGROUND;
enum SDL_APP_DIDENTERFOREGROUND;
enum SDL_WINDOWEVENT;
enum SDL_SYSWMEVENT;
enum SDL_KEYDOWN;
enum SDL_KEYUP;
enum SDL_TEXTEDITING;
enum SDL_TEXTINPUT;
enum SDL_MOUSEMOTION;
enum SDL_MOUSEBUTTONDOWN;
enum SDL_MOUSEBUTTONUP;
enum SDL_MOUSEWHEEL;
enum SDL_JOYAXISMOTION;
enum SDL_JOYBALLMOTION;
enum SDL_JOYHATMOTION;
enum SDL_JOYBUTTONDOWN;
enum SDL_JOYBUTTONUP;
enum SDL_JOYDEVICEADDED;
enum SDL_JOYDEVICEREMOVED;
enum SDL_CONTROLLERAXISMOTION;
enum SDL_CONTROLLERBUTTONDOWN;
enum SDL_CONTROLLERBUTTONUP;
enum SDL_CONTROLLERDEVICEADDED;
enum SDL_CONTROLLERDEVICEREMOVED;
enum SDL_CONTROLLERDEVICEREMAPPED;
enum SDL_FINGERDOWN;
enum SDL_FINGERUP;
enum SDL_FINGERMOTION;
enum SDL_DOLLARGESTURE;
enum SDL_DOLLARRECORD;
enum SDL_MULTIGESTURE;
enum SDL_CLIPBOARDUPDATE;
enum SDL_DROPFILE;
enum SDL_DROPTEXT;
enum SDL_DROPBEGIN;
enum SDL_DROPCOMPLETE;
enum SDL_USEREVENT;
enum SDL_LASTEVENT;
enum SDL_TEXTEDITINGEVENT_TEXT_SIZE;
enum SDL_TEXTINPUTEVENT_TEXT_SIZE;
enum SDL_ADDEVENT;
enum SDL_PEEKEVENT;
enum SDL_GETEVENT;
enum SDL_QUERY;
enum SDL_IGNORE;
enum SDL_DISABLE;
enum SDL_ENABLE;

//! \brief The types of events that can be delivered.
alias SDL_EventType = u32;
alias SDL_eventaction = i32;
alias SDL_EventFilter = fn (void*, SDL_Event*) (i32);

//! \brief Fields shared by every event
struct SDL_CommonEvent
{
public:
	type: Uint32;
	timestamp: Uint32;
}

//! \brief Window state change event data (event.window.*)
struct SDL_WindowEvent
{
public:
	type: Uint32;
	timestamp: Uint32;
	windowID: Uint32;
	event: Uint8;
	padding1: Uint8;
	padding2: Uint8;
	padding3: Uint8;
	data1: Sint32;
	data2: Sint32;
}

//! \brief Keyboard button event structure (event.key.*)
struct SDL_KeyboardEvent
{
public:
	type: Uint32;
	timestamp: Uint32;
	windowID: Uint32;
	state: Uint8;
	repeat: Uint8;
	padding2: Uint8;
	padding3: Uint8;
	keysym: SDL_Keysym;
}

//! \brief Keyboard text editing event structure (event.edit.*)
struct SDL_TextEditingEvent
{
public:
	type: Uint32;
	timestamp: Uint32;
	windowID: Uint32;
	text: char[32];
	start: Sint32;
	length: Sint32;
}

//! \brief Keyboard text input event structure (event.text.*)
struct SDL_TextInputEvent
{
public:
	type: Uint32;
	timestamp: Uint32;
	windowID: Uint32;
	text: char[32];
}

//! \brief Mouse motion event structure (event.motion.*)
struct SDL_MouseMotionEvent
{
public:
	type: Uint32;
	timestamp: Uint32;
	windowID: Uint32;
	which: Uint32;
	state: Uint32;
	x: Sint32;
	y: Sint32;
	xrel: Sint32;
	yrel: Sint32;
}

//! \brief Mouse button event structure (event.button.*)
struct SDL_MouseButtonEvent
{
public:
	type: Uint32;
	timestamp: Uint32;
	windowID: Uint32;
	which: Uint32;
	button: Uint8;
	state: Uint8;
	padding1: Uint8;
	padding2: Uint8;
	x: Sint32;
	y: Sint32;
}

//! \brief Mouse wheel event structure (event.wheel.*)
struct SDL_MouseWheelEvent
{
public:
	type: Uint32;
	timestamp: Uint32;
	windowID: Uint32;
	which: Uint32;
	x: Sint32;
	y: Sint32;
}

//! \brief Joystick axis motion event structure (event.jaxis.*)
struct SDL_JoyAxisEvent
{
public:
	type: Uint32;
	timestamp: Uint32;
	which: SDL_JoystickID;
	axis: Uint8;
	padding1: Uint8;
	padding2: Uint8;
	padding3: Uint8;
	value: Sint16;
	padding4: Uint16;
}

//! \brief Joystick trackball motion event structure (event.jball.*)
struct SDL_JoyBallEvent
{
public:
	type: Uint32;
	timestamp: Uint32;
	which: SDL_JoystickID;
	ball: Uint8;
	padding1: Uint8;
	padding2: Uint8;
	padding3: Uint8;
	xrel: Sint16;
	yrel: Sint16;
}

//! \brief Joystick hat position change event structure (event.jhat.*)
struct SDL_JoyHatEvent
{
public:
	type: Uint32;
	timestamp: Uint32;
	which: SDL_JoystickID;
	hat: Uint8;
	value: Uint8;
	padding1: Uint8;
	padding2: Uint8;
}

//! \brief Joystick button event structure (event.jbutton.*)
struct SDL_JoyButtonEvent
{
public:
	type: Uint32;
	timestamp: Uint32;
	which: SDL_JoystickID;
	button: Uint8;
	state: Uint8;
	padding1: Uint8;
	padding2: Uint8;
}

//! \brief Joystick device event structure (event.jdevice.*)
struct SDL_JoyDeviceEvent
{
public:
	type: Uint32;
	timestamp: Uint32;
	which: Sint32;
}

//! \brief Game controller axis motion event structure (event.caxis.*)
struct SDL_ControllerAxisEvent
{
public:
	type: Uint32;
	timestamp: Uint32;
	which: SDL_JoystickID;
	axis: Uint8;
	padding1: Uint8;
	padding2: Uint8;
	padding3: Uint8;
	value: Sint16;
	padding4: Uint16;
}

//! \brief Game controller button event structure (event.cbutton.*)
struct SDL_ControllerButtonEvent
{
public:
	type: Uint32;
	timestamp: Uint32;
	which: SDL_JoystickID;
	button: Uint8;
	state: Uint8;
	padding1: Uint8;
	padding2: Uint8;
}

//! \brief Controller device event structure (event.cdevice.*)
struct SDL_ControllerDeviceEvent
{
public:
	type: Uint32;
	timestamp: Uint32;
	which: Sint32;
}

//! \brief Touch finger event structure (event.tfinger.*)
struct SDL_TouchFingerEvent
{
public:
	type: Uint32;
	timestamp: Uint32;
	touchId: SDL_TouchID;
	fingerId: SDL_FingerID;
	x: f32;
	y: f32;
	dx: f32;
	dy: f32;
	pressure: f32;
}

//! \brief Multiple Finger Gesture Event (event.mgesture.*)
struct SDL_MultiGestureEvent
{
public:
	type: Uint32;
	timestamp: Uint32;
	touchId: SDL_TouchID;
	dTheta: f32;
	dDist: f32;
	x: f32;
	y: f32;
	numFingers: Uint16;
	padding: Uint16;
}

//! \brief Dollar Gesture Event (event.dgesture.*)
struct SDL_DollarGestureEvent
{
public:
	type: Uint32;
	timestamp: Uint32;
	touchId: SDL_TouchID;
	gestureId: SDL_GestureID;
	numFingers: Uint32;
	error: f32;
	x: f32;
	y: f32;
}

//! \brief An event used to request a file open by the system (event.drop.
//! *) This event is disabled by default, you can enable it with
//! SDL_EventState() \note If you enable this event, you must free the
//! filename in the event.
struct SDL_DropEvent
{
public:
	type: Uint32;
	timestamp: Uint32;
	file: char*;
	windowID: Uint32;
}

//! \brief The "quit requested" event
struct SDL_QuitEvent
{
public:
	type: Uint32;
	timestamp: Uint32;
}

//! \brief OS Specific event
struct SDL_OSEvent
{
public:
	type: Uint32;
	timestamp: Uint32;
}

//! \brief A user-defined event type (event.user.*)
struct SDL_UserEvent
{
public:
	type: Uint32;
	timestamp: Uint32;
	windowID: Uint32;
	code: Sint32;
	data1: void*;
	data2: void*;
}

struct SDL_SysWMmsg
{
}

//! \brief A video driver dependent system event (event.syswm.*) This event
//! is disabled by default, you can enable it with SDL_EventState()
struct SDL_SysWMEvent
{
public:
	type: Uint32;
	timestamp: Uint32;
	msg: SDL_SysWMmsg*;
}

//! \brief General event structure
union SDL_Event
{
public:
	type: Uint32;
	common: SDL_CommonEvent;
	window: SDL_WindowEvent;
	key: SDL_KeyboardEvent;
	edit: SDL_TextEditingEvent;
	text: SDL_TextInputEvent;
	motion: SDL_MouseMotionEvent;
	button: SDL_MouseButtonEvent;
	wheel: SDL_MouseWheelEvent;
	jaxis: SDL_JoyAxisEvent;
	jball: SDL_JoyBallEvent;
	jhat: SDL_JoyHatEvent;
	jbutton: SDL_JoyButtonEvent;
	jdevice: SDL_JoyDeviceEvent;
	caxis: SDL_ControllerAxisEvent;
	cbutton: SDL_ControllerButtonEvent;
	cdevice: SDL_ControllerDeviceEvent;
	quit: SDL_QuitEvent;
	user: SDL_UserEvent;
	syswm: SDL_SysWMEvent;
	tfinger: SDL_TouchFingerEvent;
	mgesture: SDL_MultiGestureEvent;
	dgesture: SDL_DollarGestureEvent;
	drop: SDL_DropEvent;
	padding: Uint8[56];
}

//! Pumps the event loop, gathering events from the input devices.
fn SDL_PumpEvents();
//! Checks the event queue for messages and optionally returns them.
fn SDL_PeepEvents(events: SDL_Event*, numevents: i32, action: SDL_eventaction, minType: Uint32, maxType: Uint32) i32;
//! Checks to see if certain event types are in the event queue.
fn SDL_HasEvent(type: Uint32) SDL_bool;
fn SDL_HasEvents(minType: Uint32, maxType: Uint32) SDL_bool;
//! This function clears events from the event queue
fn SDL_FlushEvent(type: Uint32);
fn SDL_FlushEvents(minType: Uint32, maxType: Uint32);
//! \brief Polls for currently pending events.
fn SDL_PollEvent(event: SDL_Event*) i32;
//! \brief Waits indefinitely for the next available event.
fn SDL_WaitEvent(event: SDL_Event*) i32;
//! \brief Waits until the specified timeout (in milliseconds) for the
//! next available event.
fn SDL_WaitEventTimeout(event: SDL_Event*, timeout: i32) i32;
//! \brief Add an event to the event queue.
fn SDL_PushEvent(event: SDL_Event*) i32;
//! Sets up a filter to process all events before they change internal
//! state and are posted to the internal event queue.
fn SDL_SetEventFilter(filter: SDL_EventFilter, userdata: void*);
//! Return the current event filter - can be used to "chain" filters. If
//! there is no event filter set, this function returns SDL_FALSE.
fn SDL_GetEventFilter(filter: SDL_EventFilter*, userdata: void**) SDL_bool;
//! Add a function which is called when an event is added to the queue.
fn SDL_AddEventWatch(filter: SDL_EventFilter, userdata: void*);
//! Remove an event watch function added with SDL_AddEventWatch()
fn SDL_DelEventWatch(filter: SDL_EventFilter, userdata: void*);
//! Run the filter function on the current event queue, removing any events
//! for which the filter returns 0.
fn SDL_FilterEvents(filter: SDL_EventFilter, userdata: void*);
//! This function allows you to set the state of processing certain
//! events.
fn SDL_EventState(type: Uint32, state: i32) Uint8;
fn SDL_GetEventState(type: Uint32) Uint8 { }
//! This function allocates a set of user-defined events, and returns the
//! beginning event number for that set of events.
fn SDL_RegisterEvents(numevents: i32) Uint32;

lib.sdl2.gamecontroller

module lib.sdl2.gamecontroller;


enum SDL_CONTROLLER_BINDTYPE_NONE;
enum SDL_CONTROLLER_BINDTYPE_BUTTON;
enum SDL_CONTROLLER_BINDTYPE_AXIS;
enum SDL_CONTROLLER_BINDTYPE_HAT;
enum SDL_CONTROLLER_AXIS_INVALID;
enum SDL_CONTROLLER_AXIS_LEFTX;
enum SDL_CONTROLLER_AXIS_LEFTY;
enum SDL_CONTROLLER_AXIS_RIGHTX;
enum SDL_CONTROLLER_AXIS_RIGHTY;
enum SDL_CONTROLLER_AXIS_TRIGGERLEFT;
enum SDL_CONTROLLER_AXIS_TRIGGERRIGHT;
enum SDL_CONTROLLER_AXIS_MAX;
enum SDL_CONTROLLER_BUTTON_INVALID;
enum SDL_CONTROLLER_BUTTON_A;
enum SDL_CONTROLLER_BUTTON_B;
enum SDL_CONTROLLER_BUTTON_X;
enum SDL_CONTROLLER_BUTTON_Y;
enum SDL_CONTROLLER_BUTTON_BACK;
enum SDL_CONTROLLER_BUTTON_GUIDE;
enum SDL_CONTROLLER_BUTTON_START;
enum SDL_CONTROLLER_BUTTON_LEFTSTICK;
enum SDL_CONTROLLER_BUTTON_RIGHTSTICK;
enum SDL_CONTROLLER_BUTTON_LEFTSHOULDER;
enum SDL_CONTROLLER_BUTTON_RIGHTSHOULDER;
enum SDL_CONTROLLER_BUTTON_DPAD_UP;
enum SDL_CONTROLLER_BUTTON_DPAD_DOWN;
enum SDL_CONTROLLER_BUTTON_DPAD_LEFT;
enum SDL_CONTROLLER_BUTTON_DPAD_RIGHT;
enum SDL_CONTROLLER_BUTTON_MAX;

alias SDL_GameControllerBindType = i32;
//! The list of axes available from a controller
alias SDL_GameControllerAxis = i32;
//! The list of buttons available from a controller
alias SDL_GameControllerButton = i32;

//! \file SDL_gamecontroller.h
struct SDL_GameController
{
}

//! Get the SDL joystick layer binding for this controller button/axis
//! mapping
struct SDL_GameControllerButtonBind
{
public:
	union _value
	{
	public:
		struct _hat
		{
		public:
			hat: i32;
			hat_mask: i32;
		}


	public:
		button: i32;
		axis: i32;
		hat: _hat;
	}


public:
	bindType: SDL_GameControllerBindType;
	value: _value;
}

//! To count the number of game controllers in the system for the
//! following: int nJoysticks = SDL_NumJoysticks(); int nGameControllers =
//! 0; for ( int i = 0; i < nJoysticks; i++ ) { if ( SDL_IsGameController(i)
//! ) { nGameControllers++; } }
fn SDL_GameControllerAddMapping(mappingString: const(const(char)*)) i32;
//! Get a mapping string for a GUID
fn SDL_GameControllerMappingForGUID(guid: SDL_JoystickGUID) char*;
//! Get a mapping string for an open GameController
fn SDL_GameControllerMapping(gamecontroller: SDL_GameController*) char*;
//! Is the joystick on this index supported by the game controller
//! interface?
fn SDL_IsGameController(joystick_index: i32) SDL_bool;
//! Get the implementation dependent name of a game controller. This can be
//! called before any controllers are opened. If no name can be found, this
//! function returns NULL.
fn SDL_GameControllerNameForIndex(joystick_index: i32) char*;
//! Open a game controller for use. The index passed as an argument refers
//! to the N'th game controller on the system. This index is the value
//! which will identify this controller in future controller events.
fn SDL_GameControllerOpen(joystick_index: i32) SDL_GameController*;
//! Return the name for this currently opened controller
fn SDL_GameControllerName(gamecontroller: SDL_GameController*) char*;
//! Returns SDL_TRUE if the controller has been opened and currently
//! connected, or SDL_FALSE if it has not.
fn SDL_GameControllerGetAttached(gamecontroller: SDL_GameController*) SDL_bool;
//! Get the underlying joystick object used by a controller
fn SDL_GameControllerGetJoystick(gamecontroller: SDL_GameController*) SDL_Joystick*;
//! Enable/disable controller event polling.
fn SDL_GameControllerEventState(state: i32) i32;
//! Update the current state of the open game controllers.
fn SDL_GameControllerUpdate();
//! turn this string into a axis mapping
fn SDL_GameControllerGetAxisFromString(pchString: const(const(char)*)) SDL_GameControllerAxis;
//! turn this axis enum into a string mapping
fn SDL_GameControllerGetStringForAxis(axis: SDL_GameControllerAxis) char*;
//! Get the SDL joystick layer binding for this controller button mapping
fn SDL_GameControllerGetBindForAxis(gamecontroller: SDL_GameController*, axis: SDL_GameControllerAxis) SDL_GameControllerButtonBind;
//! Get the current state of an axis control on a game controller.
fn SDL_GameControllerGetAxis(gamecontroller: SDL_GameController*, axis: SDL_GameControllerAxis) Sint16;
//! turn this string into a button mapping
fn SDL_GameControllerGetButtonFromString(pchString: const(const(char)*)) SDL_GameControllerButton;
//! turn this button enum into a string mapping
fn SDL_GameControllerGetStringForButton(button: SDL_GameControllerButton) char*;
//! Get the SDL joystick layer binding for this controller button mapping
fn SDL_GameControllerGetBindForButton(gamecontroller: SDL_GameController*, button: SDL_GameControllerButton) SDL_GameControllerButtonBind;
//! Get the current state of a button on a game controller.
fn SDL_GameControllerGetButton(gamecontroller: SDL_GameController*, button: SDL_GameControllerButton) Uint8;
//! Close a controller previously opened with SDL_GameControllerOpen().
fn SDL_GameControllerClose(gamecontroller: SDL_GameController*);

lib.sdl2.loadso

module lib.sdl2.loadso;


//! This function dynamically loads a shared object and returns a pointer
//! to the object handle (or NULL if there was an error). The 'sofile'
//! parameter is a system dependent name of the object file.
fn SDL_LoadObject(sofile: const(const(char)*)) void*;
//! Given an object handle, this function looks up the address of the named
//! function in the shared object and returns it. This address is no longer
//! valid after calling SDL_UnloadObject().
fn SDL_LoadFunction(handle: void*, name: const(const(char)*)) void*;
//! Unload a shared object from memory.
fn SDL_UnloadObject(handle: void*);

lib.stb.image

//! Public interface to stb_image.h, implementation in stb_image.volt.
module lib.stb.image;


enum STBI_default;
enum STBI_grey;
enum STBI_grey_alpha;
enum STBI_rgb;
enum STBI_rgb_alpha;

alias stbi_uc = u8;

struct stbi_io_callbacks
{
public:
	read: fn (void*, stbi_uc*, i32) (i32);
	skip: fn (void*, i32) (void);
	oef: fn (void*) (i32);
}

fn stbi_info_from_memory(data: const(void)[], x: i32, y: i32, comp: i32) i32 { }
fn stbi_load_from_memory(data: const(void)[], x: i32, y: i32, comp: i32, req_comp: i32) stbi_uc* { }
fn stbi_failure_reason() const(char)*;
fn stbi_set_flip_vertically_on_load(flag_true_if_should_flip: i32);
fn stbi_info_from_memory(buffer: const(stbi_uc)*, len: i32, x: i32*, y: i32*, comp: i32*) i32;
fn stbi_info_from_callbacks(c: const(stbi_io_callbacks)*, user: void*, x: i32*, y: i32*, comp: i32*) i32;
fn stbi_load_from_memory(buffer: const(stbi_uc)*, len: i32, x: i32*, y: i32*, comp: i32*, req_comp: i32) stbi_uc*;
fn stbi_load_from_callbacks(clbk: const(stbi_io_callbacks)*, user: void*, x: i32*, y: i32*, comp: i32*, req_comp: i32) stbi_uc*;
fn stbi_image_free(retval_from_stbi_load: stbi_uc*);