Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 
Share Thread:
Reddit Facebook Twitter
Why is minor component displayed at left ?
09-19-2015, 12:22 AM (This post was last modified: 09-19-2015 12:30 AM by ggaliens.)
Post: #3
RE: Why is minor component displayed at left ?
Micheus ... Dan ... I think I'm seeing a potential weakness in OpenGL version vetting ...
Look at this testing I have done on command line ...

Code:
1> {2,1} < {3,1,2}.
true
2> {2,1} < {2,1,2}.
true
3> {2,1} < {2,0,2}.
true
4>

My thought would be to put in an "assertion" that both tuples are three tuples ... else toss in a fatal.
Anyways ... I'm going to try to PUSH an improved version for you guys to ponder.

Maybe something like this is better ...

Code:
minor_gl_version() ->
    Major = 2,
    Minor = 1,
    Req = {Major,Minor,0},
    case ets:lookup(wings_gl_ext, version) of
    [{_,{MajorCurrent,MinorCurrent,_}=VerTuple}] when VerTuple < Req ->
        fatal("Wings3D requires OpenGL ~p.~p or higher.\nYour available version ~p.~p",
          [Major,Minor,   MajorCurrent,MinorCurrent]);
    [{_,{_,_,_}=_VerTuple}]  ->  % assert that a 3 tuple is returned as expected
        ok;
    Unexpected ->
        fatal("Unexpected current OpenGL info : ~p", [ Unexpected ])
    end.
Reply


Messages In This Thread
RE: Why is minor component displayed at left ? - ggaliens - 09-19-2015 12:22 AM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)