Skip to content

Commit 36a581a

Browse files
committed
init
0 parents  commit 36a581a

File tree

797 files changed

+173380
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

797 files changed

+173380
-0
lines changed

.hg_archival.txt

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
repo: d5cf55e12d5fb30a67d91248730212d5999ebc46
2+
node: 3ee6f3dd04a76a1628201d2543a85e444bae8d25
3+
branch: default
4+
latesttag: 0.3.8
5+
latesttagdistance: 2

.hgignore

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
syntax: glob
2+
*.obj
3+
*.dll
4+
*.fo
5+
*.lib
6+
*.exp
7+
*.ilk
8+
*.pdb
9+
*.dep
10+
*.idb
11+
*.ncb
12+
*.suo
13+
*.user
14+
BuildLog.htm
15+
*.exe
16+
*.res
17+
*.manifest
18+
*.bsc
19+
*.sbr
20+
*.pdf
21+
obj/*
22+
Documents/Build/fo.xsl
23+
Documents/Build/website.xsl
24+
desktop.ini
25+
glIntercept/*
26+
*.sln
27+
*.vcproj
28+
AllTutorials.sln
29+
website/*
30+
*.blend?
31+
*.make
32+
Makefile
33+
*.o
34+
*.d
35+
*.a
36+
*.lo
37+
glsdk/*
38+
framework/lib/Debug
39+
*.cbp
40+
*.vcxproj
41+
*.filters
42+
*.sdf
43+
*.workspace
44+
*.layout
45+
Shaders/*
46+
*.depend
47+
*.sln
48+
*.vcproj
49+
*.cbTemp

.hgtags

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
498e777446dd55b7a4d9f4dbd9e1aa0b9b867c9d v0.0.1
2+
498e777446dd55b7a4d9f4dbd9e1aa0b9b867c9d v0.0.1
3+
498e777446dd55b7a4d9f4dbd9e1aa0b9b867c9d v0.0.1
4+
498e777446dd55b7a4d9f4dbd9e1aa0b9b867c9d v0.0.1
5+
498e777446dd55b7a4d9f4dbd9e1aa0b9b867c9d v0.0.1
6+
498e777446dd55b7a4d9f4dbd9e1aa0b9b867c9d v0.0.1
7+
0000000000000000000000000000000000000000 v0.0.1
8+
0000000000000000000000000000000000000000 v0.0.1
9+
6332c7f799032fb5fd21b89394f1a48ea6270ada v0.0.1
10+
08eba0521c8a2cbf074c464327554a786dd14ac1 0.0.3
11+
08eba0521c8a2cbf074c464327554a786dd14ac1 0.0.3
12+
5c6a85062156c35820490edf805791ebf2c0a211 0.0.3
13+
18bc807b7c4e3dae63bbd320c4dea327897decfa 0.2
14+
18bc807b7c4e3dae63bbd320c4dea327897decfa 0.2
15+
2fd974a41bf1e571edb779d1f4449444c58438e3 0.2
16+
9557db356144333784058ec592357840d20fb569 0.3
17+
9557db356144333784058ec592357840d20fb569 0.3
18+
af2f43b2444b14a063108a8bab62fdce78194c81 0.3
19+
2b423ba83b3783d880a47e531172a81b6423e863 0.3.5
20+
2b423ba83b3783d880a47e531172a81b6423e863 0.3.5
21+
6ec988ddad31522ce610a8bdde0265b5168fdd4c 0.3.5
22+
6ec988ddad31522ce610a8bdde0265b5168fdd4c 0.3.5
23+
28636298c1c0a4543dc76dbf0e5569baf1aa2d17 0.3.5
24+
f6d27680f6ccfe64be92839dc8bbd744db95af6f 0.3.6
25+
f6d27680f6ccfe64be92839dc8bbd744db95af6f 0.3.6
26+
e16d0c0c28dd153b8aa5256c2498d052f0f057a8 0.3.6
27+
941a60cc0cd0756b5866aa5826707419a5815da2 0.3.7
28+
941a60cc0cd0756b5866aa5826707419a5815da2 0.3.7
29+
4e64718f0c73d88e7d1d5a84fb10ef739da582b8 0.3.7
30+
4e64718f0c73d88e7d1d5a84fb10ef739da582b8 0.3.7
31+
b0d119666529291ff44d1bb27f5a11b096b2d05c 0.3.7
32+
b0d119666529291ff44d1bb27f5a11b096b2d05c 0.3.7
33+
46630d43a79ca57c41fa3fdaae907c67437e4d6a 0.3.7
34+
46630d43a79ca57c41fa3fdaae907c67437e4d6a 0.3.7
35+
82b9f468b18101f001c1d067c0e8f29eccf0571b 0.3.7
36+
82b9f468b18101f001c1d067c0e8f29eccf0571b 0.3.7
37+
d0156abcd3e53c8df7e8f884e64ae46d7133c445 0.3.7
38+
695bc58cfbd05efc9db9f463b7bf5e891965bd57 0.3.8

BuildDistro.lua

+190
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,190 @@
1+
--[[
2+
Will automatically generate all files from the current sources.
3+
Takes three parameters:
4+
- The destination directory, as a relative directory. Will create it if it does not exist.
5+
- The Mercurial revision number to archive to the destination directory.
6+
- The version number of the tutorials.
7+
]]--
8+
9+
require("ex")
10+
require "ufs"
11+
require "lfs"
12+
require "_FindFileInPath"
13+
14+
local baseDir, hgChangelist, versionNum = ...
15+
16+
if(#({...}) ~= 3) then
17+
print("Not enough commandline parameters. You provided: " .. #({...}));
18+
print("Paramters:")
19+
print("\tDestination dir, relative to this path.")
20+
print("\tMercurial revision to archive.")
21+
print("\tVersion number of the SDK.")
22+
return
23+
end
24+
25+
local buildDirname = "Tutorial " .. versionNum
26+
27+
lfs.mkdir(baseDir);
28+
local pathDestDir = ufs.path(baseDir) / buildDirname;
29+
local destDir = tostring(pathDestDir);
30+
lfs.mkdir(destDir);
31+
32+
local pathCurrent = ufs.current_path();
33+
local pathDest = pathCurrent / destDir;
34+
local pathBase = pathCurrent / baseDir;
35+
36+
-------------------------------------------
37+
-- Use the other Lua script to copy the HTML and PDFs to the destination.
38+
local CopyWebsite = assert(loadfile("CopyWebsite.lua"));
39+
CopyWebsite(destDir .. "\\html\\");
40+
41+
--Generate the PDF files.
42+
local pdfOutDir = "..\\..\\" .. destDir .. "\\"
43+
local cwd = lfs.currentdir();
44+
lfs.chdir("Documents\\Build");
45+
local BuildPrintBW = assert(loadfile("BuildPrintBWFO.lua"));
46+
BuildPrintBW(pdfOutDir);
47+
local BuildKindleFO = assert(loadfile("BuildKindleFO.lua"));
48+
BuildKindleFO(pdfOutDir);
49+
local BuildComputerFO = assert(loadfile("BuildComputerFO.lua"));
50+
BuildComputerFO(pdfOutDir);
51+
lfs.chdir(cwd);
52+
53+
------------------------------------------
54+
-- Use Mercurial to get a version in the destination directory.
55+
local clone = [[hg archive -r "%s" "%s"]];
56+
clone = clone:format(hgChangelist, destDir);
57+
58+
print(clone);
59+
os.execute(clone);
60+
61+
---------------------------------------------------------------
62+
-- Install the dependencies.
63+
local luaFilename = "lua.exe"
64+
local pathLua = ufs.path(FindFileInPath(luaFilename))
65+
local luaDepScriptName = "get_externals.lua"
66+
67+
ufs.current_path(pathDest);
68+
69+
local depProc = ex.spawn(tostring(pathLua),
70+
{args={luaDepScriptName}});
71+
depProc:wait(depProc);
72+
73+
---------------------------------------------------------------
74+
-- Apply Copyright Info
75+
local luaCopyScriptName = "make_copyright.lua"
76+
77+
if(pathLua:empty()) then
78+
print("Could not find Lua. Since this is a Lua script, that's kinda confusing...");
79+
return;
80+
end
81+
82+
ufs.current_path(pathCurrent);
83+
84+
local copyProc = ex.spawn(tostring(pathLua),
85+
{args={luaCopyScriptName, tostring(pathDest)}});
86+
copyProc:wait(copyProc);
87+
88+
-------------------------------------------
89+
-- Generate the ancillary files
90+
91+
--Readme.txt
92+
local readme = io.open(destDir .. "\\readme.txt", "wt");
93+
readme:write(string.format(
94+
[===[
95+
OpenGL Tutorials, version %s
96+
97+
This is a series of tutorials on using OpenGL to do graphical rendering.
98+
The code for each tutorial is found in the "Tut *" directories. The code
99+
alone is not enough information to understand what is going on. The actual
100+
documentation is available in several forms.
101+
102+
The HTML form of the documentation can be found by opening the "index.html"
103+
file. There are 3 PDF forms of the documentation. TutorialsComp.pdf is a PDF
104+
that uses very thin margins; it is useful for display on computers (or
105+
tablets). TutorialsPrintBW.pdf is a PDF designed for printing on a black-and-white
106+
printer. TutorialsKindle.pdf is a PDF that is sized specifically for the screen
107+
of the Kindle 2.
108+
109+
The License.txt file contains the licensing information for the materials distributed in these tutorials.
110+
]===], versionNum))
111+
readme:close()
112+
113+
--Version.txt
114+
local version = io.open(destDir .. "\\version.txt", "wt");
115+
version:write(string.format(
116+
[===[
117+
OpenGL Tutorials.
118+
119+
Version %s
120+
]===]
121+
, versionNum))
122+
version:close();
123+
124+
--Index.html
125+
local index_html = io.open(destDir .. "\\index.html", "wt");
126+
index_html:write(
127+
[===[
128+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
129+
<html>
130+
<head>
131+
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
132+
<meta HTTP-EQUIV="REFRESH" content="0; url=html/index.html"/>
133+
</head>
134+
<body>
135+
</body>
136+
]===]
137+
)
138+
index_html:close();
139+
140+
------------------------------------------------------------
141+
-- Delete select files from the destination location.
142+
local toDelete =
143+
{
144+
--files
145+
--Distro building
146+
"BuildDistro.lua", "CopyWebsite.lua",
147+
"_FindFileInPath.lua", "file_copyright_info.lua", "make_copyright.lua",
148+
--Mercurial
149+
".hgignore", ".hgtags", ".hg_archival.txt",
150+
--directories
151+
"glimg\\Test", "glload\\Test", "glload\\codegen",
152+
"Documents", "Meshes",
153+
}
154+
155+
156+
for i, filename in ipairs(toDelete) do
157+
local pathFile = pathDest / filename;
158+
print("deleting:", pathFile);
159+
ufs.remove_all(pathFile);
160+
end
161+
162+
------------------------------------------------------------
163+
-- Create Zip archive of the distro.
164+
local szFilename = "7z.exe"
165+
local archiveName = buildDirname .. ".7z"
166+
local pathSZ = ufs.path(FindFileInPath(szFilename))
167+
168+
if(pathSZ:empty()) then
169+
print("Could not find 7zip.");
170+
return;
171+
end
172+
173+
ufs.current_path(pathBase);
174+
175+
local zipProc = ex.spawn(tostring(pathSZ),
176+
{args={"a", "-r", archiveName, buildDirname}});
177+
zipProc:wait(zipProc);
178+
179+
------------------------------------------------------------
180+
-- Destroy the directory.
181+
ufs.remove_all(pathDest);
182+
183+
184+
185+
186+
187+
188+
189+
190+

0 commit comments

Comments
 (0)