]> git.cworth.org Git - apitrace/blob - DEVELOPMENT.markdown
d3dretrace: Use DirectXTex for d3d10 state too.
[apitrace] / DEVELOPMENT.markdown
1 Coding Style
2 ============
3
4 These are guidelines for new code.  Some of existing hasn't been updated to
5 these conventions yet.
6
7 Whitespace (all languages):
8
9  * indentation is 4 spaces
10
11  * never use tabs as indents
12
13  * otherwise tab equals to 8 spaces
14
15  * separate classes with two empty lines
16
17 Naming convention:
18
19  * camelCase for functions/methods
20
21  * UpperCase for structures/classes
22
23  * lowercase for namespaces/modules
24
25  * `UPPER_CASE` for #defines
26
27  * single underscore prefix for variables/functions in automatically generated
28    code
29
30 C++:
31
32  * enclose single statement `if` clauses in { }, specially for automatically
33    generated code
34
35  * } else {
36
37  * use inlines for functions/methods which are called with high-frequency
38
39 CMake:
40
41  * `lower_case` commands
42
43  * space between ( and precedent name
44
45
46 When in doubt, be consistent with the existing code.
47
48
49 Commit policy
50 =============
51
52 Feature development:
53
54 * Existing features in master branch should not degrade at any time, for any
55   platform.  (Unless it is not widely used and there is agreement.)
56
57 * It's fine to add new features for only some platforms.
58
59 * Non-trivial changes should be staged in a branch, to enable peer-review and
60   regression testing.  Branch should be deleted once code has been merged.
61
62 * Releases are tagged commits from master.  There are no stable branches.
63
64
65 Backwards compatibility:
66
67 * Backwards binary compatibility with old traces must be always maintained: all
68   tools, including glretrace, must handle old traces without regressions.
69
70 * No backwards compatibility guarantees for derived data (ASCII dumps, state,
71   images, etc).
72
73 * There should be no gratuitous change to command line tool interfaces, but no
74   guarantees are given.
75
76
77
78 Regression testing
79 ==================
80
81 There is a regression test suite under development in
82 https://github.com/apitrace/apitrace-tests .
83