This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module dls.util.rect; | |
import std.string : format; | |
import dls.util.base : D2OnlyConstStr; | |
struct Rect(T) | |
{ | |
T x; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module test; | |
import std.stdio; | |
struct MyStructure | |
{ | |
int i; | |
int j; | |
int k; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum BoxCorner : ubyte | |
{ | |
None = 0x00; | |
TopLeft = 0x01; | |
Top = 0x02; | |
TopRight = 0x04; | |
Right = 0x08; | |
BottomRight = 0x10; | |
Bottom = 0x20; | |
BottomLeft = 0x40; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test.o: In function `_TMP0': | |
test.d:(.text._D4test11FooProvider3barMFiZv+0x14): undefined reference to `_D4test11FooProvider3fooMFZv' | |
/home/bernard/bin/apps/dmd2/linux/bin/../lib/libphobos2.a(dmain2_2d2_1a5.o): In function `_D2rt6dmain24mainUiPPaZi7runMainMFZv': | |
src/rt/dmain2.d:(.text._D2rt6dmain24mainUiPPaZi7runMainMFZv+0x10): undefined reference to `_Dmain' | |
/home/bernard/bin/apps/dmd2/linux/bin/../lib/libphobos2.a(deh2_2a9_525.o): In function `_D2rt4deh213__eh_finddataFPvZPS2rt4deh213DHandlerTable': | |
src/rt/deh2.d:(.text._D2rt4deh213__eh_finddataFPvZPS2rt4deh213DHandlerTable+0x4): undefined reference to `_deh_beg' | |
src/rt/deh2.d:(.text._D2rt4deh213__eh_finddataFPvZPS2rt4deh213DHandlerTable+0xc): undefined reference to `_deh_beg' | |
src/rt/deh2.d:(.text._D2rt4deh213__eh_finddataFPvZPS2rt4deh213DHandlerTable+0x13): undefined reference to `_deh_end' | |
src/rt/deh2.d:(.text._D2rt4deh213__eh_finddataFPvZPS2rt4deh213DHandlerTable+0x37): undefined reference to `_deh_end' | |
/home/bernard/bin/apps/dmd2/linux/bin/../lib/libpho |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GLuint makeShader(GLenum type, string filename) | |
{ | |
auto source = cast(char[]) std.file.read(filename); | |
int length = cast(int) source.length; // OH GOD | |
GLchar** sourceArray = new GLchar*; // WHY WOULD YOU EVEN, OH NO | |
*sourceArray = cast(char*) toStringz(source); // OH GOD, MAKE IT STOP | |
GLuint shader = glCreateShader(type); | |
glShaderSource(shader, 1, sourceArray, &length); | |
glCompileShader(shader); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module hellogl; | |
import std.stdio; | |
import std.string; | |
import std.file; | |
import std.math; | |
import std.c.stdlib; | |
import util; | |
import c.gl; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <GL/gl.h> | |
#include <GL/glut.h> | |
const GLfloat vertices[] = {-1.0f, -1.0f, 1.0f, -1.0f, -1.0f, 1.0f, 1.0f, 1.0f}; | |
GLuint vertexBuffer; | |
const GLuint elements[] = {0, 1, 2, 3}; | |
GLuint elementBuffer; | |
void render(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while (inGame) { | |
mPerformanceCounter.stop(); | |
mAccumulator += mPerformanceCounter.milliseconds(); | |
mPerformanceCounter.start(); | |
while (mAccumulator >= dt) { | |
tick(); | |
mAccumulator -= dt; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module test; | |
import std.stdio; | |
import unistd = core.sys.posix.unistd; | |
void main() | |
{ | |
int i = 10; | |
stdout.write("Launching in T minus "); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Four survivors have holed up in a bar with two stories, and a few | |
entrances. There are windows on the ground and first floors, allowing | |
an outlook onto the street. They have a fairly large stash of ammunition, | |
but they are ultimately doomed, as the zombies are infinite, unlike their | |
supplies. | |
The player controls one of the survivors. The gameplay is turned based, | |
and the action stops on the player and waits for them [1] to perform | |
their action. |