Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
5777780
Add required libraries for travis to download
davidomarf Aug 15, 2018
c0d5f40
Set up CI
davidomarf Aug 15, 2018
11efd81
Remove all unittests and add one toy-test
davidomarf Aug 15, 2018
2ed1463
Add toy testing to check travis and local testing consistency
davidomarf Aug 15, 2018
59d8888
Delete may-problematic instructions in travis config file
davidomarf Aug 17, 2018
3fa2e8d
Begin testing framework for inner development of daque
davidomarf Aug 17, 2018
2a7a2f7
Begin testing with new framework
davidomarf Aug 17, 2018
08c8fd4
Separate terminal colors module
davidomarf Aug 17, 2018
223339a
Merge branch 'terminal' into ci
davidomarf Aug 17, 2018
8fce02d
Delete old testlib file in daque root
davidomarf Aug 17, 2018
d49ae5a
Change import clause for test module
davidomarf Aug 17, 2018
a0719a7
Change indentation from spaces to tabs
davidomarf Aug 17, 2018
734c7e4
Comment most recent code from utils
davidomarf Aug 17, 2018
8df4df7
Remove redundant import of std.stdio
davidomarf Aug 17, 2018
695322e
Create utils submodule
davidomarf Aug 17, 2018
72915d7
Add matrix uniform management
quevangel Aug 19, 2018
c125c9e
Add quaternion rotation matrix
quevangel Aug 19, 2018
a77701d
Remove cross product orthogonality test
quevangel Aug 19, 2018
2a4071e
Merge out cross conflict
quevangel Aug 19, 2018
15a603a
Fix quaternion rotation scaling
quevangel Aug 19, 2018
afb38a8
Add geometry:90 (magnitudeSquared) assertion failure message
quevangel Aug 19, 2018
eddb593
Fix imports
quevangel Aug 19, 2018
5165d45
Add is not nan assertions in geometry
quevangel Aug 19, 2018
a93d5ca
Add support for integer types in isNan array function
quevangel Aug 19, 2018
28d8b58
Fix imports
quevangel Aug 19, 2018
2c31812
Add isRotation method to Quaternion
quevangel Aug 20, 2018
dc7c52d
Add division operation on Quaternion
quevangel Aug 20, 2018
4fbfc75
Add column getter to matrix
quevangel Aug 22, 2018
a489626
Fix types and vector operations
quevangel Aug 22, 2018
1672113
Uncomment test
quevangel Aug 22, 2018
d2cf598
Immutable operations
quevangel Aug 23, 2018
dcb2806
Fix quaternion operations properties
quevangel Aug 23, 2018
f336766
Dot product support for const types
quevangel Aug 23, 2018
c346ec6
Fix compilation error in geometry. Remove qualifiers in result array
quevangel Aug 23, 2018
e8d6c09
Do more template types handling corrections
quevangel Aug 24, 2018
91ed255
Dfmt formatting
quevangel Aug 24, 2018
0ed97a5
Simplify Program and Shader
quevangel Aug 25, 2018
dc46d14
Add glsl module
quevangel Aug 25, 2018
05b119b
Fix import
quevangel Aug 25, 2018
3e7adf2
GetUniformPostfix
quevangel Aug 25, 2018
6ba447b
Fix
quevangel Aug 26, 2018
c162162
Update
quevangel Aug 26, 2018
c68d75b
Glsl Module
quevangel Sep 11, 2018
b3b6040
Merge graphics simplification big refactoring
davidomarf Sep 13, 2018
868611e
Refactoring
quevangel Oct 1, 2018
47cefd3
Style corrections
quevangel Oct 18, 2018
0b5fbd7
Style corrections
davidomarf Oct 18, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ language: d
d:
- dmd

before_install:
- sudo apt-get -qq update
- sudo apt-get install -y libsdl2-2.0
- sudo apt-get install libsdl2-image-dev

script:
- dub test -b unittest-cov --compiler=${DC}
after_success:
- bash <(curl -s https://codecov.io/bash)
- dub test
1 change: 1 addition & 0 deletions documentation/daque/graphics.aux
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
\relax
59 changes: 59 additions & 0 deletions documentation/daque/graphics.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
This is pdfTeX, Version 3.14159265-2.6-1.40.19 (TeX Live 2018/Arch Linux) (preloaded format=pdflatex 2018.6.16) 8 SEP 2018 12:51
entering extended mode
restricted \write18 enabled.
%&-line parsing enabled.
**graphics.tex
(./graphics.tex
LaTeX2e <2018-04-01> patch level 2
Babel <3.18> and hyphenation patterns for 84 language(s) loaded.
(/usr/share/texmf-dist/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
(/usr/share/texmf-dist/tex/latex/base/size10.clo
File: size10.clo 2014/09/29 v1.4h Standard LaTeX file (size option)
)
\c@part=\count80
\c@section=\count81
\c@subsection=\count82
\c@subsubsection=\count83
\c@paragraph=\count84
\c@subparagraph=\count85
\c@figure=\count86
\c@table=\count87
\abovecaptionskip=\skip41
\belowcaptionskip=\skip42
\bibindent=\dimen102
) (./graphics.aux)
\openout1 = `graphics.aux'.

LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 3.
LaTeX Font Info: ... okay on input line 3.
LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 3.
LaTeX Font Info: ... okay on input line 3.
LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 3.
LaTeX Font Info: ... okay on input line 3.
LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 3.
LaTeX Font Info: ... okay on input line 3.
LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 3.
LaTeX Font Info: ... okay on input line 3.
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 3.
LaTeX Font Info: ... okay on input line 3.
[1

{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}] (./graphics.aux) )
Here is how much of TeX's memory you used:
201 strings out of 492649
2136 string characters out of 6135778
58838 words of memory out of 5000000
4170 multiletter control sequences out of 15000+600000
3640 words of font info for 14 fonts, out of 8000000 for 9000
1141 hyphenation exceptions out of 8191
23i,4n,17p,116b,107s stack positions out of 5000i,500n,10000p,200000b,80000s
</usr/sh
are/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb>
Output written on graphics.pdf (1 page, 13466 bytes).
PDF statistics:
12 PDF objects out of 1000 (max. 8388607)
7 compressed objects within 1 object stream
0 named destinations out of 1000 (max. 500000)
1 words of extra memory for PDF output out of 10000 (max. 10000000)

Binary file added documentation/daque/graphics.pdf
Binary file not shown.
7 changes: 7 additions & 0 deletions documentation/daque/graphics.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
\documentclass{article}

\begin{document}
Documento de ejemplo.
Con un cambio
\end{document}

Binary file removed libdaque-test-library
Binary file not shown.
51 changes: 51 additions & 0 deletions source/daque/graphics/attributeformat.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
module daque.graphics.attributeformat;

import std.conv;

import derelict.opengl;

/++
Data needed to represent a particular attribute for a Vertex.
+/
struct AttributeFormat
{
/// OpenGL identifies each attribute by an @index
GLuint index;
/// No. of components of this attribute
GLint size;
/// Data type of the components of this attribute
GLenum type;
/// Does it need to be _normalized_(Clipped to a range of 0.0 - 1.0)?
GLboolean normalized;
/// Space between each appearance of this attribute in an array of Vertices, equivalently, the
/// size of each Vertex
GLsizei stride;
/// Offset to first appearance of this attribute in an array of Vertices, equivalently, the
/// offset of this member in the Vertex structure
const GLvoid* pointer;

string toString()
{
string str = "AttributeFormat(index: "
~ to!string(index) ~
", size: " ~ to!string(size) ~ ")";
return str;
}
}

/++
Given the Buffer and the VertexArray currently bound to the OpenGL context, this function provides
format info about the attribute format.index of the vertices in the VertexArray.

This associates the Buffer to the VertexArray.

Params:
format = attribute format to be given to the VertexArray currently bound
+/
void setup(AttributeFormat format)
{
glEnableVertexAttribArray(format.index);

glVertexAttribPointer(format.index, format.size, format.type,
format.normalized, format.stride, format.pointer);
}
96 changes: 48 additions & 48 deletions source/daque/graphics/color.d
Original file line number Diff line number Diff line change
Expand Up @@ -6,77 +6,77 @@ module daque.graphics.color;
struct Color
{
public:
/++
/++
RGBA components of the color
+/
ubyte[4] component;
ubyte[4] component;

/++
/++
Gets a reference to the Red component of the color
+/
ref ubyte r()
{
return component[0];
}
ref ubyte r()
{
return component[0];
}

/++
/++
Gets a reference to the Green component of the color
+/
ref ubyte g()
{
return component[1];
}
ref ubyte g()
{
return component[1];
}

/++
/++
Gets a reference to the Blue component of the color
+/
ref ubyte b()
{
return component[2];
}
ref ubyte b()
{
return component[2];
}

/++
/++
Gets a reference to the Alpha component of the color
+/
ref ubyte a()
{
return component[3];
}
ref ubyte a()
{
return component[3];
}

/++
/++
Constructs a new Color from the given red (r), green (g), blue (b) and alpha (a) components
+/
this(ubyte r, ubyte g, ubyte b, ubyte a)
{
component[] = [r, g, b, a];
}
this(ubyte r, ubyte g, ubyte b, ubyte a)
{
component[] = [r, g, b, a];
}

/++
/++
Constructs a color from the encoded 32 bit unsigned integer color
+/
this(uint color)
{
for (uint i; i < component.length; i++)
{
component[i] = color % 0x100;
color >>= 8;
}
}
this(uint color)
{
for (uint i; i < component.length; i++)
{
component[i] = color % 0x100;
color >>= 8;
}
}

/++
/++
Encodes the color into a 32 bit unsigned integer
+/
uint toInt()
{
uint color = 0u;
uint toInt()
{
uint color = 0u;

for (int i = cast(int) component.length - 1; i >= 0; i--)
{
color += component[i];
if (i - 1 >= 0)
color <<= 8;
}
for (int i = cast(int) component.length - 1; i >= 0; i--)
{
color += component[i];
if (i - 1 >= 0)
color <<= 8;
}

return color;
}
return color;
}
}
Loading