Skip to content

Commit

Permalink
Vertex
Browse files Browse the repository at this point in the history
  • Loading branch information
deadalnix committed Feb 12, 2012
1 parent 896dad9 commit d4c11c1
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/dsfml/graphics/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ set(SRC
${SRCROOT}/transform.d
${SRCROOT}/transformable.d
${SRCROOT}/Transformable.cpp
${SRCROOT}/vertex.d
${SRCROOT}/view.d
${SRCROOT}/View.cpp)

Expand Down
2 changes: 2 additions & 0 deletions src/dsfml/graphics/all.d
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ public import dsfml.graphics.renderwindow;
public import dsfml.graphics.texture;
public import dsfml.graphics.transform;
public import dsfml.graphics.transformable;
public import dsfml.graphics.view;
public import dsfml.graphics.vertex;

41 changes: 41 additions & 0 deletions src/dsfml/graphics/vertex.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
module dsfml.graphics.vertex;

import dsfml.graphics.color;

struct Vertex {
float[2] position;
Color color = white;
float[2] texCoords;

this(ref const float[2] position) {
this.position = position;
}

this(ref const float[2] position, ref const Color color) {
this.position = position;
this.color = color;
}

this(ref const float[2] position, ref const float[2] texCoords) {
this.position = position;
this.texCoords = texCoords;
}

this(ref const float[2] position, ref const Color color, ref const float[2] texCoords) {
this.position = position;
this.color = color;
this.texCoords = texCoords;
}
}

package extern(C++) {
struct sfVertex {
void[Vertex.sizeof] data = void;

@property
ref inout Vertex vertex() inout {
return *(cast(Vertex*) &this);
}
}
}

0 comments on commit d4c11c1

Please sign in to comment.