mirror of https://github.com/adamdruppe/arsd.git
fixes
This commit is contained in:
parent
5fa51b6574
commit
5a9106c6a0
|
@ -0,0 +1,91 @@
|
|||
DDOC_SECTION=<div>$0</div>
|
||||
DDOC_SECTION_H=<b>$0</b>
|
||||
DDOC_BLANKLINE=<p>
|
||||
DDOC_ANCHOR=<a id="$1" href="#$1" style="color: inherit; text-decoration: none;">⚓</a>
|
||||
D_INLINECODE=<tt>$0</tt>
|
||||
DDOC_DECL= $(DT $0)
|
||||
DDOC_DECL_DD= $(DD $0)
|
||||
DDOC_PARAMS=<table class="params"><caption>Parameters</caption>$0</table>
|
||||
DDOC_PARAM_ROW=<tr>$0</tr>
|
||||
DDOC_PARAM_ID=<th>$0</th>
|
||||
DDOC_PARAM=<span class="param-name">$0</span>
|
||||
DDOC_PSYMBOL=<span class="psymbol">$0</span>
|
||||
DDOC=<!DOCTYPE html><html><head>
|
||||
<meta charset="UTF-8" />
|
||||
<style>
|
||||
#body-container {
|
||||
max-width: 800px;
|
||||
}
|
||||
h3 {
|
||||
background-color: #e0e0e0;
|
||||
padding: 1em;
|
||||
}
|
||||
dt {
|
||||
background-color: #383838;
|
||||
padding: 0.5em;
|
||||
margin-bottom: 0.5em;
|
||||
color: white;
|
||||
}
|
||||
.tip, .note, .warning, .pitfall, .important {
|
||||
margin: 1em 3em;
|
||||
padding: 1em;
|
||||
border: solid 1px #ccc;
|
||||
}
|
||||
|
||||
.tip {
|
||||
background-color: #eeffee;
|
||||
}
|
||||
.note {
|
||||
background-color: #eeeeee;
|
||||
}
|
||||
.warning {
|
||||
background-color: #ffffee;
|
||||
}
|
||||
.pitfall {
|
||||
background-color: #eeeeff;
|
||||
}
|
||||
.important {
|
||||
background-color: #ffeeff;
|
||||
}
|
||||
dt .psymbol {
|
||||
font-weight: bold;
|
||||
}
|
||||
dt .psymbol ~ .psymbol {
|
||||
/* I'm not happy with it being bolded when a param name matches it too */
|
||||
font-weight: normal;
|
||||
}
|
||||
.params th, .params td {
|
||||
padding-bottom: 0.5em;
|
||||
}
|
||||
.params th {
|
||||
vertical-align: top;
|
||||
text-align: left;
|
||||
font-weight: normal;
|
||||
}
|
||||
.params caption {
|
||||
text-align: left;
|
||||
font-weight: bold;
|
||||
border-bottom: solid 1px #ccc;
|
||||
}
|
||||
.param-name {
|
||||
font-style: italic;
|
||||
}
|
||||
.params th .param-name {
|
||||
font-style: normal;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.params td .param-name {
|
||||
font-style: normal;
|
||||
}
|
||||
</style>
|
||||
<title>$(TITLE)</title>
|
||||
<meta name=viewport content="width=device-width, initial-scale=1" />
|
||||
</head><body>
|
||||
<div id="body-container">
|
||||
<h1>$(TITLE)</h1>
|
||||
$(BODY)
|
||||
</div>
|
||||
</body></html>
|
||||
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
// WORK IN PROGRESS
|
||||
|
||||
/**
|
||||
/++
|
||||
An add-on for simpledisplay.d, joystick.d, and simpleaudio.d
|
||||
that includes helper functions for writing games (and perhaps
|
||||
other multimedia programs).
|
||||
|
@ -57,9 +57,9 @@
|
|||
|
||||
The MyGame handler is actually a template, so you don't have virtual
|
||||
function indirection and not all functions are required. The interfaces
|
||||
are just to help you get the signatures right, they don't work at
|
||||
runtime.
|
||||
*/
|
||||
are just to help you get the signatures right, they don't force virtual
|
||||
dispatch at runtime.
|
||||
+/
|
||||
module arsd.gamehelpers;
|
||||
|
||||
public import arsd.color;
|
||||
|
@ -154,9 +154,11 @@ void runGame(T : GameHelperBase)(T game, int maxUpdateRate = 20, int maxRedrawRa
|
|||
);
|
||||
}
|
||||
|
||||
/// Simple class for putting a TrueColorImage in as an OpenGL texture.
|
||||
///
|
||||
/// Doesn't do mipmapping btw.
|
||||
/++
|
||||
Simple class for putting a TrueColorImage in as an OpenGL texture.
|
||||
|
||||
Doesn't do mipmapping btw.
|
||||
+/
|
||||
final class OpenGlTexture {
|
||||
private uint _tex;
|
||||
private int _width;
|
||||
|
@ -164,15 +166,17 @@ final class OpenGlTexture {
|
|||
private float _texCoordWidth;
|
||||
private float _texCoordHeight;
|
||||
|
||||
/// Calls glBindTexture
|
||||
void bind() {
|
||||
glBindTexture(GL_TEXTURE_2D, _tex);
|
||||
}
|
||||
|
||||
// For easy 2d drawing of it
|
||||
/// For easy 2d drawing of it
|
||||
void draw(Point where, int width = 0, int height = 0, float rotation = 0.0, Color bg = Color.white) {
|
||||
draw(where.x, where.y, width, height, rotation, bg);
|
||||
}
|
||||
|
||||
///
|
||||
void draw(float x, float y, int width = 0, int height = 0, float rotation = 0.0, Color bg = Color.white) {
|
||||
glPushMatrix();
|
||||
glTranslatef(x, y, 0);
|
||||
|
|
2754
simpledisplay.d
2754
simpledisplay.d
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue