瀏覽代碼

HTML generator for documentation. Similar to markdown but customized.

David Piuva 5 年之前
父節點
當前提交
727c51829f

+ 46 - 0
Doc/Generator/Input/License.txt

@@ -0,0 +1,46 @@
+<- Manual.html | Back to main page
+---
+Title: License terms for David Forsgren Piuva's Software Renderer
+
+The software renderer is using a combination of the ZLIB open source license (for David Piuva's code) and public domain (for other people's code).
+
+The ZLIB license essentially requires the copyright notice to remain in source code redistributions and that the origin is not missrepresented. This is just common sense made explicit for the sake of consumer protection, because lying about having written the library would be a scam against the buyers.
+
+Public domain essentially means owned by the people, to prevent code from being withdrawn. When a project has many contributors, the risk of having one of them withdrawing copy rights increases significantly. Public domain code don't have any copyright holder, so pulling back contributions is only possible if the code turns out to be illegal.
+---
+Title2: ZLIB Open source license (David Piuva's code)
+
+zlib open source license
+
+Copyright (c) David Forsgren Piuva
+
+This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
+
+Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+
+3. This notice may not be removed or altered from any source distribution.
+---
+Title2: Public domain (other people's code)
+
+The renderer has embedded the stb_image library using public domain terms (unlicense.org). While you could use stb_image under the more restrictive MIT license terms out of respect for its creators, it's essentially nullified by the more permissive public domain option.
+
+This is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means. In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+---
+<b>SDK media</b>
+
+You may use the media files in SDK examples for your own project. Just don't falsely claim to have made it, because that would be fraud.
+---
+Title2: License summary (for those who worry about getting sued)
+
+The stb_image library lets you choose between MIT and public domain, so the least restrictive option becomes public domain. When combined with the non-optional ZLIB license from the majority of the DFPSR library, the ZLIB terms are more restrictive than public domain. In conclusion, all you need to follow is the ZLIB terms for the library as a whole because public domain is compatible with all open source license terms.
+
+For releasing source code, you can only violate the terms as a whole if you alter a copyright notice or lie about who made what.
+
+For releasing binaries, you can only violate the terms as a whole if you lie about who made what. There are no requirements to credit anyone in released binaries, because stb_image lets you choose the public domain license.
+
+You are not forced to share modifications, because the library does not contain any GPL license. It is however in a company's best interest to share bug-fixes so that they don't have to be re-applied when pulling a new version.
+---

+ 22 - 0
Doc/Generator/Input/Manual.txt

@@ -0,0 +1,22 @@
+Title: David Piuva's software renderer
+
+When you just want to code in your own pace without worrying about API deprecation.
+---
+Title2: Using the library
+
+*
+<- Starting.html | Getting started
+---
+Title2: Modifying the library
+
+*
+<- StyleGuide.html | Style guide
+---
+Title2: Technical details
+
+*
+<- License.html | License
+
+*
+<- Security.html | Security
+---

+ 21 - 0
Doc/Generator/Input/Security.txt

@@ -0,0 +1,21 @@
+<- Manual.html | Back to main page
+
+Title: Security information for David Forsgren Piuva's Software Renderer
+---
+Title2: Purpose
+
+The library is designed to stand the test of time when making software to be ported by future generations.
+Any attempts at security against hackers from a distant future with hundreds of years to study the source code and superior quantum processors to break your encryptions would be futile.
+---
+Title2: Design
+
+Due to the flat design of the library (shallow call depth), applying browser grade security in every internal function would not be practical nor fast.
+Memory bound checks are removed in release builds for maximum performance.
+Your application should terminate if incorrect input caused an error to be thrown from the library, because resuming execution from a state which breaks the invariant means that correctness can no longer be guaranteed.
+---
+Title2: How to be "safe" (if such a thing can ever be acheived)
+
+In order to be safe, you must either read all input from a reliable source (like a protected folder) or validate all input yourself before giving it to the library (no memory aliasing, extreme image dimensions, invalid file syntax...).
+Just preventing others from writing over binaries would not help, because the library does not have security against file corruption when loading media.
+Treat it like you would treat a fast low-level graphics API, don't give direct access to potential attackers.
+---

+ 90 - 0
Doc/Generator/Input/Starting.txt

@@ -0,0 +1,90 @@
+<- Manual.html | Back to main page
+
+Title: Getting started
+---
+Title2: Working in Linux
+
+Place the library's root folder inside of a new folder. This gives room for the temporary object's folder, which will be created outside of the dfpsr folder when compiling.
+
+Image: Images/Warning.png | Warning
+A light-weight Linux distribution, might require you to install GNU's compiler toolchain <B>"gcc"</B> and X11 headers <B>"libx11-dev"</B>.
+
+Image: Images/Warning.png | Warning
+Big-endian support is only theoretical and has never actually been tested, because big-endian desktops were practically extinct when the library was created. If you happen to own such a rare museum item in working condition, sending the <B>DSR_BIG_ENDIAN</B> macro to compilation should activate the big-endian mode and shift the direction of bit shift meant to be equivalent with the address space.
+
+Title2: Build and run an example program:
+
+*
+Select an SDK example and open its folder in a terminal.
+
+*
+Give permission to execute the build script.
+
+Code: chmod +x build.sh
+
+*
+Run the build script.
+
+Code: ./build.sh
+Title2: If no example runs, try regression tests to diagnose:
+*
+Open the source folder in a terminal and run the test script:
+
+<blockquote>chmod +x test.sh</blockquote>
+
+<blockquote>./test.sh</blockquote>
+
+This will stop with a clearly visible error message if any of the tests fail.
+
+Title2: Create your own project
+
+*
+Copy one of the SDK examples to use as a template.
+
+*
+Change ROOT_PATH and TEMP_DIR in your build script to refer to the same locations from a new source path. If you don't use the build script, you can just delete it.
+
+*
+Update header include paths to the library from the new folder location.
+
+*
+Add your own external dependencies to LINKER_FLAGS within a quote with -l in front of each library name.
+
+Title2: Create a command line application
+
+If your application doesn't create any window, you can make it more portable by replacing "WINDOW_MANAGER=X11" with "WINDOW_MANAGER=NONE". This will compile with NoWindow.cpp instead of X11Window.cpp so that you cannot create a window.
+
+---
+Title2: Compiling a project on Microsoft Windows
+
+Create a project from existing code:
+
+*
+Download a mingw edition of CodeBlocks from their website. <A href="http://www.codeblocks.org/downloads/26#windows">www.codeblocks.org/downloads</A>
+
+*
+Start CodeBlocks with administrator rights and create a new Win32 project, just to get the correct libraries. You can then throw away the template main file.
+
+*
+If not starting as an administrator, certain parts of the file system may lack necessary permissions needed for creating executable binaries.
+
+*
+Select C++ 14 with G++ from the GCC toolchain, so that it will be compatible with the software renderer. Link with "-lm -pthread" to get standard C++ math and threading. This should be done for both debug and release.
+
+*
+Import all source files from <B>dfpsr/Source/DFPSR</B>.
+
+*
+Import all source files from <B>the project you want to build</B>.
+
+*
+Import <B>dfpsr/Source/windowManagers/Win32Window.cpp</B>.
+
+*
+Save your project, so that you can continue working on the project.
+
+*
+Build and run the project.
+
+This is not an ideal solution for development if you plan to have multiple projects depending on the same library. A better solution would be to compile the whole dfpsr folder into a static library, link to it in each of your projects and refer to includeFramework.h.
+---

+ 45 - 0
Doc/Generator/Input/StyleGuide.txt

@@ -0,0 +1,45 @@
+<- Manual.html | Back to main page
+
+Title: Code convention for David Forsgren Piuva's Software Renderer
+
+To keep the style consistent, the style being used in the library is explained in this document.
+---
+1. Use common sense! If it looks wrong to human readers then it's wrong. Don't defeat the purpose of any rule by taking it too far.
+---
+2. Don't use iterators when there is any other way to accomplish the task. You can't write efficient algorithms without knowing the data structures.
+---
+3. Tabs for indentation then spaces for alignment. It's the best of both worlds by both having variable length tabs	and correct alignment that works between lines of the same indentation.
+---
+4. No dangling else, use explicit {} for safety. Otherwise someone might add an extra statement and get random crashes.
+---
+5. No hpp extensions, use h for all headers. Could be either way, but this library uses *.h for compact naming, so keep it consistent.
+---
+6. C-style casting for raw data manipulation and C++-style for high-level classes.
+When using assembly intrinsics and raw pointer manipulation to alter the state of bits,
+verbose high-level abstractions only make it harder to count CPU cycles in your head.
+Always use the tool that makes sense for the problem you're trying to solve.
+C++ style is for things that are abstracted on a higher level.
+C style is for when a byte is just a byte and you just want to manipulate it in a specific way.
+---
+7. Don't call member methods with "this" set to nullptr.
+This would be undefined behaviour and may randomly crash.
+Use global functions instead. They allow checking pointers for null
+because they are explicit arguments declared by the programmer.
+---
+8. Avoid using STD/STL directly in SDK examples.
+Exposing types from the standard library should be done using an alias or wrapper in the dsr namespace.
+This allow replacing the standard library without breaking backward compatibility.
+The C++ standard libraries have broken backward compatibility before and it can happen again.
+---
+9. Don't abuse the auto keyword everywhere just to make it look more "modern".
+Explicit type safety is what makes compiled languages safer than scripting.
+---
+10. No new line for opening brackets.
+Makes the code more compact and decreases the risk of copy-paste errors.
+---
+11. Don't fix the style of someone else's code if you can easily read it.
+Especially if there's no style rule explicitly supporting the change.
+Otherwise style changes will defeat the purpose by introducing more version conflicts.
+---
+12. Don't change things that you don't know how to test.
+---

+ 22 - 0
Doc/Generator/Resources/Default.css

@@ -0,0 +1,22 @@
+body { background-color: #EEFFEE; font-size: 16px; font-family: Arial;
+       color: #000000; margin: 0px;
+       padding-left: 0px; padding-right: 0px;
+       padding-top: 0px; padding-bottom: 0px; }
+H1 { padding-left: 10px; padding-top: 10px; padding-bottom: 10px; font-size: 26px; }
+H2 { padding-left: 10px; padding-top: 10px;  font-size: 20px; }
+blockquote {
+  color: #FFFFFF; background: #000000;
+  font-size: 20px; font-family: monospace;
+  padding-left: 5px; padding-right: 5px;
+  padding-top: 5px; padding-bottom: 5px;
+}
+P { padding-left: 10px; }
+IMG { padding-left: 0px; padding-right: 0px;
+       padding-top: 0px; padding-bottom: 0px; }
+
+A { font-size: 18px; font-family: Arial; color: #0000A0; text-decoration: none; }
+A:hover { color: #000070; background: #AAffAA; }
+A:active { color: #00A0A0; }
+.normal { font-size: 18px; color: #00A0A0; }
+.sub { font-size: 18px; color: #ffffdf; }
+

+ 30 - 0
Doc/Generator/build.sh

@@ -0,0 +1,30 @@
+#!/bin/bash
+
+# Assuming that you called build.sh from its own folder, you should already be in the project folder.
+PROJECT_FOLDER=.
+# Placing your executable in the project folder allow using the same relative paths in the final release.
+TARGET_FILE=./generator
+# The root folder is where DFPSR, SDK and tools are located.
+ROOT_PATH=../../Source
+# Select where to place temporary files and the generated executable
+TEMP_DIR=${ROOT_PATH}/../../temporary
+# Select a window manager
+WINDOW_MANAGER=NONE
+# Select safe debug mode or fast release mode
+MODE=-DDEBUG #Debug mode
+#MODE=-DNDEBUG #Release mode
+# Select the version of C++
+CPP_VERSION=-std=c++14
+# Select optimization level
+O_LEVEL=-O2
+# Select external libraries
+LINKER_FLAGS=""
+
+# Give execution permission
+chmod +x ${ROOT_PATH}/tools/build.sh;
+# Compile everything
+${ROOT_PATH}/tools/build.sh "${PROJECT_FOLDER}" "${TARGET_FILE}" "${ROOT_PATH}" "${TEMP_DIR}" "${WINDOW_MANAGER}" "${MODE}" "${CPP_VERSION}" "${O_LEVEL}" "${LINKER_FLAGS}";
+
+# Execute the generation script to see the changes
+chmod +x gen.sh
+./gen.sh ./Input .. ./Resources/

+ 38 - 0
Doc/Generator/gen.sh

@@ -0,0 +1,38 @@
+#!/bin/bash
+
+# The root of the source files
+SOURCE_FOLDER=$1
+# The target folder where the library will be created
+TARGET_FOLDER=$2
+# The resource folder where styles are found
+RESOURCE_FOLDER=$3
+
+# Argument: $1 as the folder to generate HTML from
+generateInFolder() {
+	# Convert all the text files into HTML
+	for file in "$1"/*.txt
+	do
+		[ -e $file ] || continue
+		# Get name without path
+		name=${file##*/}
+		# Get name without extension nor path
+		base=${name%.txt}
+		./generator ${file} ${TARGET_FOLDER}/${base}.html ${RESOURCE_FOLDER}
+		if [ $? -ne 0 ]
+		then
+			echo "Failed to convert ${file}!"
+			exit 1
+		fi
+	done
+	# Recursively compile other folders
+	for folder in "$1"/*
+	do
+		if [ -d "$folder" ]
+		then
+			generateInFolder "$folder"
+		fi
+	done
+}
+
+echo "Generating HTML from $SOURCE_FOLDER to $TARGET."
+generateInFolder ${SOURCE_FOLDER}

二進制
Doc/Generator/generator


+ 104 - 0
Doc/Generator/main.cpp

@@ -0,0 +1,104 @@
+
+#include "../../Source/DFPSR/includeFramework.h"
+
+using namespace dsr;
+
+// This program is only for maintaining the library's documentation,
+//   so it's okay to use features specific to the Linux operating system.
+
+String ResourceFolderPath;
+
+bool string_beginsWith(const ReadableString &a, const ReadableString &b) {
+	return string_caseInsensitiveMatch(string_before(a, string_length(b)), b);
+}
+
+void processContent(String &target, String content) {
+	string_split_callback([&target](ReadableString section) {
+		//printText(U"Processing: ", section, U"\n");
+		ReadableString dense = string_removeOuterWhiteSpace(section);
+		if (string_length(dense) == 0) {
+			//printText(U"    Break\n");
+			string_append(target, U"\n</P><P>\n");
+		} else if (string_match(dense, U"*")) {
+			//printText(U"    Dot\n");
+			string_append(target, U"<IMG SRC=\"Images/SmallDot.png\">\n");
+		} else if (string_match(dense, U"---")) {
+			//printText(U"    Border\n");
+			string_append(target, U"</P><IMG SRC=\"Images/Border.png\"><P>\n");
+		} else if (string_beginsWith(dense, U"<-")) {
+			ReadableString arguments = string_from(dense, 2);
+			int splitIndex = string_findFirst(arguments, U'|');
+			if (splitIndex > -1) {
+				ReadableString link = string_removeOuterWhiteSpace(string_before(arguments, splitIndex));
+				ReadableString text = string_removeOuterWhiteSpace(string_after(arguments, splitIndex));
+				//printText(U"    Link to ", link, U" as ", text, U"\n");
+				string_append(target, U"<A href=\"", link, "\">", text, "</A>");
+			} else {
+				//printText(U"    Link to ", arguments, U"\n");
+				string_append(target, U"<A href=\"", arguments, "\">", arguments, "</A>");
+			}
+		} else if (string_beginsWith(dense, U"Image:")) {
+			ReadableString arguments = string_from(dense, 6);
+			int splitIndex = string_findFirst(arguments, U'|');
+			if (splitIndex > -1) {
+				ReadableString image = string_removeOuterWhiteSpace(string_before(arguments, splitIndex));
+				ReadableString text = string_removeOuterWhiteSpace(string_after(arguments, splitIndex));
+				//printText(U"    Image at ", image, U" as ", text, U"\n");
+				string_append(target, U"<IMG SRC=\"", image, "\" ALT=\"", text, "\">\n");
+			} else {
+				//printText(U"    Image at ", arguments, U"\n");
+				string_append(target, U"<IMG SRC=\"", arguments, "\" ALT=\"\">\n");
+			}
+		} else if (string_beginsWith(dense, U"Title:")) {
+			ReadableString title = string_from(dense, 6);
+			//printText(U"    Title: ", title, U"\n");
+			string_append(target, U"</P><H1>", title, U"</H1><P>");
+		} else if (string_beginsWith(dense, U"Title2:")) {
+			ReadableString title = string_from(dense, 7);
+			//printText(U"    Title2: ", title, U"\n");
+			string_append(target, U"</P><H2>", title, U"</H2><P>");
+		} else if (string_beginsWith(dense, U"Title3:")) {
+			ReadableString title = string_from(dense, 7);
+			//printText(U"    Title3: ", title, U"\n");
+			string_append(target, U"</P><H3>", title, U"</H3><P>");
+		} else if (string_beginsWith(dense, U"Code:")) {
+			ReadableString code = string_from(dense, 5);
+			//printText(U"    Code: ", code, U"\n");
+			string_append(target, U"<blockquote>", code, U"</blockquote>");
+		} else {
+			//printText(U"    Text: ", dense, U"\n");
+			string_append(target, dense);
+		}
+	}, content, U'\n');
+}
+
+String generateHtml(String content) {
+	String style = string_load(ResourceFolderPath + U"Default.css");
+	String result = U"<!DOCTYPE html> <HTML lang=en> <HEAD> <STYLE>\n";
+	string_append(result, style);
+	string_append(result, U"</STYLE> </HEAD> <BODY>\n");
+	string_append(result, U"<IMG SRC=\"Images/Title.png\" ALT=\"Images/Title.png\">\n");
+	string_append(result, U"<P>\n");
+	processContent(result, content);
+	string_append(result, U"</P>\n");
+	string_append(result, U"</BODY> </HTML>\n");
+	return result;
+}
+
+int main(int argn, char **argv) {
+	if (argn != 4) {
+		printText(U"The generator needs filenames for target!\n");
+		return 1;
+	}
+	String SourceFilePath = argv[1];
+	String TargetFilePath = argv[2];
+	ResourceFolderPath = argv[3];
+
+	printText(U"Generating ", TargetFilePath, U" from ", SourceFilePath, U" using the style", ResourceFolderPath, U"\n");
+	
+	String content = string_load(SourceFilePath);
+	String result = generateHtml(content);
+	string_save(TargetFilePath, result);
+	printText(U"Done\n");
+	return 0;
+}

+ 0 - 0
Doc/Pages/Images/Border.png → Doc/Images/Border.png


+ 0 - 0
Doc/Pages/Images/SmallDot.png → Doc/Images/SmallDot.png


+ 0 - 0
Doc/Pages/Images/Title.png → Doc/Images/Title.png


+ 0 - 0
Doc/Pages/Images/Warning.png → Doc/Images/Warning.png


+ 68 - 0
Doc/License.html

@@ -0,0 +1,68 @@
+<!DOCTYPE html> <HTML lang=en> <HEAD> <STYLE>
+body { background-color: #EEFFEE; font-size: 16px; font-family: Arial;
+       color: #000000; margin: 0px;
+       padding-left: 0px; padding-right: 0px;
+       padding-top: 0px; padding-bottom: 0px; }
+H1 { padding-left: 10px; padding-top: 10px; padding-bottom: 10px; font-size: 26px; }
+H2 { padding-left: 10px; padding-top: 10px;  font-size: 20px; }
+blockquote {
+  color: #FFFFFF; background: #000000;
+  font-size: 20px; font-family: monospace;
+  padding-left: 5px; padding-right: 5px;
+  padding-top: 5px; padding-bottom: 5px;
+}
+P { padding-left: 10px; }
+IMG { padding-left: 0px; padding-right: 0px;
+       padding-top: 0px; padding-bottom: 0px; }
+
+A { font-size: 18px; font-family: Arial; color: #0000A0; text-decoration: none; }
+A:hover { color: #000070; background: #AAffAA; }
+A:active { color: #00A0A0; }
+.normal { font-size: 18px; color: #00A0A0; }
+.sub { font-size: 18px; color: #ffffdf; }
+
+</STYLE> </HEAD> <BODY>
+<IMG SRC="Images/Title.png" ALT="Images/Title.png">
+<P>
+<A href="Manual.html">Back to main page</A></P><IMG SRC="Images/Border.png"><P>
+</P><H1> License terms for David Forsgren Piuva's Software Renderer</H1><P>
+</P><P>
+The software renderer is using a combination of the ZLIB open source license (for David Piuva's code) and public domain (for other people's code).
+</P><P>
+The ZLIB license essentially requires the copyright notice to remain in source code redistributions and that the origin is not missrepresented. This is just common sense made explicit for the sake of consumer protection, because lying about having written the library would be a scam against the buyers.
+</P><P>
+Public domain essentially means owned by the people, to prevent code from being withdrawn. When a project has many contributors, the risk of having one of them withdrawing copy rights increases significantly. Public domain code don't have any copyright holder, so pulling back contributions is only possible if the code turns out to be illegal.</P><IMG SRC="Images/Border.png"><P>
+</P><H2> ZLIB Open source license (David Piuva's code)</H2><P>
+</P><P>
+zlib open source license
+</P><P>
+Copyright (c) David Forsgren Piuva
+</P><P>
+This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
+</P><P>
+Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
+</P><P>
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+</P><P>
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+</P><P>
+3. This notice may not be removed or altered from any source distribution.</P><IMG SRC="Images/Border.png"><P>
+</P><H2> Public domain (other people's code)</H2><P>
+</P><P>
+The renderer has embedded the stb_image library using public domain terms (unlicense.org). While you could use stb_image under the more restrictive MIT license terms out of respect for its creators, it's essentially nullified by the more permissive public domain option.
+</P><P>
+This is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means. In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</P><IMG SRC="Images/Border.png"><P>
+<b>SDK media</b>
+</P><P>
+You may use the media files in SDK examples for your own project. Just don't falsely claim to have made it, because that would be fraud.</P><IMG SRC="Images/Border.png"><P>
+</P><H2> License summary (for those who worry about getting sued)</H2><P>
+</P><P>
+The stb_image library lets you choose between MIT and public domain, so the least restrictive option becomes public domain. When combined with the non-optional ZLIB license from the majority of the DFPSR library, the ZLIB terms are more restrictive than public domain. In conclusion, all you need to follow is the ZLIB terms for the library as a whole because public domain is compatible with all open source license terms.
+</P><P>
+For releasing source code, you can only violate the terms as a whole if you alter a copyright notice or lie about who made what.
+</P><P>
+For releasing binaries, you can only violate the terms as a whole if you lie about who made what. There are no requirements to credit anyone in released binaries, because stb_image lets you choose the public domain license.
+</P><P>
+You are not forced to share modifications, because the library does not contain any GPL license. It is however in a company's best interest to share bug-fixes so that they don't have to be re-applied when pulling a new version.</P><IMG SRC="Images/Border.png"><P>
+</P>
+</BODY> </HTML>

+ 45 - 57
Doc/Manual.html

@@ -1,58 +1,46 @@
-<!DOCTYPE html>
-<HTML lang=en>
-	<BODY>
-		<style>
-			body { background-color: #EEEEFF; font-size: 16px; font-family: Arial;
-			       color: #000000; margin: 0px;
-			       padding-left: 0px; padding-right: 0px;
-			       padding-top: 0px; padding-bottom: 0px; }
-			H1 { padding-left: 10px; padding-top: 10px; padding-bottom: 10px; font-size: 26px; }
-			H2 { padding-left: 10px; padding-top: 10px;  font-size: 20px; }
-			blockquote {
-			  color: #FFFFFF; background: #000000;
-			  font-size: 20px; font-family: monospace;
-			  padding-left: 5px; padding-right: 5px;
-			  padding-top: 5px; padding-bottom: 5px;
-			}
-			P { padding-left: 10px; }
-			IMG { padding-left: 0px; padding-right: 0px;
-			       padding-top: 0px; padding-bottom: 0px; }
+<!DOCTYPE html> <HTML lang=en> <HEAD> <STYLE>
+body { background-color: #EEFFEE; font-size: 16px; font-family: Arial;
+       color: #000000; margin: 0px;
+       padding-left: 0px; padding-right: 0px;
+       padding-top: 0px; padding-bottom: 0px; }
+H1 { padding-left: 10px; padding-top: 10px; padding-bottom: 10px; font-size: 26px; }
+H2 { padding-left: 10px; padding-top: 10px;  font-size: 20px; }
+blockquote {
+  color: #FFFFFF; background: #000000;
+  font-size: 20px; font-family: monospace;
+  padding-left: 5px; padding-right: 5px;
+  padding-top: 5px; padding-bottom: 5px;
+}
+P { padding-left: 10px; }
+IMG { padding-left: 0px; padding-right: 0px;
+       padding-top: 0px; padding-bottom: 0px; }
 
-			A { font-size: 18px; font-family: Arial; color: #0000A0; text-decoration: none; }
-			A:hover { color: #000070; background: #AAffAA; }
-			A:active { color: #00A0A0; }
-			.normal { font-size: 18px; color: #00A0A0; }
-			.sub { font-size: 18px; color: #ffffdf; }
-		</style>
-		<IMG SRC="Pages/Images/Title.png" alt="Logo titled DFPSR">
-		<h1 style="font-size:32px;">David Piuva's software renderer</h1>
-		<P>
-			When you just want to code in your own pace without worrying about API deprecation.
-		</P>
-		<IMG SRC="Pages/Images/Border.png">
-		<P>
-			<B>Using the library</B>
-		</P>
-		<P>
-			<IMG SRC="Pages/Images/SmallDot.png"> <A href="Pages/Starting.html">Getting started</A>
-		</P>
-		<IMG SRC="Pages/Images/Border.png">
-		<P>
-			<B>Modifying the library</B>
-		</P>
-		<P>
-			<IMG SRC="Pages/Images/SmallDot.png"> <A href="Pages/StyleGuide.html">Style guide</A>
-		</P>
-		<IMG SRC="Pages/Images/Border.png">
-		<P>
-			<B>Technical details</B>
-		</P>
-		<P>
-			<IMG SRC="Pages/Images/SmallDot.png"> <A href="Pages/License.html">License</A>
-		</P>
-		<P>
-			<IMG SRC="Pages/Images/SmallDot.png"> <A href="Pages/Security.html">Security</A>
-		</P>
-		<IMG SRC="Pages/Images/Border.png">
-	</BODY>
-</HTML>
+A { font-size: 18px; font-family: Arial; color: #0000A0; text-decoration: none; }
+A:hover { color: #000070; background: #AAffAA; }
+A:active { color: #00A0A0; }
+.normal { font-size: 18px; color: #00A0A0; }
+.sub { font-size: 18px; color: #ffffdf; }
+
+</STYLE> </HEAD> <BODY>
+<IMG SRC="Images/Title.png" ALT="Images/Title.png">
+<P>
+</P><H1> David Piuva's software renderer</H1><P>
+</P><P>
+When you just want to code in your own pace without worrying about API deprecation.</P><IMG SRC="Images/Border.png"><P>
+</P><H2> Using the library</H2><P>
+</P><P>
+<IMG SRC="Images/SmallDot.png">
+<A href="Starting.html">Getting started</A></P><IMG SRC="Images/Border.png"><P>
+</P><H2> Modifying the library</H2><P>
+</P><P>
+<IMG SRC="Images/SmallDot.png">
+<A href="StyleGuide.html">Style guide</A></P><IMG SRC="Images/Border.png"><P>
+</P><H2> Technical details</H2><P>
+</P><P>
+<IMG SRC="Images/SmallDot.png">
+<A href="License.html">License</A>
+</P><P>
+<IMG SRC="Images/SmallDot.png">
+<A href="Security.html">Security</A></P><IMG SRC="Images/Border.png"><P>
+</P>
+</BODY> </HTML>

+ 0 - 107
Doc/Pages/License.html

@@ -1,107 +0,0 @@
-<!DOCTYPE html>
-<HTML lang=en>
-	<HEAD>
-		<style>
-			body { background-color: #FFFFFF;  font-size: 16px; font-family: Arial;
-			       color: #000000; margin: 0px;
-			       padding-left: 0px; padding-right: 0px;
-			       padding-top: 0px; padding-bottom: 0px; }
-			H1 { padding-left: 10px; padding-top: 10px; padding-bottom: 10px; font-size: 26px; }
-			H2 { padding-left: 10px; padding-top: 10px;  font-size: 20px; }
-			blockquote {
-			  color: #FFFFFF; background: #000000;
-			  font-size: 20px; font-family: monospace;
-			  padding-left: 5px; padding-right: 5px;
-			  padding-top: 5px; padding-bottom: 5px;
-			}
-			P { padding-left: 10px; }
-			IMG { padding-left: 0px; padding-right: 0px;
-			       padding-top: 0px; padding-bottom: 0px; }
-
-			A { font-size: 18px; font-family: Arial; color: #0000A0; text-decoration: none; }
-			A:hover { color: #000070; background: #AAffAA; }
-			A:active { color: #00A0A0; }
-			.normal { font-size: 18px; color: #00A0A0; }
-			.sub { font-size: 18px; color: #ffffdf; }
-		</style>
-	</HEAD>
-	<BODY>
-		<IMG SRC="Images/Title.png" alt="Logo titled DFPSR">
-		<P>
-			<A href="../Manual.html">Back to main page</A>
-		</P>
-		<IMG SRC="Images/Border.png">
-		<P>
-			<b>License terms for David Forsgren Piuva's Software Renderer</b>
-		</P>
-		<P>
-			The software renderer is using a combination of the ZLIB open source license (for David Piuva's code) and public domain (for other people's code).
-		</P>
-		<P>
-			The ZLIB license essentially requires the copyright notice to remain in source code redistributions and that the origin is not missrepresented. This is just common sense made explicit for the sake of consumer protection, because lying about having written the library would be a scam against the buyers.
-		</P>
-		<P>
-			Public domain essentially means owned by the people, to prevent code from being withdrawn. When a project has many contributors, the risk of having one of them withdrawing copy rights increases significantly. Public domain code don't have any copyright holder, so pulling back contributions is only possible if the code turns out to be illegal.
-		</P>
-		<IMG SRC="Images/Border.png">
-		<P>
-			<b>ZLIB Open source license (David Piuva's code)</b>
-		</P>
-		<P>
-			zlib open source license
-		</P>
-		<P>
-			Copyright (c) David Forsgren Piuva
-		</P>
-		<P>
-			This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
-		</P>
-		<P>
-			Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
-		</P>
-		<P>
-			1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-		</P>
-		<P>
-			2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-		</P>
-		<P>
-			3. This notice may not be removed or altered from any source distribution.
-		</P>
-		<IMG SRC="Images/Border.png">
-		<P>
-			<b>Public domain (other people's code)</b>
-		</P>
-		<P>
-			The renderer has embedded the stb_image library using public domain terms (unlicense.org). While you could use stb_image under the more restrictive MIT license terms out of respect for its creators, it's essentially nullified by the more permissive public domain option.
-		</P>
-		<P></P>
-		<P>
-			This is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means. In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-		</P>
-		<IMG SRC="Images/Border.png">
-		<P>
-			<b>SDK media</b>
-		</P>
-		<P>
-			You may use the media files in SDK examples for your own project. Just don't falsely claim to have made it, because that would be fraud.
-		</P>
-		<IMG SRC="Images/Border.png">
-		<P>
-			<b>License summary (for those who worry about getting sued)</b>
-		</P>
-		<P>
-			The stb_image library lets you choose between MIT and public domain, so the least restrictive option becomes public domain. When combined with the non-optional ZLIB license from the majority of the DFPSR library, the ZLIB terms are more restrictive than public domain. In conclusion, all you need to follow is the ZLIB terms for the library as a whole because public domain is compatible with all open source license terms.
-		</P>
-		<P>
-			For releasing source code, you can only violate the terms as a whole if you alter a copyright notice or lie about who made what.
-		</P>
-		<P>
-			For releasing binaries, you can only violate the terms as a whole if you lie about who made what. There are no requirements to credit anyone in released binaries, because stb_image lets you choose the public domain license.
-		</P>
-		<P>
-			You are not forced to share modifications, because the library does not contain any GPL license. It is however in a company's best interest to share bug-fixes so that they don't have to be re-applied when pulling a new version.
-		</P>
-		<IMG SRC="Images/Border.png">
-	</BODY>
-</HTML>

+ 0 - 64
Doc/Pages/Security.html

@@ -1,64 +0,0 @@
-<!DOCTYPE html>
-<HTML lang=en>
-	<HEAD>
-		<style>
-			body { background-color: #FFFFEE;  font-size: 16px; font-family: Arial;
-			       color: #000000; margin: 0px;
-			       padding-left: 0px; padding-right: 0px;
-			       padding-top: 0px; padding-bottom: 0px; }
-			H1 { padding-left: 10px; padding-top: 10px; padding-bottom: 10px; font-size: 26px; }
-			H2 { padding-left: 10px; padding-top: 10px;  font-size: 20px; }
-			blockquote {
-			  color: #FFFFFF; background: #000000;
-			  font-size: 20px; font-family: monospace;
-			  padding-left: 5px; padding-right: 5px;
-			  padding-top: 5px; padding-bottom: 5px;
-			}
-			P { padding-left: 10px; }
-			IMG { padding-left: 0px; padding-right: 0px;
-			       padding-top: 0px; padding-bottom: 0px; }
-
-			A { font-size: 18px; font-family: Arial; color: #0000A0; text-decoration: none; }
-			A:hover { color: #000070; background: #AAffAA; }
-			A:active { color: #00A0A0; }
-			.normal { font-size: 18px; color: #00A0A0; }
-			.sub { font-size: 18px; color: #ffffdf; }
-		</style>
-	</HEAD>
-	<BODY>
-		<IMG SRC="Images/Title.png" alt="Logo titled DFPSR">
-		<P>
-			<A href="../Manual.html">Back to main page</A>
-		</P>
-		<P>
-			<b>Security information for David Forsgren Piuva's Software Renderer</b>
-		</P>
-		<IMG SRC="Images/Border.png">
-		<P>
-			<B>Purpose</B>
-		</P>
-		<P>
-			The library is designed to stand the test of time when making software to be ported by future generations.
-			Any attempts at security against hackers from a distant future with hundreds of years to study the source code and superior quantum processors to break your encryptions would be futile.
-		</P>
-		<IMG SRC="Images/Border.png">
-		<P>
-			<B>Design</B>
-		</P>
-		<P>
-			Due to the flat design of the library (shallow call depth), applying browser grade security in every internal function would not be practical nor fast.
-			Memory bound checks are removed in release builds for maximum performance.
-			Your application should terminate if incorrect input caused an error to be thrown from the library, because resuming execution from a state which breaks the invariant means that correctness can no longer be guaranteed.
-		</P>
-		<IMG SRC="Images/Border.png">
-		<P>
-			<B>How to be "safe" (if such a thing can ever be acheived)</B>
-		</P>
-		<P>
-			In order to be safe, you must either read all input from a reliable source (like a protected folder) or validate all input yourself before giving it to the library (no memory aliasing, extreme image dimensions, invalid file syntax...).
-			Just preventing others from writing over binaries would not help, because the library does not have security against file corruption when loading media.
-			Treat it like you would treat a fast low-level graphics API, don't give direct access to potential attackers.
-		</P>
-		<IMG SRC="Images/Border.png">
-	</BODY>
-</HTML>

+ 0 - 130
Doc/Pages/Starting.html

@@ -1,130 +0,0 @@
-<!DOCTYPE html>
-<HTML lang=en>
-	<HEAD>
-		<style>
-			body { background-color: #FFFFEE; font-size: 16px; font-family: Arial;
-			       color: #000000; margin: 0px;
-			       padding-left: 0px; padding-right: 0px;
-			       padding-top: 0px; padding-bottom: 0px; }
-			H1 { padding-left: 10px; padding-top: 10px; padding-bottom: 10px; font-size: 26px; }
-			H2 { padding-left: 10px; padding-top: 10px;  font-size: 20px; }
-			blockquote {
-			  color: #FFFFFF; background: #000000;
-			  font-size: 20px; font-family: monospace;
-			  padding-left: 5px; padding-right: 5px;
-			  padding-top: 5px; padding-bottom: 5px;
-			}
-			P { padding-left: 10px; }
-			IMG { padding-left: 0px; padding-right: 0px;
-			       padding-top: 0px; padding-bottom: 0px; }
-
-			A { font-size: 18px; font-family: Arial; color: #0000A0; text-decoration: none; }
-			A:hover { color: #000070; background: #AAffAA; }
-			A:active { color: #00A0A0; }
-			.normal { font-size: 18px; color: #00A0A0; }
-			.sub { font-size: 18px; color: #ffffdf; }
-		</style>
-	</HEAD>
-	<BODY>
-		<IMG SRC="Images/Title.png" alt="Logo titled DFPSR">
-		<P>
-			<A href="../Manual.html">Back to main page</A>
-		</P>
-		<H1>Getting started</H1>
-		<IMG SRC="Images/Border.png">
-		<H2>Working in Linux</H2>
-		<P>
-			Place the library's root folder inside of a new folder. This gives room for the temporary object's folder, which will be created outside of the dfpsr folder when compiling.
-		</P>
-		<P>
-			<IMG SRC="Images/Warning.png"> A light-weight Linux distribution, might require you to install GNU's compiler toolchain <B>"gcc"</B> and X11 headers <B>"libx11-dev"</B>.
-		</P>
-		<P>
-			<IMG SRC="Images/Warning.png"> Big-endian support is only theoretical and has never actually been tested, because big-endian desktops were practically extinct when the library was created. If you happen to own such a rare museum item in working condition, sending the <B>DSR_BIG_ENDIAN</B> macro to compilation should activate the big-endian mode and shift the direction of bit shift meant to be equivalent with the address space.
-		</P>
-		<H2>Build and run an example program:</H2>
-		<P>
-			<IMG SRC="Images/SmallDot.png"> Select an SDK example and open its folder in a terminal.
-		</P>
-		<P>
-			<IMG SRC="Images/SmallDot.png"> Give permission to execute the build script.
-		</P>
-		<P>
-			<blockquote>chmod +x build.sh</blockquote> 
-		</P>
-		<P>	
-			<IMG SRC="Images/SmallDot.png"> Run the build script.
-		</P>
-		<P>
-			<blockquote>./build.sh</blockquote>
-		</P>
-		<H2>If no example runs, try regression tests to diagnose:</H2>
-		<P>
-			<IMG SRC="Images/SmallDot.png"> Open the source folder in a terminal and run the test script:
-		</P>
-		<P>
-			<blockquote>chmod +x test.sh</blockquote>
-		</P>
-		<P>
-			<blockquote>./test.sh</blockquote>
-		</P>
-		<P>
-			This will stop with a clearly visible error message if any of the tests fail.
-		</P>
-		<H2>Create your own project</H2>
-		<P>
-			<IMG SRC="Images/SmallDot.png"> Copy one of the SDK examples to use as a template.
-		</P>
-		<P>
-			<IMG SRC="Images/SmallDot.png"> Change ROOT_PATH and TEMP_DIR in your build script to refer to the same locations from a new source path. If you don't use the build script, you can just delete it.
-		</P>
-		<P>
-			<IMG SRC="Images/SmallDot.png"> Update header include paths to the library from the new folder location.
-		</P>
-		<P>
-			<IMG SRC="Images/SmallDot.png"> Add your own external dependencies to LINKER_FLAGS within a quote with -l in front of each library name.
-		</P>
-		<P>
-			<H2>Create a command line application</H2>
-		</P>
-		<P>
-			If your application doesn't create any window, you can make it more portable by replacing "WINDOW_MANAGER=X11" with "WINDOW_MANAGER=NONE". This will compile with NoWindow.cpp instead of X11Window.cpp so that you cannot create a window.
-		</P>
-		<IMG SRC="Images/Border.png">
-		<H2>Compiling a project on Microsoft Windows</H2>
-		<P>
-			Create a project from existing code:
-		</P>
-		<P>
-			<IMG SRC="Images/SmallDot.png"> Download a mingw edition of CodeBlocks from their website. <A href="http://www.codeblocks.org/downloads/26#windows">www.codeblocks.org/downloads</A>
-		</P>
-		<P>
-			<IMG SRC="Images/SmallDot.png"> Start CodeBlocks with administrator rights and create a new Win32 project, just to get the correct libraries. You can then throw away the template main file.
-		</P>
-		<P>
-			<IMG SRC="Images/Warning.png"> If not starting as an administrator, certain parts of the file system may lack necessary permissions needed for creating executable binaries.
-		</P>
-		<P>
-			<IMG SRC="Images/SmallDot.png"> Select C++ 14 with G++ from the GCC toolchain, so that it will be compatible with the software renderer. Link with "-lm -pthread" to get standard C++ math and threading. This should be done for both debug and release.
-		</P>
-		<P>
-			<IMG SRC="Images/SmallDot.png"> Import all source files from <B>dfpsr/Source/DFPSR</B>.
-		</P>
-		<P>
-			<IMG SRC="Images/SmallDot.png"> Import all source files from <B>the project you want to build</B>.
-		</P>
-		<P>
-			<IMG SRC="Images/SmallDot.png"> Import <B>dfpsr/Source/windowManagers/Win32Window.cpp</B>.
-		</P>
-		<P>
-			<IMG SRC="Images/SmallDot.png"> Save your project, so that you can continue working on the project.
-		</P>
-		<P>
-			<IMG SRC="Images/SmallDot.png"> Build and run the project.
-		</P>
-		<P>
-			This is not an ideal solution for development if you plan to have multiple projects depending on the same library. A better solution would be to compile the whole dfpsr folder into a static library, link to it in each of your projects and refer to includeFramework.h.
-		</P>
-		<IMG SRC="Images/Border.png">
-	</BODY>
-</HTML>

+ 0 - 102
Doc/Pages/StyleGuide.html

@@ -1,102 +0,0 @@
-<!DOCTYPE html>
-<HTML lang=en>
-	<HEAD>
-		<style>
-			body { background-color: #FFFFEE;  font-size: 16px; font-family: Arial;
-			       color: #000000; margin: 0px;
-			       padding-left: 0px; padding-right: 0px;
-			       padding-top: 0px; padding-bottom: 0px; }
-			H1 { padding-left: 10px; padding-top: 10px; padding-bottom: 10px; font-size: 26px; }
-			H2 { padding-left: 10px; padding-top: 10px;  font-size: 20px; }
-			blockquote {
-			  color: #FFFFFF; background: #000000;
-			  font-size: 20px; font-family: monospace;
-			  padding-left: 5px; padding-right: 5px;
-			  padding-top: 5px; padding-bottom: 5px;
-			}
-			P { padding-left: 10px; }
-			IMG { padding-left: 0px; padding-right: 0px;
-			       padding-top: 0px; padding-bottom: 0px; }
-
-			A { font-size: 18px; font-family: Arial; color: #0000A0; text-decoration: none; }
-			A:hover { color: #000070; background: #AAffAA; }
-			A:active { color: #00A0A0; }
-			.normal { font-size: 18px; color: #00A0A0; }
-			.sub { font-size: 18px; color: #ffffdf; }
-		</style>
-	</HEAD>
-	<BODY>
-		<IMG SRC="Images/Title.png" alt="Logo titled DFPSR">
-		<P>
-			<A href="../Manual.html">Back to main page</A>
-		</P>
-		<h1>Code convention for David Forsgren Piuva's Software Renderer</h1>
-		<P>
-			To keep the style consistent, the style being used in the library is explained in this document.
-		</P>
-		<IMG SRC="Images/Border.png">
-		<P>
-			1. Use common sense! If it looks wrong to human readers then it's wrong. Don't defeat the purpose of any rule by taking it too far.
-		</P>
-		<IMG SRC="Images/Border.png">
-		<P>
-			2. Don't use iterators when there is any other way to accomplish the task. You can't write efficient algorithms without knowing the data structures.
-		</P>
-		<IMG SRC="Images/Border.png">
-		<P>
-			3. Tabs for indentation then spaces for alignment. It's the best of both worlds by both having variable length tabs	and correct alignment that works between lines of the same indentation.
-		</P>
-		<IMG SRC="Images/Border.png">
-		<P>
-			4. No dangling else, use explicit {} for safety. Otherwise someone might add an extra statement and get random crashes.
-		</P>
-		<IMG SRC="Images/Border.png">
-		<P>
-			5. No hpp extensions, use h for all headers. Could be either way, but this library uses *.h for compact naming, so keep it consistent.
-		</P>
-		<IMG SRC="Images/Border.png">
-		<P>
-			6. C-style casting for raw data manipulation and C++-style for high-level classes.
-			When using assembly intrinsics and raw pointer manipulation to alter the state of bits,
-			verbose high-level abstractions only make it harder to count CPU cycles in your head.
-			Always use the tool that makes sense for the problem you're trying to solve.
-			C++ style is for things that are abstracted on a higher level.
-			C style is for when a byte is just a byte and you just want to manipulate it in a specific way.
-		</P>
-		<IMG SRC="Images/Border.png">
-		<P>
-			7. Don't call member methods with "this" set to nullptr.
-			This would be undefined behaviour and may randomly crash.
-			Use global functions instead. They allow checking pointers for null
-			because they are explicit arguments declared by the programmer.
-		</P>
-		<IMG SRC="Images/Border.png">
-		<P>
-			8. Avoid using STD/STL directly in SDK examples.
-			Exposing types from the standard library should be done using an alias or wrapper in the dsr namespace.
-			This allow replacing the standard library without breaking backward compatibility.
-			The C++ standard libraries have broken backward compatibility before and it can happen again.
-		</P>
-		<IMG SRC="Images/Border.png">
-		<P>
-			9. Don't abuse the auto keyword everywhere just to make it look more "modern".
-			Explicit type safety is what makes compiled languages safer than scripting.
-		</P>
-		<IMG SRC="Images/Border.png">
-		<P>
-			10. No new line for opening brackets.
-			Makes the code more compact and decreases the risk of copy-paste errors.
-		</P>
-		<IMG SRC="Images/Border.png">
-		<P>
-			11. Don't fix the style of someone else's code if you can easily read it.
-			Especially if there's no style rule explicitly supporting the change.
-			Otherwise style changes will defeat the purpose by introducing more version conflicts.
-		</P>
-		<IMG SRC="Images/Border.png">
-		<P>
-			12. Don't change things that you don't know how to test.
-		</P>
-		<IMG SRC="Images/Border.png">
-	</BODY>
-</HTML>

+ 40 - 0
Doc/Security.html

@@ -0,0 +1,40 @@
+<!DOCTYPE html> <HTML lang=en> <HEAD> <STYLE>
+body { background-color: #EEFFEE; font-size: 16px; font-family: Arial;
+       color: #000000; margin: 0px;
+       padding-left: 0px; padding-right: 0px;
+       padding-top: 0px; padding-bottom: 0px; }
+H1 { padding-left: 10px; padding-top: 10px; padding-bottom: 10px; font-size: 26px; }
+H2 { padding-left: 10px; padding-top: 10px;  font-size: 20px; }
+blockquote {
+  color: #FFFFFF; background: #000000;
+  font-size: 20px; font-family: monospace;
+  padding-left: 5px; padding-right: 5px;
+  padding-top: 5px; padding-bottom: 5px;
+}
+P { padding-left: 10px; }
+IMG { padding-left: 0px; padding-right: 0px;
+       padding-top: 0px; padding-bottom: 0px; }
+
+A { font-size: 18px; font-family: Arial; color: #0000A0; text-decoration: none; }
+A:hover { color: #000070; background: #AAffAA; }
+A:active { color: #00A0A0; }
+.normal { font-size: 18px; color: #00A0A0; }
+.sub { font-size: 18px; color: #ffffdf; }
+
+</STYLE> </HEAD> <BODY>
+<IMG SRC="Images/Title.png" ALT="Images/Title.png">
+<P>
+<A href="Manual.html">Back to main page</A>
+</P><P>
+</P><H1> Security information for David Forsgren Piuva's Software Renderer</H1><P></P><IMG SRC="Images/Border.png"><P>
+</P><H2> Purpose</H2><P>
+</P><P>
+The library is designed to stand the test of time when making software to be ported by future generations.Any attempts at security against hackers from a distant future with hundreds of years to study the source code and superior quantum processors to break your encryptions would be futile.</P><IMG SRC="Images/Border.png"><P>
+</P><H2> Design</H2><P>
+</P><P>
+Due to the flat design of the library (shallow call depth), applying browser grade security in every internal function would not be practical nor fast.Memory bound checks are removed in release builds for maximum performance.Your application should terminate if incorrect input caused an error to be thrown from the library, because resuming execution from a state which breaks the invariant means that correctness can no longer be guaranteed.</P><IMG SRC="Images/Border.png"><P>
+</P><H2> How to be "safe" (if such a thing can ever be acheived)</H2><P>
+</P><P>
+In order to be safe, you must either read all input from a reliable source (like a protected folder) or validate all input yourself before giving it to the library (no memory aliasing, extreme image dimensions, invalid file syntax...).Just preventing others from writing over binaries would not help, because the library does not have security against file corruption when loading media.Treat it like you would treat a fast low-level graphics API, don't give direct access to potential attackers.</P><IMG SRC="Images/Border.png"><P>
+</P>
+</BODY> </HTML>

+ 114 - 0
Doc/Starting.html

@@ -0,0 +1,114 @@
+<!DOCTYPE html> <HTML lang=en> <HEAD> <STYLE>
+body { background-color: #EEFFEE; font-size: 16px; font-family: Arial;
+       color: #000000; margin: 0px;
+       padding-left: 0px; padding-right: 0px;
+       padding-top: 0px; padding-bottom: 0px; }
+H1 { padding-left: 10px; padding-top: 10px; padding-bottom: 10px; font-size: 26px; }
+H2 { padding-left: 10px; padding-top: 10px;  font-size: 20px; }
+blockquote {
+  color: #FFFFFF; background: #000000;
+  font-size: 20px; font-family: monospace;
+  padding-left: 5px; padding-right: 5px;
+  padding-top: 5px; padding-bottom: 5px;
+}
+P { padding-left: 10px; }
+IMG { padding-left: 0px; padding-right: 0px;
+       padding-top: 0px; padding-bottom: 0px; }
+
+A { font-size: 18px; font-family: Arial; color: #0000A0; text-decoration: none; }
+A:hover { color: #000070; background: #AAffAA; }
+A:active { color: #00A0A0; }
+.normal { font-size: 18px; color: #00A0A0; }
+.sub { font-size: 18px; color: #ffffdf; }
+
+</STYLE> </HEAD> <BODY>
+<IMG SRC="Images/Title.png" ALT="Images/Title.png">
+<P>
+<A href="Manual.html">Back to main page</A>
+</P><P>
+</P><H1> Getting started</H1><P></P><IMG SRC="Images/Border.png"><P>
+</P><H2> Working in Linux</H2><P>
+</P><P>
+Place the library's root folder inside of a new folder. This gives room for the temporary object's folder, which will be created outside of the dfpsr folder when compiling.
+</P><P>
+<IMG SRC="Images/Warning.png" ALT="Warning">
+A light-weight Linux distribution, might require you to install GNU's compiler toolchain <B>"gcc"</B> and X11 headers <B>"libx11-dev"</B>.
+</P><P>
+<IMG SRC="Images/Warning.png" ALT="Warning">
+Big-endian support is only theoretical and has never actually been tested, because big-endian desktops were practically extinct when the library was created. If you happen to own such a rare museum item in working condition, sending the <B>DSR_BIG_ENDIAN</B> macro to compilation should activate the big-endian mode and shift the direction of bit shift meant to be equivalent with the address space.
+</P><P>
+</P><H2> Build and run an example program:</H2><P>
+</P><P>
+<IMG SRC="Images/SmallDot.png">
+Select an SDK example and open its folder in a terminal.
+</P><P>
+<IMG SRC="Images/SmallDot.png">
+Give permission to execute the build script.
+</P><P>
+<blockquote> chmod +x build.sh</blockquote>
+</P><P>
+<IMG SRC="Images/SmallDot.png">
+Run the build script.
+</P><P>
+<blockquote> ./build.sh</blockquote></P><H2> If no example runs, try regression tests to diagnose:</H2><P><IMG SRC="Images/SmallDot.png">
+Open the source folder in a terminal and run the test script:
+</P><P>
+<blockquote>chmod +x test.sh</blockquote>
+</P><P>
+<blockquote>./test.sh</blockquote>
+</P><P>
+This will stop with a clearly visible error message if any of the tests fail.
+</P><P>
+</P><H2> Create your own project</H2><P>
+</P><P>
+<IMG SRC="Images/SmallDot.png">
+Copy one of the SDK examples to use as a template.
+</P><P>
+<IMG SRC="Images/SmallDot.png">
+Change ROOT_PATH and TEMP_DIR in your build script to refer to the same locations from a new source path. If you don't use the build script, you can just delete it.
+</P><P>
+<IMG SRC="Images/SmallDot.png">
+Update header include paths to the library from the new folder location.
+</P><P>
+<IMG SRC="Images/SmallDot.png">
+Add your own external dependencies to LINKER_FLAGS within a quote with -l in front of each library name.
+</P><P>
+</P><H2> Create a command line application</H2><P>
+</P><P>
+If your application doesn't create any window, you can make it more portable by replacing "WINDOW_MANAGER=X11" with "WINDOW_MANAGER=NONE". This will compile with NoWindow.cpp instead of X11Window.cpp so that you cannot create a window.
+</P><P>
+</P><IMG SRC="Images/Border.png"><P>
+</P><H2> Compiling a project on Microsoft Windows</H2><P>
+</P><P>
+Create a project from existing code:
+</P><P>
+<IMG SRC="Images/SmallDot.png">
+Download a mingw edition of CodeBlocks from their website. <A href="http://www.codeblocks.org/downloads/26#windows">www.codeblocks.org/downloads</A>
+</P><P>
+<IMG SRC="Images/SmallDot.png">
+Start CodeBlocks with administrator rights and create a new Win32 project, just to get the correct libraries. You can then throw away the template main file.
+</P><P>
+<IMG SRC="Images/SmallDot.png">
+If not starting as an administrator, certain parts of the file system may lack necessary permissions needed for creating executable binaries.
+</P><P>
+<IMG SRC="Images/SmallDot.png">
+Select C++ 14 with G++ from the GCC toolchain, so that it will be compatible with the software renderer. Link with "-lm -pthread" to get standard C++ math and threading. This should be done for both debug and release.
+</P><P>
+<IMG SRC="Images/SmallDot.png">
+Import all source files from <B>dfpsr/Source/DFPSR</B>.
+</P><P>
+<IMG SRC="Images/SmallDot.png">
+Import all source files from <B>the project you want to build</B>.
+</P><P>
+<IMG SRC="Images/SmallDot.png">
+Import <B>dfpsr/Source/windowManagers/Win32Window.cpp</B>.
+</P><P>
+<IMG SRC="Images/SmallDot.png">
+Save your project, so that you can continue working on the project.
+</P><P>
+<IMG SRC="Images/SmallDot.png">
+Build and run the project.
+</P><P>
+This is not an ideal solution for development if you plan to have multiple projects depending on the same library. A better solution would be to compile the whole dfpsr folder into a static library, link to it in each of your projects and refer to includeFramework.h.</P><IMG SRC="Images/Border.png"><P>
+</P>
+</BODY> </HTML>

+ 45 - 0
Doc/StyleGuide.html

@@ -0,0 +1,45 @@
+<!DOCTYPE html> <HTML lang=en> <HEAD> <STYLE>
+body { background-color: #EEFFEE; font-size: 16px; font-family: Arial;
+       color: #000000; margin: 0px;
+       padding-left: 0px; padding-right: 0px;
+       padding-top: 0px; padding-bottom: 0px; }
+H1 { padding-left: 10px; padding-top: 10px; padding-bottom: 10px; font-size: 26px; }
+H2 { padding-left: 10px; padding-top: 10px;  font-size: 20px; }
+blockquote {
+  color: #FFFFFF; background: #000000;
+  font-size: 20px; font-family: monospace;
+  padding-left: 5px; padding-right: 5px;
+  padding-top: 5px; padding-bottom: 5px;
+}
+P { padding-left: 10px; }
+IMG { padding-left: 0px; padding-right: 0px;
+       padding-top: 0px; padding-bottom: 0px; }
+
+A { font-size: 18px; font-family: Arial; color: #0000A0; text-decoration: none; }
+A:hover { color: #000070; background: #AAffAA; }
+A:active { color: #00A0A0; }
+.normal { font-size: 18px; color: #00A0A0; }
+.sub { font-size: 18px; color: #ffffdf; }
+
+</STYLE> </HEAD> <BODY>
+<IMG SRC="Images/Title.png" ALT="Images/Title.png">
+<P>
+<A href="Manual.html">Back to main page</A>
+</P><P>
+</P><H1> Code convention for David Forsgren Piuva's Software Renderer</H1><P>
+</P><P>
+To keep the style consistent, the style being used in the library is explained in this document.</P><IMG SRC="Images/Border.png"><P>
+1. Use common sense! If it looks wrong to human readers then it's wrong. Don't defeat the purpose of any rule by taking it too far.</P><IMG SRC="Images/Border.png"><P>
+2. Don't use iterators when there is any other way to accomplish the task. You can't write efficient algorithms without knowing the data structures.</P><IMG SRC="Images/Border.png"><P>
+3. Tabs for indentation then spaces for alignment. It's the best of both worlds by both having variable length tabs	and correct alignment that works between lines of the same indentation.</P><IMG SRC="Images/Border.png"><P>
+4. No dangling else, use explicit {} for safety. Otherwise someone might add an extra statement and get random crashes.</P><IMG SRC="Images/Border.png"><P>
+5. No hpp extensions, use h for all headers. Could be either way, but this library uses *.h for compact naming, so keep it consistent.</P><IMG SRC="Images/Border.png"><P>
+6. C-style casting for raw data manipulation and C++-style for high-level classes.When using assembly intrinsics and raw pointer manipulation to alter the state of bits,verbose high-level abstractions only make it harder to count CPU cycles in your head.Always use the tool that makes sense for the problem you're trying to solve.C++ style is for things that are abstracted on a higher level.C style is for when a byte is just a byte and you just want to manipulate it in a specific way.</P><IMG SRC="Images/Border.png"><P>
+7. Don't call member methods with "this" set to nullptr.This would be undefined behaviour and may randomly crash.Use global functions instead. They allow checking pointers for nullbecause they are explicit arguments declared by the programmer.</P><IMG SRC="Images/Border.png"><P>
+8. Avoid using STD/STL directly in SDK examples.Exposing types from the standard library should be done using an alias or wrapper in the dsr namespace.This allow replacing the standard library without breaking backward compatibility.The C++ standard libraries have broken backward compatibility before and it can happen again.</P><IMG SRC="Images/Border.png"><P>
+9. Don't abuse the auto keyword everywhere just to make it look more "modern".Explicit type safety is what makes compiled languages safer than scripting.</P><IMG SRC="Images/Border.png"><P>
+10. No new line for opening brackets.Makes the code more compact and decreases the risk of copy-paste errors.</P><IMG SRC="Images/Border.png"><P>
+11. Don't fix the style of someone else's code if you can easily read it.Especially if there's no style rule explicitly supporting the change.Otherwise style changes will defeat the purpose by introducing more version conflicts.</P><IMG SRC="Images/Border.png"><P>
+12. Don't change things that you don't know how to test.</P><IMG SRC="Images/Border.png"><P>
+</P>
+</BODY> </HTML>