Jelajahi Sumber

Refactoring and documetation

Panagiotis Christopoulos Charitos 10 tahun lalu
induk
melakukan
adde4d98bc

+ 14 - 14
CMakeLists.txt

@@ -190,20 +190,6 @@ message("++ Lib install dir: ${LIB_INSTALL_DIR}")
 #
 add_subdirectory(thirdparty)
 
-#
-# Doxygen
-#
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/docs/doxyfile ${CMAKE_CURRENT_BINARY_DIR}/doxyfile @ONLY)
-
-find_package(Doxygen)
-
-if(DOXYGEN_FOUND)
-	message("++ Doxygen found")
-
-	add_custom_target(doc ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/doxyfile WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
-		COMMENT "Generating API documentation with Doxygen" VERBATIM)
-endif()
-
 #
 # Revision
 #
@@ -221,6 +207,20 @@ else()
 	set(ANKI_REVISION "\"unknown\"")
 endif()
 
+#
+# Doxygen
+#
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/docs/doxyfile ${CMAKE_CURRENT_BINARY_DIR}/doxyfile @ONLY)
+
+find_package(Doxygen)
+
+if(DOXYGEN_FOUND)
+	message("++ Doxygen found")
+
+	add_custom_target(doc ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/doxyfile WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+		COMMENT "Generating API documentation with Doxygen" VERBATIM)
+endif()
+
 #
 # Config.h
 #

File diff ditekan karena terlalu besar
+ 510 - 379
docs/doxyfile


+ 0 - 15
docs/doxygen.html

@@ -1,15 +0,0 @@
-<html>
-<head>
-<script type="text/javascript">
-<!--
-function redirect(){
-	window.location = "doxygen-html/index.html"
-}
-//-->
-</script>
-</head>
-<body onLoad="redirect()">
-</body>
-</html>
-
-

+ 0 - 1
docs/gen-manual.html.sh

@@ -1 +0,0 @@
-rst2html manual > manual.html

+ 0 - 585
docs/manual.html

