09-19-2015, 04:17 AM
ggaliens, there is no reason for all that extra code you want to add:
The version tuple is already ensured to have three elements. Just look in wings_gl.erl - init_extensions/0, where the version is stored:
Code:
[{_,{_,_,_}=_VerTuple}] -> % assert that a 3 tuple is returned as expected
ok;
Unexpected ->
fatal("Unexpected current OpenGL info : ~p", [ Unexpected ])
The version tuple is already ensured to have three elements. Just look in wings_gl.erl - init_extensions/0, where the version is stored:
Code:
init_extensions() ->
ets:new(wings_gl_ext, [named_table,public,ordered_set]),
Exts0 = lists:sort(string:tokens(gl:getString(?GL_EXTENSIONS), " ")),
Exts = [{list_to_atom(E)} || E <- Exts0],
ets:insert(wings_gl_ext, Exts),
Ver = case catch get_version() of
{_,_,_}=V -> V;
_ -> {1,1,0}
end,
ets:insert(wings_gl_ext, {version,Ver}).