Skip to content
Permalink
Browse files

Added Blend

  • Loading branch information...
Dgame committed May 25, 2015
1 parent 83b2ce3 commit 624ffb4968db46060dc5a52bee8dae77cbe6b6dd
Showing with 43 additions and 2 deletions.
  1. +30 −0 source/Dgame/Graphic/Blend.d
  2. +1 −0 source/Dgame/Graphic/package.d
  3. +10 −0 source/Dgame/docs/Blend.html
  4. +2 −2 source/Dgame/test/.dub/dub.json
@@ -0,0 +1,30 @@
module Dgame.Graphic.Blend;

import derelict.opengl3.gl;

struct Blend {
static immutable Blend One = Blend(Factor.One, Factor.One);
static immutable Blend Zero = Blend(Factor.Zero, Factor.Zero);
static immutable Blend Default = Blend(Factor.SrcAlpha, Factor.OneMinusSrcAlpha);

enum Factor {
Zero = GL_ZERO,
One = GL_ONE,
SrcColor = GL_SRC_COLOR,
OneMinusSrcColor = GL_ONE_MINUS_SRC_COLOR,
DstColor = GL_DST_COLOR,
OneMinusDstColor = GL_ONE_MINUS_DST_COLOR,
SrcAlpha = GL_SRC_ALPHA,
OneMinusSrcAlpha = GL_ONE_MINUS_SRC_ALPHA,
DstAlpha = GL_DST_ALPHA,
OneMinusDstAlpha = GL_ONE_MINUS_DST_ALPHA
}

Factor srcColor = Factor.One;
Factor dstColor = Factor.Zero;

@nogc
void use() const nothrow {
glBlendFunc(this.srcColor, this.dstColor);
}
}
@@ -2,6 +2,7 @@ module Dgame.Graphic;

public:

import Dgame.Graphic.Blend;
import Dgame.Graphic.Color;
import Dgame.Graphic.Drawable;
import Dgame.Graphic.Shape;
@@ -0,0 +1,10 @@
<html><head>
<META http-equiv="content-type" content="text/html; charset=utf-8">
<title>Dgame.Graphic.Blend</title>
</head><body>
<h1>Dgame.Graphic.Blend</h1>
<!-- Generated by Ddoc from ..\Graphic\Blend.d -->
<br><br>

<hr><small>Page generated by <a href="http://dlang.org/ddoc.html">Ddoc</a>. </small>
</body></html>
@@ -1,10 +1,10 @@
{
"dub": {
"cachedUpgrades": {
"derelict-util": "1.9.1",
"derelict-util": "2.0.0",
"derelict-sdl2": "1.9.5",
"derelict-gl3": "1.0.12"
},
"lastUpgrade": "2015-05-20T20:00:54.365836"
"lastUpgrade": "2015-05-25T23:01:37.9147614"
}
}

0 comments on commit 624ffb4

Please sign in to comment.
You can’t perform that action at this time.