d2d

Module for including all D2DGame components.

Modules

audio
module d2d.audio
core
module d2d.core
font
module d2d.font
rendering
module d2d.rendering
toolkit
module d2d.toolkit
window
module d2d.window

Members

Functions

rotate2d
mat4 rotate2d(mat4 mat, float alpha)

2D rotation on a mat4.

scale2d
mat4 scale2d(mat4 mat, float x, float y)

2D scale on a mat4.

translate2d
mat4 translate2d(mat4 mat, float x, float y)

2D translation on a mat4.

Variables

matrixStack
MatrixStack!mat4 matrixStack;

Matrix stack for modelview (like glPopMatrix, glPushMatrix).

projectionStack
MatrixStack!mat4 projectionStack;

Matrix stack for projection.

Examples

1 import D2D;
2 
3 void main()
4 {
5    Window window = new Window();
6 
7    Event event; // Or WindowEvent
8    while(window.open)
9    {
10        while (window.pollEvent(event))
11        {
12            if(event.type == Event.Type.Quit)
13                window.close();
14        }
15        window.clear();
16 
17        // Update & Render here
18 
19        window.display();
20    }
21 }

Meta