@@ -1,585 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<meta name="generator" content="Docutils 0.5: http://docutils.sourceforge.net/" />
-<title></title>
-<style type="text/css">
-
-/*
-:Author: David Goodger ([email protected])
-:Id: $Id: html4css1.css 5196 2007-06-03 20:25:28Z wiemann $
-:Copyright: This stylesheet has been placed in the public domain.
-
-Default cascading style sheet for the HTML output of Docutils.
-
-See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
-customize this style sheet.
-*/
-
-/* used to remove borders from tables and images */
-.borderless, table.borderless td, table.borderless th {
-  border: 0 }
-
-table.borderless td, table.borderless th {
-  /* Override padding for "table.docutils td" with "! important".
-     The right padding separates the table cells. */
-  padding: 0 0.5em 0 0 ! important }
-
-.first {
-  /* Override more specific margin styles with "! important". */
-  margin-top: 0 ! important }
-
-.last, .with-subtitle {
-  margin-bottom: 0 ! important }
-
-.hidden {
-  display: none }
-
-a.toc-backref {
-  text-decoration: none ;
-  color: black }
-
-blockquote.epigraph {
-  margin: 2em 5em ; }
-
-dl.docutils dd {
-  margin-bottom: 0.5em }
-
-/* Uncomment (and remove this text!) to get bold-faced definition list terms
-dl.docutils dt {
-  font-weight: bold }
-*/
-
-div.abstract {
-  margin: 2em 5em }
-
-div.abstract p.topic-title {
-  font-weight: bold ;
-  text-align: center }
-
-div.admonition, div.attention, div.caution, div.danger, div.error,
-div.hint, div.important, div.note, div.tip, div.warning {
-  margin: 2em ;
-  border: medium outset ;
-  padding: 1em }
-
-div.admonition p.admonition-title, div.hint p.admonition-title,
-div.important p.admonition-title, div.note p.admonition-title,
-div.tip p.admonition-title {
-  font-weight: bold ;
-  font-family: sans-serif }
-
-div.attention p.admonition-title, div.caution p.admonition-title,
-div.danger p.admonition-title, div.error p.admonition-title,
-div.warning p.admonition-title {
-  color: red ;
-  font-weight: bold ;
-  font-family: sans-serif }
-
-/* Uncomment (and remove this text!) to get reduced vertical space in
-   compound paragraphs.
-div.compound .compound-first, div.compound .compound-middle {
-  margin-bottom: 0.5em }
-
-div.compound .compound-last, div.compound .compound-middle {
-  margin-top: 0.5em }
-*/
-
-div.dedication {
-  margin: 2em 5em ;
-  text-align: center ;
-  font-style: italic }
-
-div.dedication p.topic-title {
-  font-weight: bold ;
-  font-style: normal }
-
-div.figure {
-  margin-left: 2em ;
-  margin-right: 2em }
-
-div.footer, div.header {
-  clear: both;
-  font-size: smaller }
-
-div.line-block {
-  display: block ;
-  margin-top: 1em ;
-  margin-bottom: 1em }
-
-div.line-block div.line-block {
-  margin-top: 0 ;
-  margin-bottom: 0 ;
-  margin-left: 1.5em }
-
-div.sidebar {
-  margin: 0 0 0.5em 1em ;
-  border: medium outset ;
-  padding: 1em ;
-  background-color: #ffffee ;
-  width: 40% ;
-  float: right ;
-  clear: right }
-
-div.sidebar p.rubric {
-  font-family: sans-serif ;
-  font-size: medium }
-
-div.system-messages {
-  margin: 5em }
-
-div.system-messages h1 {
-  color: red }
-
-div.system-message {
-  border: medium outset ;
-  padding: 1em }
-
-div.system-message p.system-message-title {
-  color: red ;
-  font-weight: bold }
-
-div.topic {
-  margin: 2em }
-
-h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
-h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
-  margin-top: 0.4em }
-
-h1.title {
-  text-align: center }
-
-h2.subtitle {
-  text-align: center }
-
-hr.docutils {
-  width: 75% }
-
-img.align-left {
-  clear: left }
-
-img.align-right {
-  clear: right }
-
-ol.simple, ul.simple {
-  margin-bottom: 1em }
-
-ol.arabic {
-  list-style: decimal }
-
-ol.loweralpha {
-  list-style: lower-alpha }
-
-ol.upperalpha {
-  list-style: upper-alpha }
-
-ol.lowerroman {
-  list-style: lower-roman }
-
-ol.upperroman {
-  list-style: upper-roman }
-
-p.attribution {
-  text-align: right ;
-  margin-left: 50% }
-
-p.caption {
-  font-style: italic }
-
-p.credits {
-  font-style: italic ;
-  font-size: smaller }
-
-p.label {
-  white-space: nowrap }
-
-p.rubric {
-  font-weight: bold ;
-  font-size: larger ;
-  color: maroon ;
-  text-align: center }
-
-p.sidebar-title {
-  font-family: sans-serif ;
-  font-weight: bold ;
-  font-size: larger }
-
-p.sidebar-subtitle {
-  font-family: sans-serif ;
-  font-weight: bold }
-
-p.topic-title {
-  font-weight: bold }
-
-pre.address {
-  margin-bottom: 0 ;
-  margin-top: 0 ;
-  font-family: serif ;
-  font-size: 100% }
-
-pre.literal-block, pre.doctest-block {
-  margin-left: 2em ;
-  margin-right: 2em }
-
-span.classifier {
-  font-family: sans-serif ;
-  font-style: oblique }
-
-span.classifier-delimiter {
-  font-family: sans-serif ;
-  font-weight: bold }
-
-span.interpreted {
-  font-family: sans-serif }
-
-span.option {
-  white-space: nowrap }
-
-span.pre {
-  white-space: pre }
-
-span.problematic {
-  color: red }
-
-span.section-subtitle {
-  /* font-size relative to parent (h1..h6 element) */
-  font-size: 80% }
-
-table.citation {
-  border-left: solid 1px gray;
-  margin-left: 1px }
-
-table.docinfo {
-  margin: 2em 4em }
-
-table.docutils {
-  margin-top: 0.5em ;
-  margin-bottom: 0.5em }
-
-table.footnote {
-  border-left: solid 1px black;
-  margin-left: 1px }
-
-table.docutils td, table.docutils th,
-table.docinfo td, table.docinfo th {
-  padding-left: 0.5em ;
-  padding-right: 0.5em ;
-  vertical-align: top }
-
-table.docutils th.field-name, table.docinfo th.docinfo-name {
-  font-weight: bold ;
-  text-align: left ;
-  white-space: nowrap ;
-  padding-left: 0 }
-
-h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
-h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
-  font-size: 100% }
-
-ul.auto-toc {
-  list-style-type: none }
-
-</style>
-</head>
-<body>
-<div class="document">
-
-
-<p><strong>AnKi 3D Engine</strong></p>
-<p>Copyright (C) 2009-2011 Panagiotis Christopoulos-Charitos</p>
-<p><a class="reference external" href="http://www.anki3d.org">http://www.anki3d.org</a></p>
-<p><a class="reference external" href="mailto:godlike&#64;ancient-ritual.com">godlike&#64;ancient-ritual.com</a></p>
-<div class="contents topic" id="table-of-contents">
-<p class="topic-title first">Table of Contents</p>
-<ul class="simple">
-<li><a class="reference internal" href="#license" id="id1">License</a></li>
-<li><a class="reference internal" href="#building" id="id2">Building</a><ul>
-<li><a class="reference internal" href="#required-external-libraries" id="id3">Required external libraries</a></li>
-<li><a class="reference internal" href="#building-anki-and-optionally-generating-makefiles" id="id4">Building AnKi and optionally generating makefiles</a></li>
-</ul>
-</li>
-<li><a class="reference internal" href="#assets" id="id5">Assets</a></li>
-<li><a class="reference internal" href="#system-requirements" id="id6">System requirements</a></li>
-<li><a class="reference internal" href="#generating-source-code-documentation-doxygen" id="id7">Generating source code documentation (doxygen)</a></li>
-<li><a class="reference internal" href="#coding-style" id="id8">Coding style</a><ul>
-<li><a class="reference internal" href="#types" id="id9">Types</a></li>
-<li><a class="reference internal" href="#functions-variables" id="id10">Functions &amp; variables</a></li>
-<li><a class="reference internal" href="#constants-macros-enumerators" id="id11">Constants, macros &amp; enumerators</a></li>
-<li><a class="reference internal" href="#parenthesis-braces-comas-operators" id="id12">Parenthesis, braces, comas &amp; operators</a></li>
-<li><a class="reference internal" href="#order-in-class-definitions" id="id13">Order in class definitions</a></li>
-<li><a class="reference internal" href="#naming-shortcuts" id="id14">Naming shortcuts</a></li>
-<li><a class="reference internal" href="#controllers" id="id15">Controllers</a></li>
-<li><a class="reference internal" href="#glsl-shaders" id="id16">GLSL shaders</a></li>
-<li><a class="reference internal" href="#submitting-patches" id="id17">Submitting patches</a></li>
-</ul>
-</li>
-<li><a class="reference internal" href="#todo-list" id="id18">ToDo list</a></li>
-</ul>
-</div>
-<div class="section" id="license">
-<h1><a class="toc-backref" href="#id1">License</a></h1>
-<p>Anki is dual licensed. The first option is GLPv3 and the second commercial
-license. If you want to use* AnKi to make opensource software (licensed under
-GLPv3) then AnKi is provited to you for free but if you want to use it* for
-non-GPLv3 licensed software then you have to apply for a commercial license.</p>
-<p>*: as a whole or parts of the source</p>
-</div>
-<div class="section" id="building">
-<h1><a class="toc-backref" href="#id2">Building</a></h1>
-<p>AnKi build system is build over the popular CMake.</p>
-<p>To download the latest version of AnKi from the SVN repository type:</p>
-<pre class="literal-block">
-svn checkout http://anki-3d-engine.googlecode.com/svn/trunk/ anki
-</pre>
-<p>to build:</p>
-<div class="section" id="required-external-libraries">
-<h2><a class="toc-backref" href="#id3">Required external libraries</a></h2>
-<p>AnKi requires a few up to date versions of some libraries. The libraries are:</p>
-<ul class="simple">
-<li>Bullet Physics 2.77 (in extern)</li>
-<li>SDL 1.3 (in extern)</li>
-<li>GLEW 1.5.5 (in extern)</li>
-<li>boost 1.46</li>
-<li>libpng 1.2</li>
-<li>libjpeg 6b</li>
-<li>libpython 2.6</li>
-</ul>
-<p>Normally, in order to build AnKi you need to have all of the above libraries.
-Some of them are not that common and</p>
-<p>Some of them are not provided from the most Linux distros or they are older
-versions. The libraries you have to download and build for yourself are Bullet,
-SDL and GLEW. The other are pretty common and you can find them almost anywhere.</p>
-<p>To ease the building process and to save you some time <strong>some</strong> of the above
-libraries are already backed and placed inside the extern directory. The backed
-libraries are for Linux and for x86-64 architecture. If you dont trust my
-binaries and/or you want to build the libs yourselves you have to download,
-build and install the libs in the extern directory manually. The script
-<em>download-externs.sh</em> downloads the libraries (it requires SVN, mercurial,
-CMake, autoconf) and the <em>do-externs.sh</em> builds the libraries and installs them
-in the extern directory. Open the files and see how it is done.</p>
-<p>You wont find any development files for boost, libpng, libjpeg and libpython
-inside the extern dir. Get them using your Linux distribution's packet manager.</p>
-</div>
-<div class="section" id="building-anki-and-optionally-generating-makefiles">
-<h2><a class="toc-backref" href="#id4">Building AnKi and optionally generating makefiles</a></h2>
-<p>Inside the build directory you can find 4 build targets containing GNU
-makefiles. If you want to build AnKi just type &quot;make&quot; from inside a target.</p>
-<p><strong>WARNING</strong>: Sometimes I forget to update all the targets. The debug is always
-updated though.</p>
-<p>AnKi uses a build system that generates the above makefiles. This build system
-is no longer part of AnKi and its located in a different repository. This tool
-is called gBuildSystem and you can find it in
-<a class="reference external" href="http://godlike-projects.googlecode.com/svn/trunk/gBuildSystem">http://godlike-projects.googlecode.com/svn/trunk/gBuildSystem</a>. Downloaded it
-using SVN:</p>
-<p>$ svn checkout <a class="reference external" href="http://godlike-projects.googlecode.com/svn/trunk/gBuildSystem">http://godlike-projects.googlecode.com/svn/trunk/gBuildSystem</a></p>
-<p>gBuildSystem only purpose is to re-generate these makefiles in case you have
-made changes in the code structure (renaming/moving/deleting/adding files) or in
-the included header files (#include) or your have the external libs in different
-paths. gBuildSystem requires the gen.cfg.py files (something like
-CMakeLists.txt). gen.cfg.py format is pretty straightforward and minimal.</p>
-<p>If you want to generate the makefile for the debug target (for example) do the
-following:</p>
-<ol class="arabic simple">
-<li>$ cd &lt;path to anki&gt;/build/debug</li>
-<li>$ &lt;path to gBuildSystem&gt;/gbs.py</li>
-</ol>
-<p>To build:</p>
-<p>$ make</p>
-<p>And the build process will begin.</p>
-</div>
-</div>
-<div class="section" id="assets">
-<h1><a class="toc-backref" href="#id5">Assets</a></h1>
-<p>Currently there are no assets (models, textures, materials etc) so even if you
-build it, the application will fail to run.</p>
-</div>
-<div class="section" id="system-requirements">
-<h1><a class="toc-backref" href="#id6">System requirements</a></h1>
-<p>The engine requires:</p>
-<ul class="simple">
-<li>GPU with shader model 4</li>
-<li>Linux OS</li>
-<li>Proprietary GPU drivers</li>
-</ul>
-<p>Development rig: Ubuntu 10.10, AMD Radeon 4870 w/ Catalyst 10.10. So it should
-be working on similar systems.</p>
-</div>
-<div class="section" id="generating-source-code-documentation-doxygen">
-<h1><a class="toc-backref" href="#id7">Generating source code documentation (doxygen)</a></h1>
-<p>The AnKi source code uses doxygen style comments in almost every file. To
-generate the documentation you need doxygen (<a class="reference external" href="http://www.doxygen.org/">http://www.doxygen.org/</a>). From a
-terminal type:</p>
-<ol class="arabic simple">
-<li>$ cd docs</li>
-<li>$ doxygen doxyfile</li>
-</ol>
-<p>Then open doxygen.html to see it.</p>
-</div>
-<div class="section" id="coding-style">
-<h1><a class="toc-backref" href="#id8">Coding style</a></h1>
-<p>Every project has some rules and here are some things to remember while coding
-AnKi.</p>
-<div class="section" id="types">
-<h2><a class="toc-backref" href="#id9">Types</a></h2>
-<p>The classes, structs, typedefs, enums etc must be capitalized eg <em>ThisIsAClass</em></p>
-</div>
-<div class="section" id="functions-variables">
-<h2><a class="toc-backref" href="#id10">Functions &amp; variables</a></h2>
-<p>All functions (including class methods) and all variables are mixed case.</p>
-<p>All functions should have a verb inside them eg <em>doSomething()</em></p>
-<p>All variables should not have verbs eg <em>oneVariable</em></p>
-</div>
-<div class="section" id="constants-macros-enumerators">
-<h2><a class="toc-backref" href="#id11">Constants, macros &amp; enumerators</a></h2>
-<p>All constants, macros and enumerators are capital with undercores eg <em>#define
-MACRO(x)</em> or <em>const int ONE_INT = 10;</em></p>
-<p>All the constants should be defined without using the preprocessor eg dont write
-<em>#define ONE_INT 10</em></p>
-<p>All enumerators have the first letters of the enum as prefix eg
-<em>enum CarColors { CC_BLUE, CC_GREEN };</em></p>
-</div>
-<div class="section" id="parenthesis-braces-comas-operators">
-<h2><a class="toc-backref" href="#id12">Parenthesis, braces, comas &amp; operators</a></h2>
-<p>After opening parenthesis and before closing it there is no spaces, same for
-square brackets. Before and after an operator there is always a space</p>
-<p>eg <em>((mat1 * 10) + 10)</em> or <em>setWidth(100)</em> or <em>int arr[100 + 1];</em></p>
-<p>After a coma there is a space eg <em>setSize(10, 20)</em></p>
-</div>
-<div class="section" id="order-in-class-definitions">
-<h2><a class="toc-backref" href="#id13">Order in class definitions</a></h2>
-<p>class</p>
-<p>{</p>
-<blockquote>
-<p>friends</p>
-<p>pre-nested (very rare)</p>
-<p>nested</p>
-<p>properties</p>
-<p>public</p>
-<p>protected</p>
-<p>private</p>
-</blockquote>
-<p>}</p>
-<p>inlines</p>
-</div>
-<div class="section" id="naming-shortcuts">
-<h2><a class="toc-backref" href="#id14">Naming shortcuts</a></h2>
-<p>This list contains some of the naming shortcuts we use in AnKi. This is because
-we are bored to type:</p>
-<ul class="simple">
-<li>Array                        : arr</li>
-<li>Animation                    : anim</li>
-<li>Application                  : app</li>
-<li>Buffer                       : buff</li>
-<li>Camera                       : cam</li>
-<li>Color                        : col</li>
-<li>Controller                   : ctrl</li>
-<li>Current                      : crnt</li>
-<li>Feature                      : feat</li>
-<li>Fragment                     : frag</li>
-<li>Framebuffer Attachable Image : fai</li>
-<li>Geometry                     : geom</li>
-<li>Location                     : loc</li>
-<li>Material                     : mtl</li>
-<li>Matrix                       : mat</li>
-<li>Number                       : num</li>
-<li>Physics                      : phy</li>
-<li>Position                     : pos</li>
-<li>Property                     : prop</li>
-<li>Quadrilateral                : quad</li>
-<li>Quaternion                   : quat</li>
-<li>Resource                     : rsrc</li>
-<li>Rotation                     : rot</li>
-<li>Shader                       : shdr</li>
-<li>Shader Program               : shaderProg or sProg</li>
-<li>Skeletal Animation           : sAnim</li>
-<li>Skeleton                     : skel</li>
-<li>Text                         : txt</li>
-<li>Texture                      : tex</li>
-<li>Transformation               : trf</li>
-<li>Transform Feedback           : trffb</li>
-<li>Translation                  : tsl</li>
-<li>Triangle                     : tri</li>
-<li>Utility                      : util</li>
-<li>Variable                     : var</li>
-<li>Vector                       : vec</li>
-<li>Vertex                       : vert</li>
-</ul>
-<p>Anything else should be typed full.</p>
-</div>
-<div class="section" id="controllers">
-<h2><a class="toc-backref" href="#id15">Controllers</a></h2>
-<p>The controllers are part of the scene node objects. They control the node's
-behaviour.</p>
-<p>They have an input (script, animation, etc) and they control a scene node. The
-naming convention of the controllers is:</p>
-<p>&lt;what the controller controls&gt;&lt;the input of the contoller&gt;Ctrl</p>
-<p>For Example:</p>
-<p>MeshSkelNodeCtrl A Mesh is controlled by a SkelNode</p>
-</div>
-<div class="section" id="glsl-shaders">
-<h2><a class="toc-backref" href="#id16">GLSL shaders</a></h2>
-<p>The same rules apply to GLSL shaders but with a few changes:</p>
-<p>All the vars you can find in a GLSL shader program are either attributes,
-uniforms or in/out vars (varyings) and everything else. The attributes and
-uniforms are mixed case. The in/out vars are mixed case as well but they have a
-prefix string that indicates their output. For example if a var is output from
-the vertex shader it will have a 'v' before its name. The In detail:</p>
-<p>v: Vertex shader
-tc: Tessellation control shader
-te: Tessellation evaluation shader
-g: Geometry shader
-f: Fragment shader</p>
-<p>All the other variables (locals and globals) inside the code are mixed case but
-with a leading and a following underscore.</p>
-</div>
-<div class="section" id="submitting-patches">
-<h2><a class="toc-backref" href="#id17">Submitting patches</a></h2>
-<p>If you want to update/patch a file (for example Main.cpp) do:</p>
-<ul class="simple">
-<li>Make the changes on that file</li>
-<li>Save the differences in a file using &quot;svn diff Main.cpp &gt; /tmp/diff&quot;</li>
-<li>E-mail the &quot;diff&quot; file with subject &quot;[PATCH] Main.cpp updates&quot;</li>
-</ul>
-</div>
-</div>
-<div class="section" id="todo-list">
-<h1><a class="toc-backref" href="#id18">ToDo list</a></h1>
-<ul>
-<li><p class="first">Continue working on the new coding style in shaders</p>
-</li>
-<li><p class="first">Changes in the blending objects problem. The BS will become one stage and the
-PPS will be divided in two steps. The first will apply the SSAO and the EdgeAA
-in the IS_FAI and the second will do the rest</p>
-</li>
-<li><p class="first">The second Physics demo: Create a box that is geting moved by the user. It has
-to interact with the other boxes</p>
-</li>
-<li><p class="first">Set the gravity of a certain body to a lower value and see how it behaves</p>
-</li>
-<li><p class="first">In the Ragdoll bullet demo try to change the distances of the bodies</p>
-</li>
-<li><dl class="first docutils">
-<dt>Ask in the bullet forum:</dt>
-<dd><ul class="first last simple">
-<li>How to make floating particles like smoke. But first try with one body and
-manualy setting the gravity</li>
-<li>What the btCollisionObject::setActivationState takes as parameter?</li>
-</ul>
-</dd>
-</dl>
-</li>
-<li><p class="first">Re-enable the stencil tex in Ms.cpp and replace all the stencil buffers with
-that (Smo, Bs) to save memory</p>
-</li>
-<li><p class="first">See if the restrictions in FBOs (all FAIs same size) still apply</p>
-</li>
-<li><p class="first">See what happens if I write <em>#pragma anki attribute &lt;randName&gt; 10</em> where
-randName does not exist. Do the same for tranform feedback varyings</p>
-</li>
-</ul>
-</div>
-</div>
-</body>
-</html>

+ 0 - 268
docs/manual.rst

@@ -1,268 +0,0 @@
-**AnKi 3D Engine**
-
-Copyright (C) 2009-2013 Panagiotis Christopoulos-Charitos
-
-http://www.anki3d.org
-
[email protected]
-
-.. contents:: Table of Contents
-
-
-=======
-License
-=======
-
-Anki is dual licensed. Simply put, you can use* it freely to create opensource 
-software under GPLv3 and if you want to use* it for commercial you need to 
-apply for a commercial licence. 
-
-\*: as a whole or parts of the source
-
-
-========
-Building
-========
-
-AnKi build system is build over the popular CMake.
-
-To download the latest version of AnKi from the SVN repository type: ::
-
-	svn checkout http://anki-3d-engine.googlecode.com/svn/trunk/ anki
-
-to build: ::
-
-	cd path/to/anki
-	cd build
-	cmake -DCMAKE_BUILD_TYPE=Release ..
-	make
-
-to build the doxygen documentation: ::
-
-	make doc
-
-
-Required external libraries
----------------------------
-
-A great effort was made to keep the number of external dependencies to minimum 
-so the only prerequisites are the following:
-
-- X11 development files (Package name under Ubuntu: libx11-dev)
-- Mesa GL development files (Package name under Ubuntu: mesa-common-dev)
-
-All the other libraries are inside the source tree and you don't have to worry
-about them.
-
-======
-Assets
-======
-
-Currently there are no assets (models, textures, materials etc) so even if you
-build it, the application will fail to run.
-
-
-===================
-System requirements
-===================
-
-The engine requires:
-
-- GPU with shader model 4
-- Linux OS
-- Proprietary GPU drivers
-
-Development rig: Ubuntu 11.10, nVidia 560 Ti. So it should be working on 
-similar systems.
-  
-
-============
-Coding style
-============
-
-Every project has some rules and here are some things to remember while coding
-AnKi.
-
-
-Types
------
-
-The classes, structs, typedefs, enums etc must be capitalized eg *ThisIsAClass*
-
-
-Functions & variables
----------------------
-
-All functions (including class methods) and all variables are mixed case.
-
-All functions should have a verb inside them eg *doSomething()*
-
-All variables should not have verbs eg *oneVariable*
-
-
-Constants, macros & enumerators
--------------------------------
-
-All constants, macros and enumerators are capital with undercores eg *#define 
-MACRO(x)* or *const int ONE_INT = 10;*
-
-All the constants should be defined without using the preprocessor eg dont write
-*#define ONE_INT 10*
-
-All enumerators have the first letters of the enum as prefix eg
-*enum CarColors { CC_BLUE, CC_GREEN };*
-
-
-Parenthesis, braces, comas & operators
---------------------------------------
-
-After opening parenthesis and before closing it there is no spaces, same for
-square brackets. Before and after an operator there is always a space
-
-eg *((mat1 * 10) + 10)* or *setWidth(100)* or *int arr[100 + 1];*
-
-After a coma there is a space eg *setSize(10, 20)*
-
-
-Order in class definitions
---------------------------
-
-class 
-
-{
-
-  friends
-	
-  pre-nested (very rare)
-	
-  nested
-	
-  properties
-	
-  public
-	
-  protected
-	
-  private 
-	
-}
-
-inlines
-
-
-Naming shortcuts
-----------------
-
-This list contains some of the naming shortcuts we use in AnKi. This is because
-we are bored to type:
-
-- Array                        : arr
-- Animation                    : anim
-- Application                  : app
-- Buffer                       : buff
-- Camera                       : cam
-- Color                        : col
-- Controller                   : ctrl
-- Current                      : crnt
-- Feature                      : feat
-- Fragment                     : frag
-- Framebuffer Attachable Image : fai
-- Geometry                     : geom
-- Location                     : loc
-- Material                     : mtl
-- Matrix                       : mat
-- Number                       : num
-- Physics                      : phy
-- Position                     : pos
-- Property                     : prop
-- Quadrilateral                : quad
-- Quaternion                   : quat
-- Resource                     : rsrc
-- Rotation                     : rot
-- Shader                       : shdr
-- Shader Program               : shaderProg or sProg
-- Skeletal Animation           : sAnim
-- Skeleton                     : skel
-- Text                         : txt
-- Texture                      : tex
-- Transformation               : trf
-- Transform Feedback           : trffb
-- Translation                  : tsl
-- Triangle                     : tri
-- Utility                      : util
-- Variable                     : var
-- Vector                       : vec
-- Vertex                       : vert
-
-Anything else should be typed full.
-
-
-Controllers
------------
-
-The controllers are part of the scene node objects. They control the node's
-behaviour. 
-
-They have an input (script, animation, etc) and they control a scene node. The
-naming convention of the controllers is:
-
-<what the controller controls><the input of the contoller>Ctrl
-
-For Example:
-
-MeshSkelNodeCtrl A Mesh is controlled by a SkelNode
-
-
-GLSL shaders
-------------
-
-The same rules apply to GLSL shaders but with a few changes:
-
-All the vars you can find in a GLSL shader program are either attributes,
-uniforms or in/out vars (varyings) and everything else. The attributes and
-uniforms are mixed case. The in/out vars are mixed case as well but they have a
-prefix string that indicates their output. For example if a var is output from
-the vertex shader it will have a 'v' before its name. The In detail:
-
-v: Vertex shader
-tc: Tessellation control shader
-te: Tessellation evaluation shader
-g: Geometry shader
-f: Fragment shader
-
-All the other variables (locals and globals) inside the code are mixed case but
-with a leading and a following underscore. 
-
-
-Submitting patches
-------------------
-
-If you want to update/patch a file (for example Main.cpp) do:
-
-- Make the changes on that file
-- Save the differences in a file using "svn diff Main.cpp > /tmp/diff"
-- E-mail the "diff" file with subject "[PATCH] Main.cpp updates"
-
-
-=========
-ToDo list
-=========
-
-- Continue working on the new coding style in shaders
-- Changes in the blending objects problem. The BS will become one stage and the
-  PPS will be divided in two steps. The first will apply the SSAO and the EdgeAA
-  in the IS_FAI and the second will do the rest
-- The second Physics demo: Create a box that is geting moved by the user. It has
-  to interact with the other boxes
-- Set the gravity of a certain body to a lower value and see how it behaves
-- In the Ragdoll bullet demo try to change the distances of the bodies
-- Ask in the bullet forum:
-	- How to make floating particles like smoke. But first try with one body and
-	  manualy setting the gravity
-	- What the btCollisionObject::setActivationState takes as parameter?
-- Re-enable the stencil tex in Ms.cpp and replace all the stencil buffers with
-  that (Smo, Bs) to save memory
-- See if the restrictions in FBOs (all FAIs same size) still apply
-- See what happens if I write *#pragma anki attribute <randName> 10* where
-  randName does not exist. Do the same for tranform feedback varyings
-  

TEMPAT SAMPAH
docs/renderer-flow.odg


TEMPAT SAMPAH
docs/resources.odg


+ 0 - 21
docs/todo

@@ -1,21 +0,0 @@
-
-=======
-Pending
-=======
-
-====
-Done
-====
-
-- For the main renderer dont use final stage. Just make PPS to write to the FB
-  Maybe though do that only when the rendering quality is 1.0 else you will have
-  more blending ops to do
-- Put uniform buffers everywhere
-- Move to GLES3
-	- Remove all boost
-	- Remove the readPixels from the Texture
-	- Do something about bullet
-	- Create FBDEV backend
-- Interleaved geometry
-- See if you can have 2 FAIs instead of 3 on SSAO and HDR
-

+ 2 - 3
include/anki/gr/GrManager.h

@@ -54,8 +54,7 @@ public:
 	template<typename T, typename... Args>
 	IntrusivePtr<T> newInstance(Args&&... args);
 
-	/// @privatesection
-	/// @{
+#ifdef ANKI_BUILD
 	GrAllocator<U8>& getAllocator()
 	{
 		return m_alloc;
@@ -75,7 +74,7 @@ public:
 	{
 		return m_cacheDir.toCString();
 	}
-	/// @}
+#endif
 
 private:
 	GrAllocator<U8> m_alloc; ///< Keep it first to get deleted last

+ 1 - 1
include/anki/gr/gl/Error.h

@@ -9,7 +9,7 @@
 
 namespace anki {
 
-/// @addtogroup opengl_private
+/// @addtogroup opengl
 /// @{
 
 // Enable the exception on debug. Calling glGetError calls serialization

+ 2 - 5
include/anki/physics/PhysicsDrawer.h

@@ -3,8 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#ifndef ANKI_PHYSICS_PHYSICS_DRAWER_H
-#define ANKI_PHYSICS_PHYSICS_DRAWER_H
+#pragma once
 
 #include "anki/physics/Common.h"
 #include "anki/util/Bitset.h"
@@ -56,12 +55,10 @@ private:
 	void drawAabb(const NewtonBody* body);
 	void drawCollision(const NewtonBody* body);
 
-	static void drawGeometryCallback(void* userData, 
+	static void drawGeometryCallback(void* userData,
 		int vertexCount, const dFloat* const faceVertec, int id);
 };
 /// @}
 
 } // end namespace anki
 
-#endif
-

+ 12 - 12
include/anki/renderer/Bloom.h

@@ -22,6 +22,7 @@ class ShaderProgram;
 class Bloom: public RenderingPass
 {
 public:
+#ifdef ANKI_BUILD
 	static const PixelFormat RT_PIXEL_FORMAT;
 
 	Bloom(Renderer* r)
@@ -33,17 +34,6 @@ public:
 	ANKI_USE_RESULT Error init(const ConfigSet& initializer);
 	void run(CommandBufferPtr& jobs);
 
-	U32 getBlurringIterationsCount() const
-	{
-		return m_blurringIterationsCount;
-	}
-	void setBlurringIterationsCount(const U32 x)
-	{
-		m_blurringIterationsCount = x;
-	}
-
-	/// @privatesection
-	/// @{
 	TexturePtr& getRt()
 	{
 		return m_vblurRt;
@@ -58,7 +48,17 @@ public:
 	{
 		return m_height;
 	}
-	/// @}
+#endif
+
+	U32 getBlurringIterationsCount() const
+	{
+		return m_blurringIterationsCount;
+	}
+
+	void setBlurringIterationsCount(const U32 x)
+	{
+		m_blurringIterationsCount = x;
+	}
 
 private:
 	U32 m_width, m_height;

+ 1 - 3
include/anki/renderer/Dbg.h

@@ -41,9 +41,7 @@ public:
 
 	/// @privatesection
 	/// @{
-	Dbg(Renderer* r)
-		: RenderingPass(r)
-	{}
+	Dbg(Renderer* r);
 
 	~Dbg();
 

+ 2 - 0
include/anki/renderer/Fs.h

@@ -16,6 +16,7 @@ namespace anki {
 class Fs: public RenderingPass
 {
 public:
+#ifdef ANKI_BUILD
 	Fs(Renderer* r)
 		: RenderingPass(r)
 	{}
@@ -24,6 +25,7 @@ public:
 
 	ANKI_USE_RESULT Error init(const ConfigSet& initializer);
 	ANKI_USE_RESULT Error run(CommandBufferPtr& cmdb);
+#endif
 
 private:
 	FramebufferPtr m_fb;

+ 2 - 3
include/anki/renderer/Is.h

@@ -39,10 +39,9 @@ class Is: public RenderingPass
 
 public:
 	static const U MIPMAPS_COUNT = 7;
+#ifdef ANKI_BUILD
 	static const PixelFormat RT_PIXEL_FORMAT;
 
-	/// @privatesection
-	/// @{
 	Is(Renderer* r);
 
 	~Is();
@@ -65,7 +64,7 @@ public:
 	{
 		m_ambientColor = color;
 	}
-	/// @}
+#endif
 
 private:
 	enum

+ 3 - 3
include/anki/renderer/Lf.h

@@ -19,20 +19,20 @@ namespace anki {
 class Lf: public RenderingPass
 {
 public:
-	/// @privatesection
-	/// @{
+#ifdef ANKI_BUILD
 	Lf(Renderer* r)
 		: RenderingPass(r)
 	{}
 
 	~Lf();
 
+
 	ANKI_USE_RESULT Error init(const ConfigSet& config);
 
 	void runOcclusionTests(CommandBufferPtr& cmdb);
 
 	void run(CommandBufferPtr& cmdb);
-	/// @}
+#endif
 
 private:
 	// Occlusion query

+ 2 - 3
include/anki/renderer/Ms.h

@@ -17,12 +17,11 @@ namespace anki {
 class Ms: public RenderingPass
 {
 public:
+#ifdef ANKI_BUILD
 	static const U ATTACHMENT_COUNT = 3;
 	static const Array<PixelFormat, ATTACHMENT_COUNT> RT_PIXEL_FORMATS;
 	static const PixelFormat DEPTH_RT_PIXEL_FORMAT;
 
-	/// @privatesection
-	/// @{
 	Ms(Renderer* r)
 		: RenderingPass(r)
 	{}
@@ -59,7 +58,7 @@ public:
 	}
 
 	void generateMipmaps(CommandBufferPtr& cmdb);
-	/// @}
+#endif
 
 private:
 	/// A collection of data

+ 2 - 3
include/anki/renderer/Pps.h

@@ -17,13 +17,12 @@ namespace anki {
 class Pps: public RenderingPass
 {
 public:
+#ifdef ANKI_BUILD
 	static const PixelFormat RT_PIXEL_FORMAT;
 
 	Pps(Renderer* r);
 	~Pps();
 
-	/// @privatesection
-	/// @{
 	ANKI_USE_RESULT Error init(const ConfigSet& config);
 	void run(CommandBufferPtr& jobs);
 
@@ -36,7 +35,7 @@ public:
 	{
 		return m_rt;
 	}
-	/// @}
+#endif
 
 	const Bloom& getBloom() const
 	{

+ 40 - 40
include/anki/renderer/Renderer.h

@@ -28,7 +28,9 @@ class ResourceManager;
 class Renderer
 {
 public:
+#ifdef ANKI_BUILD
 	const U TILE_SIZE = 64;
+#endif
 
 	Renderer();
 
@@ -99,6 +101,39 @@ public:
 		return F32(m_width) / m_height;
 	}
 
+	/// Init the renderer.
+	ANKI_USE_RESULT Error init(
+		Threadpool* threadpool,
+		ResourceManager* resources,
+		GrManager* gr,
+		HeapAllocator<U8> alloc,
+		StackAllocator<U8> frameAlloc,
+		const ConfigSet& config,
+		const Timestamp* globalTimestamp);
+
+	/// Set the output of the renderer before calling #render.
+	void setOutputFramebuffer(FramebufferPtr outputFb, U32 width, U32 height)
+	{
+		m_outputFb = outputFb;
+		m_outputFbSize = UVec2(width, height);
+	}
+
+	/// This function does all the rendering stages and produces a final result.
+	ANKI_USE_RESULT Error render(
+		SceneNode& frustumableNode,
+		Array<CommandBufferPtr, RENDERER_COMMAND_BUFFERS_COUNT>& cmdBuff);
+
+#ifdef ANKI_BUILD
+	void getOutputFramebuffer(FramebufferPtr& outputFb, U32& width, U32& height)
+	{
+		if(m_outputFb.isCreated())
+		{
+			outputFb = m_outputFb;
+			width = m_outputFbSize.x();
+			height = m_outputFbSize.y();
+		}
+	}
+
 	U32 getFramesCount() const
 	{
 		return m_framesNum;
@@ -164,28 +199,6 @@ public:
 		return m_drawQuadVert->getGrShader();
 	}
 
-	/// Set the output of the renderer.
-	void setOutputFramebuffer(FramebufferPtr outputFb, U32 width, U32 height)
-	{
-		m_outputFb = outputFb;
-		m_outputFbSize = UVec2(width, height);
-	}
-
-	void getOutputFramebuffer(FramebufferPtr& outputFb, U32& width, U32& height)
-	{
-		if(m_outputFb.isCreated())
-		{
-			outputFb = m_outputFb;
-			width = m_outputFbSize.x();
-			height = m_outputFbSize.y();
-		}
-	}
-
-	/// This function does all the rendering stages and produces a final result.
-	ANKI_USE_RESULT Error render(
-		SceneNode& frustumableNode,
-		Array<CommandBufferPtr, RENDERER_COMMAND_BUFFERS_COUNT>& cmdBuff);
-
 	/// My version of gluUnproject
 	/// @param windowCoords Window screen coords
 	/// @param modelViewMat The modelview matrix
@@ -220,11 +233,6 @@ public:
 		return distance / m_lodDistance;
 	}
 
-	/// Create a framebuffer attachment texture
-	void createRenderTarget(U32 w, U32 h,
-		const PixelFormat& format, U32 samples, SamplingFilter filter,
-		U mipsCount, TexturePtr& rt);
-
 	/// Create a pipeline object that has as a vertex shader the m_drawQuadVert
 	/// and the given fragment progam
 	void createDrawQuadPipeline(
@@ -232,21 +240,13 @@ public:
 		const ColorStateInfo& colorState,
 		PipelinePtr& ppline);
 
-	/// Init the renderer given an initialization class
-	/// @param initializer The initializer class
-	ANKI_USE_RESULT Error init(
-		Threadpool* threadpool,
-		ResourceManager* resources,
-		GrManager* gl,
-		HeapAllocator<U8> alloc,
-		StackAllocator<U8> frameAlloc,
-		const ConfigSet& config,
-		const Timestamp* globalTimestamp);
+	/// Create a framebuffer attachment texture
+	void createRenderTarget(U32 w, U32 h,
+		const PixelFormat& format, U32 samples, SamplingFilter filter,
+		U mipsCount, TexturePtr& rt);
 
 	void prepareForVisibilityTests(Camera& cam);
 
-	/// @privatesection
-	/// @{
 	GrManager& getGrManager()
 	{
 		return *m_gr;
@@ -276,7 +276,7 @@ public:
 	{
 		return *m_globalTimestamp;
 	}
-	/// @}
+#endif
 
 private:
 	Threadpool* m_threadpool;

+ 12 - 7
include/anki/renderer/RenderingPass.h

@@ -26,6 +26,7 @@ class ConfigSet;
 class RenderingPass
 {
 public:
+#ifdef ANKI_BUILD
 	RenderingPass(Renderer* r)
 		: m_r(r)
 	{}
@@ -33,29 +34,33 @@ public:
 	~RenderingPass()
 	{}
 
+	Timestamp getGlobalTimestamp() const;
+
+	HeapAllocator<U8> getAllocator() const;
+
+	StackAllocator<U8> getFrameAllocator() const;
+#endif
+
 	Bool getEnabled() const
 	{
 		return m_enabled;
 	}
+
 	void setEnabled(Bool e)
 	{
 		m_enabled = e;
 	}
 
-	Timestamp getGlobalTimestamp() const;
-
-	HeapAllocator<U8> getAllocator() const;
-
-	StackAllocator<U8> getFrameAllocator() const;
-
 protected:
-	Renderer* m_r; ///< Know your father
 	Bool8 m_enabled = false;
+#ifdef ANKI_BUILD
+	Renderer* m_r; ///< Know your father
 
 	GrManager& getGrManager();
 	const GrManager& getGrManager() const;
 
 	ResourceManager& getResourceManager();
+#endif
 };
 /// @}
 

+ 2 - 3
include/anki/renderer/Sm.h

@@ -24,10 +24,9 @@ class Sm: private RenderingPass
 {
 public:
 	static const U32 MAX_SHADOW_CASTERS = 8;
+#ifdef ANKI_BUILD
 	static const PixelFormat DEPTH_RT_PIXEL_FORMAT;
 
-	/// @privatesection
-	/// @{
 	Sm(Renderer* r)
 		: RenderingPass(r)
 	{}
@@ -63,7 +62,7 @@ public:
 	{
 		return m_sm2DArrayTex;
 	}
-	/// @}
+#endif
 
 private:
 	TexturePtr m_sm2DArrayTex;

+ 2 - 3
include/anki/renderer/Ssao.h

@@ -20,8 +20,7 @@ namespace anki {
 class Ssao: public RenderingPass
 {
 public:
-	/// @privatesection
-	/// @{
+#ifdef ANKI_BUILD
 	static const PixelFormat RT_PIXEL_FORMAT;
 
 	Ssao(Renderer* r)
@@ -40,7 +39,7 @@ public:
 	{
 		return m_uniformsBuff;
 	}
-	/// @}
+#endif
 
 private:
 	U32 m_width, m_height; ///< Blur passes size

+ 2 - 3
include/anki/renderer/Sslf.h

@@ -16,8 +16,7 @@ namespace anki {
 class Sslf: public RenderingPass
 {
 public:
-	/// @privatesection
-	/// @{
+#ifdef ANKI_BUILD
 	Sslf(Renderer* r)
 		: RenderingPass(r)
 	{}
@@ -29,7 +28,7 @@ public:
 	{
 		return m_rt;
 	}
-	/// @}
+#endif
 
 private:
 	TexturePtr m_rt;

+ 2 - 3
include/anki/renderer/Sslr.h

@@ -17,15 +17,14 @@ namespace anki {
 class Sslr: public RenderingPass
 {
 public:
-	/// @privatesection
-	/// @{
+#ifdef ANKI_BUILD
 	Sslr(Renderer* r)
 		: RenderingPass(r)
 	{}
 
 	ANKI_USE_RESULT Error init(const ConfigSet& config);
 	void run(CommandBufferPtr& cmdBuff);
-	/// @}
+#endif
 
 private:
 	U32 m_width;

+ 20 - 9
include/anki/renderer/Tiler.h

@@ -19,8 +19,9 @@ class Frustumable;
 /// @{
 
 /// The result of the Tiler tests.
-struct TilerTestResult
+class TilerTestResult
 {
+public:
 	struct Pair
 	{
 #if ANKI_DEBUG
@@ -38,6 +39,7 @@ struct TilerTestResult
 
 	TilerTestResult() = default;
 
+#ifdef ANKI_BUILD
 	void pushBack(U x, U y)
 	{
 		ANKI_ASSERT(x < 0xFF && y < 0xFF);
@@ -47,14 +49,23 @@ struct TilerTestResult
 		p.m_y = y;
 		m_tileIds[m_count++] = p;
 	}
+#endif
 };
 
 /// Test paramters passed to Tiler::test
-struct TilerTestParameters
+class TilerTestParameters
 {
+public:
+	/// Collision shape to test.
 	const CollisionShape* m_collisionShape = nullptr;
+
+	/// The AABB of the m_collisionShape. Used for some calculations.
 	const Aabb* m_collisionShapeBox = nullptr;
+
+	/// Test against the near plane.
 	Bool m_nearPlane = false;
+
+	/// The test results.
 	TilerTestResult* m_output;
 };
 
@@ -67,6 +78,7 @@ public:
 	using TestResult = TilerTestResult;
 	using TestParameters = TilerTestParameters;
 
+#ifdef ANKI_BUILD
 	Tiler(Renderer* r);
 	~Tiler();
 
@@ -78,18 +90,17 @@ public:
 	/// Update the tiles before doing visibility tests
 	void updateTiles(Camera& cam);
 
-	/// Test against all tiles.
-	/// @param[in, out] params The collision parameters.
-	Bool test(TestParameters& params) const;
-
-	/// @privatesection
-	/// @{
 	BufferPtr& getTilesBuffer()
 	{
 		U i = (getGlobalTimestamp() - m_pbos.getSize() + 1) % m_pbos.getSize();
 		return m_pbos[i];
 	}
-	/// @}
+#endif
+
+	/// Test against all tiles.
+	/// @param[in, out] params The collision parameters.
+	/// @return If visible return true.
+	Bool test(TestParameters& params) const;
 
 private:
 	/// Tile planes

+ 2 - 0
include/anki/renderer/Tm.h

@@ -16,6 +16,7 @@ namespace anki {
 class Tm: public RenderingPass
 {
 public:
+#ifdef ANKI_BUILD
 	Tm(Renderer* r)
 		: RenderingPass(r)
 	{}
@@ -28,6 +29,7 @@ public:
 	ANKI_USE_RESULT Error create(const ConfigSet& initializer);
 
 	void run(CommandBufferPtr& cmdb);
+#endif
 
 private:
 	ShaderResourcePtr m_luminanceShader;

+ 4 - 1
include/anki/scene/SceneComponent.h

@@ -59,7 +59,10 @@ public:
 	Timestamp getGlobalTimestamp() const;
 
 	/// Do some updating
-	/// @param[out] updated true if an update happened
+	/// @param[in,out] node Scene node of this component.
+	/// @param prevTime Previous update time.
+	/// @param crntTime Current update time.
+	/// @param[out] updated true if an update happened.
 	virtual ANKI_USE_RESULT Error update(
 		SceneNode& node, F32 prevTime, F32 crntTime, Bool& updated)
 	{

+ 10 - 13
include/anki/script/ScriptManager.h

@@ -3,8 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#ifndef ANKI_SCRIPT_SCRIPT_MANAGER_H
-#define ANKI_SCRIPT_SCRIPT_MANAGER_H
+#pragma once
 
 #include "anki/script/LuaBinder.h"
 
@@ -20,15 +19,22 @@ class SceneGraph;
 class ScriptManager
 {
 public:
+#ifdef ANKI_BUILD
 	ScriptManager();
 	~ScriptManager();
 
 	/// Create the script manager.
 	ANKI_USE_RESULT Error create(
-		AllocAlignedCallback allocCb, 
+		AllocAlignedCallback allocCb,
 		void* allocCbData,
 		SceneGraph* scene);
 
+	SceneGraph& _getSceneGraph()
+	{
+		return *m_scene;
+	}
+#endif
+
 	/// Expose a variable to the scripting engine.
 	template<typename T>
 	void exposeVariable(const char* name, T* y)
@@ -42,15 +48,7 @@ public:
 		return m_lua.evalString(str);
 	}
 
-	/// @privatesection
-	/// @{
-	SceneGraph& _getSceneGraph()
-	{
-		return *m_scene;
-	}
-	/// @}
-
-public:
+private:
 	SceneGraph* m_scene = nullptr;
 	ChainAllocator<U8> m_alloc;
 	LuaBinder m_lua;
@@ -60,4 +58,3 @@ public:
 
 } // end namespace anki
 
-#endif

+ 16 - 18
include/anki/util/Memory.h

@@ -3,8 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#ifndef ANKI_UTIL_MEMORY_H
-#define ANKI_UTIL_MEMORY_H
+#pragma once
 
 #include "anki/util/StdTypes.h"
 #include "anki/util/NonCopyable.h"
@@ -28,15 +27,15 @@ void* mallocAligned(PtrSize size, PtrSize alignmentBytes);
 /// Free aligned memory
 void freeAligned(void* ptr);
 
-/// The function signature of a memory allocation/deallocation. 
+/// The function signature of a memory allocation/deallocation.
 /// See allocAligned function for the explanation of arguments
 using AllocAlignedCallback = void* (*)(void*, void*, PtrSize, PtrSize);
 
 /// An internal type.
 using AllocationSignature = U32;
 
-/// This is a function that allocates and deallocates heap memory. 
-/// If the @a ptr is nullptr then it allocates using the @a size and 
+/// This is a function that allocates and deallocates heap memory.
+/// If the @a ptr is nullptr then it allocates using the @a size and
 /// @a alignment. If the @a ptr is not nullptr it deallocates the memory and
 /// the @a size and @a alignment is ignored.
 ///
@@ -49,7 +48,7 @@ using AllocationSignature = U32;
 void* allocAligned(
 	void* userData, void* ptr, PtrSize size, PtrSize alignment);
 
-/// Generic memory pool. The base of HeapMemoryPool or StackMemoryPool or 
+/// Generic memory pool. The base of HeapMemoryPool or StackMemoryPool or
 /// ChainMemoryPool.
 class BaseMemoryPool: public NonCopyable
 {
@@ -64,7 +63,7 @@ public:
 	};
 
 	BaseMemoryPool(Type type)
-	:	m_type(type)
+		: m_type(type)
 	{}
 
 	virtual ~BaseMemoryPool();
@@ -131,7 +130,7 @@ private:
 	Atomic<U32> m_refcount = {0};
 };
 
-/// A dummy interface to match the StackMemoryPool and ChainMemoryPool 
+/// A dummy interface to match the StackMemoryPool and ChainMemoryPool
 /// interfaces in order to be used by the same allocator template
 class HeapMemoryPool: public BaseMemoryPool
 {
@@ -162,8 +161,8 @@ private:
 #endif
 };
 
-/// Thread safe memory pool. It's a preallocated memory pool that is used for 
-/// memory allocations on top of that preallocated memory. It is mainly used by 
+/// Thread safe memory pool. It's a preallocated memory pool that is used for
+/// memory allocations on top of that preallocated memory. It is mainly used by
 /// fast stack allocators
 class StackMemoryPool: public BaseMemoryPool
 {
@@ -187,9 +186,9 @@ public:
 	/// @param alignmentBytes The maximum supported alignment for returned
 	///        memory
 	void create(
-		AllocAlignedCallback allocCb, 
+		AllocAlignedCallback allocCb,
 		void* allocCbUserData,
-		PtrSize size, 
+		PtrSize size,
 		Bool ignoreDeallocationErrors = true,
 		PtrSize alignmentBytes = ANKI_SAFE_ALIGNMENT);
 
@@ -217,12 +216,12 @@ public:
 		return m_top.load() - m_memory;
 	}
 
-	/// Get a snapshot of the current state that can be used to reset the 
+	/// Get a snapshot of the current state that can be used to reset the
 	/// pool's state later on. Not recommended on multithreading scenarios
 	/// @return The current state of the pool
 	Snapshot getShapshot() const;
 
-	/// Reset the poll using a snapshot. Not recommended on multithreading 
+	/// Reset the poll using a snapshot. Not recommended on multithreading
 	/// scenarios
 	/// @param s The snapshot to be used
 	void resetUsingSnapshot(Snapshot s);
@@ -258,7 +257,7 @@ private:
 	Bool8 m_ignoreDeallocationErrors = false;
 };
 
-/// Chain memory pool. Almost similar to StackMemoryPool but more flexible and 
+/// Chain memory pool. Almost similar to StackMemoryPool but more flexible and
 /// at the same time a bit slower.
 class ChainMemoryPool: public BaseMemoryPool
 {
@@ -274,11 +273,11 @@ public:
 	/// @param allocCbUserData The user data to pass to the allocation function.
 	/// @param initialChunkSize The size of the first chunk.
 	/// @param nextChunkScale Value that controls the next chunk.
-	/// @param nextChunkBias Value that controls the next chunk. 
+	/// @param nextChunkBias Value that controls the next chunk.
 	/// @param alignmentBytes The maximum supported alignment for returned
 	///                       memory.
 	void create(
-		AllocAlignedCallback allocCb, 
+		AllocAlignedCallback allocCb,
 		void* allocCbUserData,
 		PtrSize initialChunkSize,
 		F32 nextChunkScale = 2.0,
@@ -370,4 +369,3 @@ private:
 
 } // end namespace anki
 
-#endif

+ 5 - 0
src/renderer/Dbg.cpp

@@ -21,6 +21,11 @@
 
 namespace anki {
 
+//==============================================================================
+Dbg::Dbg(Renderer* r)
+	: RenderingPass(r)
+{}
+
 //==============================================================================
 Dbg::~Dbg()
 {

+ 2 - 1
src/renderer/MainRenderer.cpp

@@ -28,6 +28,7 @@ MainRenderer::MainRenderer()
 //==============================================================================
 MainRenderer::~MainRenderer()
 {
+	ANKI_LOGI("Destroying main renderer");
 	m_materialShaderSource.destroy(m_alloc);
 }
 
@@ -41,7 +42,7 @@ Error MainRenderer::create(
 	const ConfigSet& config,
 	const Timestamp* globalTimestamp)
 {
-	ANKI_LOGI("Initializing main renderer...");
+	ANKI_LOGI("Initializing main renderer");
 
 	m_alloc = HeapAllocator<U8>(allocCb, allocCbUserData);
 	m_frameAlloc = StackAllocator<U8>(allocCb, allocCbUserData, 1024 * 1024);

+ 4 - 0
testapp/Main.cpp

@@ -2,6 +2,10 @@
 #include <iostream>
 #include <fstream>
 
+#ifdef ANKI_BUILD
+#	undef ANKI_BUILD
+#endif
+
 #include "anki/input/Input.h"
 #include "anki/Math.h"
 #include "anki/Renderer.h"

Beberapa file tidak ditampilkan karena terlalu banyak file yang berubah dalam diff ini