Skip to content

Commit

Permalink
If the command isn't available in this version then use the most rece…
Browse files Browse the repository at this point in the history
…nt version where it is available.
  • Loading branch information
BSVino committed Aug 17, 2014
1 parent 8a62119 commit 8ddcf79
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
15 changes: 14 additions & 1 deletion compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ def spew_category(name, commands, current_command):
for version_option in all_versions:
if version[:2] != version_option[:2]:
continue

if latest_minor[2] == version_option[2] and float(latest_minor[2:]) < float(version_option[2:]):
latest_minor = version_option

Expand All @@ -248,7 +249,6 @@ def spew_category(name, commands, current_command):
toc_versions_options = toc_versions_options + "<option value='" + version_option.replace(".", "") + "'" + selected + ">GLES" + version_option[2:] + "</option>"

header_for_version = header_for_version.replace("{$versions_options}", toc_versions_options)
header_for_version = header_for_version.replace("{$current_api}", latest_minor.replace(".", ""))
header_for_version = header_for_version.replace("{$command_major_version}", version[2])

if version[0:2] == "gl":
Expand All @@ -263,6 +263,18 @@ def spew_category(name, commands, current_command):
header_for_command = header_for_version
footer_for_command = footer_for_version

# Find latest version that has this command present.
latest_version = version[:3] + ".0"
for version_option in all_versions:
if version[:2] != version_option[:2]:
continue

if not command in opengl.version_commands_flat[version_option]:
continue

if latest_version[2] == version_option[2] and float(latest_version[2:]) < float(version_option[2:]):
latest_version = version_option

api_commands = ""
for category in opengl.command_categories:
api_commands += spew_category(category, opengl.command_categories[category], command)
Expand All @@ -271,6 +283,7 @@ def spew_category(name, commands, current_command):
api_commands += spew_category("Uncategorized", unhandled_commands, command)

header_for_command = header_for_command.replace("{$api_commands}", api_commands)
header_for_command = header_for_command.replace("{$current_api}", latest_version.replace(".", ""))

command_major_versions = opengl.get_major_versions_available(command)
command_major_versions.sort(reverse=True)
Expand Down
5 changes: 4 additions & 1 deletion html/copy/docs.gl.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,11 @@ $(function() {
$("#versions_dropdown").val($.cookie("api_version")).selectmenu('refresh');
}
else
{
set_api_version(window.current_api);

$("#versions_dropdown").val(window.current_api).selectmenu('refresh');
}

$("#style_light").click(function() {
$("#pagestyle").attr("href", "../style_light.css");
$.cookie("pagestyle", "light");
Expand Down

0 comments on commit 8ddcf79

Please sign in to comment.