diff options
author | Dan Gudmundsson <[email protected]> | 2010-10-22 15:45:28 +0200 |
---|---|---|
committer | Dan Gudmundsson <[email protected]> | 2010-11-15 10:13:07 +0100 |
commit | 2e605129613ba88427de27520a19456903d40cca (patch) | |
tree | 4c3c1caf3e7d32200ab0d3fcc58cd124ffde11f1 /lib/wx/api_gen | |
parent | 029429cae951a9896d544eb7693fd130e4abc979 (diff) | |
download | otp-2e605129613ba88427de27520a19456903d40cca.tar.gz otp-2e605129613ba88427de27520a19456903d40cca.tar.bz2 otp-2e605129613ba88427de27520a19456903d40cca.zip |
Update to OpenGL 4.1
Diffstat (limited to 'lib/wx/api_gen')
-rw-r--r-- | lib/wx/api_gen/gl_gen.erl | 24 | ||||
-rw-r--r-- | lib/wx/api_gen/gl_gen_c.erl | 116 | ||||
-rw-r--r-- | lib/wx/api_gen/gl_gen_erl.erl | 12 | ||||
-rw-r--r-- | lib/wx/api_gen/glapi.conf | 203 |
4 files changed, 290 insertions, 65 deletions
diff --git a/lib/wx/api_gen/gl_gen.erl b/lib/wx/api_gen/gl_gen.erl index c76dfb75a0..374e0bd12b 100644 --- a/lib/wx/api_gen/gl_gen.erl +++ b/lib/wx/api_gen/gl_gen.erl @@ -206,10 +206,10 @@ parse_define([], D, _Opts) -> parse_func(Xml, Opts) -> {Func,_} = foldl(fun(X,Acc) -> parse_func(X,Acc,Opts) end, {#func{},1}, Xml), + put(current_func, Func#func.name), #func{params=Args0,type=Type0} = Func, Args = filter(fun(#arg{type=void}) -> false; (_) -> true end, Args0), - #arg{type=Type} = - patch_param(Func#func.name,#arg{name="result",type=Type0},Opts), + #arg{type=Type} = patch_param(Func#func.name,#arg{name="result",type=Type0},Opts), Func#func{params=reverse(Args), type=Type}. parse_func(#xmlElement{name=type, content=C}, {F,AC}, Os) -> @@ -220,6 +220,7 @@ parse_func(#xmlElement{name=name, content=[#xmlText{value=C}]},{F,AC},Os) -> put(current_func, Func), {F#func{name=name(Func,Os)},AC}; parse_func(#xmlElement{name=param, content=C},{F,AC},Os) -> + put(current_func, F#func.name), Parse = fun(Con, Ac) -> parse_param(Con, Ac, Os) end, Param0 = foldl(Parse, #arg{}, drop_empty(C)), Param = fix_param_name(Param0, F, AC), @@ -314,11 +315,17 @@ handle_arg_opt(both, P) -> P#arg{in=both}; handle_arg_opt(binary, P=#arg{type=T}) -> P#arg{type=T#type{size=undefined,base=binary}}; handle_arg_opt({binary,Sz}, P=#arg{type=T}) -> - P#arg{type=T#type{size=Sz,base=binary}}; + P#arg{type=T#type{size={Sz, Sz},base=binary}}; +handle_arg_opt({binary,Max, Sz}, P=#arg{type=T}) -> + P#arg{type=T#type{size={Max, Sz},base=binary}}; handle_arg_opt({type,Type}, P=#arg{type=T}) -> P#arg{type=T#type{name=Type}}; handle_arg_opt({single,Opt},P=#arg{type=T}) -> P#arg{type=T#type{single=Opt}}; +handle_arg_opt({base,{Opt, Sz}}, P=#arg{type=T}) -> P#arg{type=T#type{base=Opt, size=Sz}}; handle_arg_opt({base,Opt}, P=#arg{type=T}) -> P#arg{type=T#type{base=Opt}}; -handle_arg_opt({c_only,Opt},P) -> P#arg{where=c, alt=Opt}. +handle_arg_opt({c_only,Opt},P) -> P#arg{where=c, alt=Opt}; +handle_arg_opt(string, P=#arg{type=T}) -> P#arg{type=T#type{base=string}}; +handle_arg_opt({string,Max,Sz}, P=#arg{type=T}) -> + P#arg{type=T#type{base=string, size={Max,Sz}}}. parse_type([], _Os) -> void; parse_type(C, Os) -> @@ -367,6 +374,8 @@ parse_type2([N="GLbitfield"|R],T,Opts) -> parse_type2(R,T#type{name=N, size=4, base=int},Opts); parse_type2([N="GLvoid"|R],T,Opts) -> parse_type2(R,T#type{name=N, base=idx_binary},Opts); +parse_type2([N="GLsync"|R],T,Opts) -> + parse_type2(R,T#type{name=N, base=int, size=8},Opts); parse_type2([N="GLbyte"|R],T,Opts) -> parse_type2(R,T#type{name=N, size=1, base=int},Opts); @@ -378,6 +387,11 @@ parse_type2([N="GLushort"|R],T,Opts) -> parse_type2(R,T#type{name=N, size=2, base=int},Opts); parse_type2([N="GLint"|R],T,Opts) -> parse_type2(R,T#type{name=N, size=4, base=int},Opts); +parse_type2([N="GLint64"|R],T,Opts) -> + parse_type2(R,T#type{name=N, size=8, base=int},Opts); +parse_type2([N="GLuint64"|R],T,Opts) -> + parse_type2(R,T#type{name=N, size=8, base=int},Opts); + parse_type2([N="GLuint"|R],T,Opts) -> parse_type2(R,T#type{name=N, size=4, base=int},Opts); parse_type2([N="GLsizei"|R],T,Opts) -> @@ -548,8 +562,10 @@ setup_idx_binary(Name,Ext,_Opts) -> %% Ok warn if single is undefined lists:foreach(fun(#arg{type=#type{base=memory}}) -> ok; + (#arg{type=#type{base=string}}) -> ok; (#arg{type=#type{base=idx_binary}}) -> ok; (#arg{type=#type{name="GLUquadric"}}) -> ok; + (#arg{type=#type{base=binary, size=Sz}}) when Sz =/= undefined -> ok; (A=#arg{type=#type{single=undefined}}) -> ?warning("~p Unknown size of~n ~p~n", [get(current_func),A]), diff --git a/lib/wx/api_gen/gl_gen_c.erl b/lib/wx/api_gen/gl_gen_c.erl index 2fe3226978..230b853c2b 100644 --- a/lib/wx/api_gen/gl_gen_c.erl +++ b/lib/wx/api_gen/gl_gen_c.erl @@ -51,7 +51,8 @@ gen(GLFuncs, GLUFuncs) -> w("#include \"gl_fdefs.h\"~n", []), w("~nint gl_error_op;~n", []), - w("void egl_dispatch(int op, char *bp, ErlDrvPort port, ErlDrvTermData caller, char *bins[]){~n", + w("void egl_dispatch(int op, char *bp, ErlDrvPort port, " + "ErlDrvTermData caller, char *bins[], int bins_sz[]){~n", []), w(" gl_error_op = op;~n", []), @@ -109,25 +110,53 @@ declare_var(A=#arg{name=N,in=false,type=#type{name=T,base=B,single={tuple,Sz}}}) true = is_number(Sz), %% Assert w(" ~s ~s[~p] = {~s};~n", [T,N,Sz,args(fun zero/1,",",lists:duplicate(Sz,B))]), A; -declare_var(A=#arg{name=N,in=false,type=#type{name=T,base=B,single={list,Sz}}}) when is_number(Sz) -> +declare_var(A=#arg{name=N,in=false,type=#type{name=T,base=B,single={list,Sz}}}) + when is_number(Sz) -> w(" ~s ~s[~p] = {~s};~n", [T,N,Sz,args(fun zero/1,",",lists:duplicate(Sz,B))]), A; +declare_var(A=#arg{name=N,in=false,type=#type{name=T,base=string,size={Max,_}, single=Single}}) -> + case is_integer(Max) of + true -> + w(" ~s ~s[~p];~n", [T,N,Max]); + false -> + %% w(" ~s ~s[*~s];~n", [T,N,Max]), + w(" ~s *~s;~n", [T,N]), + w(" ~s = (~s *) driver_alloc(sizeof(~s) * *~s);~n", [N,T,T,Max]), + store_free(N) + %% case Single of + %% {list, _, _} -> + %% w(" ~s *~s_p = ~s;~n", [T,N,N]); + %% _ -> ok + %% end + end, + A; +declare_var(A=#arg{name=N,in=false,type=#type{base=binary,size={MaxSz, _}}}) -> + MaxSz == undefined andalso error({assert, A}), + case is_integer(MaxSz) of + true -> + w(" ErlDrvBinary *~s = driver_alloc_binary(~p);~n", [N,MaxSz]); + false -> + w(" ErlDrvBinary *~s = driver_alloc_binary(*~s);~n", [N,MaxSz]) + end, + A; declare_var(A=#arg{name=N,in=false,type=#type{name=T,single={list,ASz,_USz},mod=[]}}) -> true = is_list(ASz), %% Assert w(" ~s *~s;~n", [T,N]), w(" ~s = (~s *) driver_alloc(sizeof(~s) * *~s);~n", [N,T,T,ASz]), store_free(N), - A; -declare_var(A=#arg{name=N,in=false,type=#type{name=T,base=binary,size=Sz}}) -> - true = is_number(Sz), %% Assert - w(" ~s ~s[~p];~n", [T,N,Sz]), + %% w(" ~s ~s[*~s];~n", [T,N,ASz]), A; declare_var(A=#arg{in=false, type=#type{name="GLUquadric",by_val=false,single=true}}) -> A; +declare_var(A=#arg{in=false, type=#type{base=string,by_val=false,single=true}}) -> + A; declare_var(A=#arg{name=N,in=false, type=#type{name=T,base=B,by_val=false,single=true}}) -> w(" ~s ~s[1] = {~s};~n", [T,N,zero(B)]), A; +declare_var(A=#arg{where=c, type=#type{name=T}, alt={size,Var}}) -> + w(" ~s ~s_size = bins_sz[~p];~n", [T, Var, get(bin_count)]), + A; declare_var(A=#arg{where=_}) -> A. @@ -205,7 +234,7 @@ decode_arg(P=#arg{name=Name,type=#type{name=Type,base=guard_int}},A0) -> {P, A}; decode_arg(P=#arg{name=Name,type=#type{name=Type,base=string,single=true}},A0) -> w(" ~s *~s = (~s *) bp;~n", [Type,Name,Type]), - w(" int ~sLen = strlen((char *)~s); bp += ~sLen+1+((8-((1+~sLen+~p)%8))%8);~n", + w(" int ~sLen[1] = {strlen((char *)~s)}; bp += ~sLen[0]+1+((8-((1+~sLen[0]+~p)%8))%8);~n", [Name,Name,Name,Name,A0]), {P, 0}; decode_arg(P=#arg{name=Name, @@ -274,6 +303,8 @@ result_type(#type{name=T, ref=undefined}) -> T; result_type(#type{name=T, ref={pointer,1}, mod=Mods}) -> mod(Mods) ++ T ++ " * ". +call_arg(#arg{alt={size,Alt},type=#type{}}) -> + Alt ++ "_size"; call_arg(#arg{alt={length,Alt},type=#type{}}) -> "*" ++ Alt ++ "Len"; call_arg(#arg{alt={constant,Alt},type=#type{}}) -> @@ -284,6 +315,8 @@ call_arg(#arg{name=Name,type=#type{single={list, _}}}) -> Name; call_arg(#arg{name=Name,type=#type{size=8,base=int,ref=undefined}}) -> Name; +call_arg(#arg{name=Name,in=false,type=#type{name=T, base=binary}}) -> + "(" ++ T ++ "*) " ++ Name ++ "->orig_bytes"; call_arg(#arg{name=Name,type=#type{ref=undefined}}) -> "*" ++ Name; call_arg(#arg{name=Name,type=#type{base=guard_int}}) -> @@ -313,17 +346,17 @@ build_return_vals(Type,As) -> end; {Val,Vars,Cnt} -> ExtraTuple = if Cnt > 1 -> 2; true -> 0 end, - CSize = if Vars =:= none -> - Sz = integer_to_list(Val+4+ExtraTuple), - w(" int AP = 0; ErlDrvTermData rt[~s];~n",[Sz]), - Sz; - true -> - Sz = integer_to_list(Val+4+ExtraTuple) ++ " + " ++ Vars, - w(" int AP = 0; ErlDrvTermData *rt;~n",[]), - w(" rt = (ErlDrvTermData *) " - "driver_alloc(sizeof(ErlDrvTermData)*(~s));~n", [Sz]), - Sz - end, + if Vars =:= none -> + Sz = integer_to_list(Val+4+ExtraTuple), + w(" int AP = 0; ErlDrvTermData rt[~s];~n",[Sz]), + Sz; + true -> + Sz = integer_to_list(Val+4+ExtraTuple) ++ " + " ++ Vars, + w(" int AP = 0; ErlDrvTermData *rt;~n",[]), + w(" rt = (ErlDrvTermData *) " + "driver_alloc(sizeof(ErlDrvTermData)*(~s));~n", [Sz]), + Sz + end, w(" rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) \"_egl_result_\");~n",[]), FreeList = build_ret_types(Type,As), case Cnt of @@ -357,7 +390,7 @@ calc_sizes(Type,As) -> {Val, none} -> {Sz+Val, Vars, Cnt+1}; {Val, Var} when Vars =:= none -> {Sz+Val, Var,Cnt+1}; - {Val, Var} when Vars =:= none -> + {Val, Var} -> {Sz+Val, Var ++ " + " ++ Vars,Cnt+1} end; (_,Acc) -> Acc @@ -365,13 +398,16 @@ calc_sizes(Type,As) -> foldl(Calc, TSz, As). return_size(_N,void) -> {0, none}; -return_size(_N,#type{base=binary}) -> {4, none}; -return_size(_N,#type{single=true}) -> {2,none}; return_size(_N,#type{single={tuple,Sz}}) -> {Sz*2+2, none}; -return_size(_N,#type{name="GLubyte",single={list,null}}) ->{3, none}; return_size(_N,#type{single={list,Sz}}) -> {Sz*2+3, none}; -return_size(_N,#type{base=string,single={list,_,_}}) -> {3, none}; -return_size(_N,#type{single={list,_,Sz}}) -> {3, "(*" ++Sz++")*2"}. +return_size(_N,#type{base=string,single=true}) -> {3, none}; +return_size(_N,#type{base=string,single=undefined}) -> {3, none}; +return_size(_N,#type{base=string,single={list,_,"result"}}) -> {3, "result*3"}; +return_size(_N,#type{base=string,single={list,_,Sz}}) -> {3, "(*" ++Sz++")*3"}; +return_size(_N,#type{single={list,_,"result"}}) -> {3, "result*2"}; +return_size(_N,#type{single={list,_,Sz}}) -> {3, "(*" ++Sz++")*2"}; +return_size(_N,#type{base=binary}) -> {4, none}; +return_size(_N,#type{single=true}) -> {2, none}. build_ret_types(void,Ps) -> @@ -430,17 +466,27 @@ build_ret(Name,_Q,#type{name=T,base=_,single={tuple,Sz}}) -> [w(" rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *~s++;~n", [Temp]) || _ <- lists:seq(1,Sz)], w(" rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = ~p;~n",[Sz]); -build_ret(Name,_Q,#type{name="GLubyte",single={list,null}}) -> +build_ret(Name,_Q,#type{base=string,size=1,single=true}) -> w(" rt[AP++] = ERL_DRV_STRING; rt[AP++] = (ErlDrvTermData) ~s;" " rt[AP++] = strlen((char *) ~s);\n", [Name, Name]); -build_ret(Name,_Q,#type{base=string,single={list,_,Sz}}) -> +build_ret(Name,_Q,#type{base=string, size={_Max,Sz}, single=S}) + when S == true; S == undefined -> w(" rt[AP++] = ERL_DRV_STRING; rt[AP++] = (ErlDrvTermData) ~s;" " rt[AP++] = *~s;\n", [Name, Sz]); +build_ret(Name,_Q,#type{name=_T,base=string,size={_, SSz}, single={list,_,Sz}}) -> + P = if Sz == "result" -> ["(int) "]; true -> "*" end, + w(" for(int i=0; i < ~s~s; i++) {\n", [P,Sz]), + w(" rt[AP++] = ERL_DRV_STRING; rt[AP++] = (ErlDrvTermData) ~s;" + " rt[AP++] = ~s[i]-1;\n", [Name, SSz]), + w(" ~s += ~s[i]; }~n", [Name, SSz]), + w(" rt[AP++] = ERL_DRV_NIL;", []), + w(" rt[AP++] = ERL_DRV_LIST; rt[AP++] = (~s~s)+1;~n",[P,Sz]); build_ret(Name,_Q,#type{name=_T,base=B,single={list,_,Sz}}) when B =/= float -> - w(" for(int i=0; i < *~s; i++) {\n", [Sz]), + P = if Sz == "result" -> ["(int) "]; true -> "*" end, + w(" for(int i=0; i < ~s~s; i++) {\n", [P,Sz]), w(" rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) ~s[i];}~n", [Name]), w(" rt[AP++] = ERL_DRV_NIL;", []), - w(" rt[AP++] = ERL_DRV_LIST; rt[AP++] = (*~s)+1;~n",[Sz]); + w(" rt[AP++] = ERL_DRV_LIST; rt[AP++] = (~s~s)+1;~n",[P,Sz]); build_ret(Name,_Q,#type{name=_T,size=FSz,base=float,single={list,Sz}}) -> Temp = Name ++ "Tmp", case FSz of @@ -461,12 +507,14 @@ build_ret(Name,_Q,#type{name=T,base=_,single={list,Sz}}) -> || _ <- lists:seq(1,Sz)], w(" rt[AP++] = ERL_DRV_NIL;", []), w(" rt[AP++] = ERL_DRV_LIST; rt[AP++] = ~p+1;~n",[Sz]); -build_ret(Name,_Q,#type{name="GLubyte",base=binary,size=Sz}) -> - w(" ErlDrvBinary * BinCopy = driver_alloc_binary(~p);~n", [Sz]), - w(" memcpy(BinCopy->orig_bytes, ~s, ~p);~n", [Name,Sz]), - w(" rt[AP++] = ERL_DRV_BINARY; rt[AP++] = (ErlDrvTermData) BinCopy;", []), - w(" rt[AP++] = ~p; rt[AP++] = 0;~n", [Sz]), - "driver_free_binary(BinCopy);"; +build_ret(Name,_Q,#type{base=binary,size={_,Sz}}) -> + w(" rt[AP++] = ERL_DRV_BINARY; rt[AP++] = (ErlDrvTermData) ~s;", [Name]), + if is_integer(Sz) -> + w(" rt[AP++] = ~p; rt[AP++] = 0;~n", [Sz]); + is_list(Sz) -> + w(" rt[AP++] = *~s; rt[AP++] = 0;~n", [Sz]) + end, + "driver_free_binary(" ++ Name ++ ");"; build_ret(Name,_Q,T=#type{}) -> io:format("{~p, {~p, {single,{tuple,X}}}}.~n", [get(current_func),Name]), io:format(" ~p~n",[T]). diff --git a/lib/wx/api_gen/gl_gen_erl.erl b/lib/wx/api_gen/gl_gen_erl.erl index 1dbec5d229..f292c8723e 100644 --- a/lib/wx/api_gen/gl_gen_erl.erl +++ b/lib/wx/api_gen/gl_gen_erl.erl @@ -78,7 +78,11 @@ types() -> {"GLsizeiptr","64/native-unsigned"}, % 64 bits int, convert on c-side {"GLintptr", "64/native-unsigned"}, % 64 bits int, convert on c-sidew {"GLUquadric", "64/native-unsigned"},% Handle 32bits aargh 64bits on mac64 - {"GLhandleARB","64/native-unsigned"} % Handle 32bits aargh 64bits on mac64 + {"GLhandleARB","64/native-unsigned"},% Handle 32bits aargh 64bits on mac64 + + {"GLsync", "64/native-unsigned"}, % Pointer to record + {"GLuint64", "64/native-unsigned"}, + {"GLint64", "64/native-signed"} ]. gl_api(Fs) -> @@ -344,12 +348,8 @@ doc_arg_type2(T=#type{single={tuple,Sz}}) -> "{" ++ args(fun doc_arg_type3/1, ",", lists:duplicate(Sz,T)) ++ "}"; doc_arg_type2(T=#type{single=list}) -> "[" ++ doc_arg_type3(T) ++ "]"; -doc_arg_type2(T=#type{single={list, Max}}) when is_integer(Max) -> +doc_arg_type2(T=#type{single={list, _Max}}) -> "[" ++ doc_arg_type3(T) ++ "]"; -doc_arg_type2(_T=#type{single={list,null}}) -> - "string()"; -doc_arg_type2(T=#type{base=string}) -> - doc_arg_type3(T); doc_arg_type2(T=#type{single={list,_,_}}) -> "[" ++ doc_arg_type3(T) ++ "]"; doc_arg_type2(T=#type{single={tuple_list,Sz}}) -> diff --git a/lib/wx/api_gen/glapi.conf b/lib/wx/api_gen/glapi.conf index f9ed7a1065..525ccf8b68 100644 --- a/lib/wx/api_gen/glapi.conf +++ b/lib/wx/api_gen/glapi.conf @@ -29,8 +29,35 @@ "glMatrixIndexPointerARB", "glPixelTransformParameter", %% OpengGL 3.0 - %"glGetTransformFeedbackVarying", %% Jobbiga - %"glTransformFeedbackVaryings", + + %% ARB + "glCreateSyncFromCLeventARB", % _cl_context _cl_event ?? + "glDebugMessageCallbackARB", + + "glGetn", %* + "glReadnPixels", %* + + "glVertexP2", %* + "glVertexP3", %* + "glVertexP4", %* + "glTexCoordP1", %* + "glTexCoordP2", %* + "glTexCoordP3", %* + "glTexCoordP4", %* + "glMultiTexCoordP1", %* + "glMultiTexCoordP2", %* + "glMultiTexCoordP3", %* + "glMultiTexCoordP4", %* + "glNormalP3", %* + "glColorP3", %* + "glColorP4", %* + "glSecondaryColorP3", %* + "glVertexAttribP1", %* + "glVertexAttribP2", %* + "glVertexAttribP3", %* + "glVertexAttribP4", %* + + "glGetActiveSubroutineUniformiv", %% Bad API don't know what to allocate needs to ask %% EXT %% By default skip these extensions @@ -136,11 +163,12 @@ {"glRect", [{"v1", {single,{tuple,2}}},{"v2", {single,{tuple,2}}}]}. -{"glGetString", {"result", {single,{list,null}}}}. +{"glGetString", {"result", string}}. {"glGetBooleanv", {"params", {single,{list,16}}}}. {"glGetDoublev", {"params", {single,{list,16}}}}. {"glGetFloatv", {"params", {single,{list,16}}}}. {"glGetIntegerv", {"params", {single,{list,16}}}}. +{"glGetInteger64v", {"params", {single,{list,16}}}}. {"glFeedbackBuffer", {"buffer", [{base,memory}, in]}}. {"glSelectBuffer", {"buffer", [{base,memory}, in]}}. @@ -174,24 +202,24 @@ {"glGetActiveAttribARB", [{"length",[skip,{single, true}]}, {"size", {single, true}}, {"type", {single, true}}, - {"name", {single, {list,"maxLength","length"}}} + {"name", {string,"maxLength","length"}} ]}. {"glGetActiveAttrib", [{"length",[skip,{single, true}]}, {"size", {single, true}}, {"type", {single, true}}, - {"name", {single, {list,"bufSize","length"}}} + {"name", {string,"bufSize","length"}} ]}. {"glGetActiveUniformARB", [{"length",[skip,{single, true}]}, {"size", {single, true}}, {"type", {single, true}}, - {"name", {single, {list,"maxLength","length"}}} + {"name", {string,"maxLength","length"}} ]}. {"glGetActiveUniform", [{"length",[skip,{single, true}]}, {"size", {single, true}}, {"type", {single, true}}, - {"name", {single, {list,"bufSize","length"}}} + {"name", {string,"bufSize","length"}} ]}. {"glGetAttachedShaders", [{"count", [skip,{single,true}]}, @@ -201,18 +229,18 @@ {"glGetProgramiv", {"params", {single,true}}}. {"glGetProgramInfoLog", [{"length", [skip,{single,true}]}, - {"infoLog", {single, {list,"bufSize","length"}}} + {"infoLog", {string,"bufSize","length"}} ]}. {"glGetShaderiv", {"params", {single,true}}}. {"glGetShaderInfoLog", [{"length", [skip,{single,true}]}, - {"infoLog", {single, {list,"bufSize","length"}}} + {"infoLog", {string,"bufSize","length"}} ]}. {"glGetShaderSourceARB", [{"length", [skip,{single,true}]}, - {"source", {single, {list,"maxLength","length"}}} + {"source", {string,"maxLength","length"}} ]}. {"glGetShaderSource", [{"length", [skip,{single,true}]}, - {"source", {single, {list,"bufSize","length"}}} + {"source", {string,"bufSize","length"}} ]}. @@ -239,7 +267,7 @@ {"glMatrixIndex", [{"size",{c_only,{length,"indices"}}}, {"indices", {single,list}}]}. -{"glProgramStringARB", [{"len",{c_only,{constant,"stringLen"}}}, +{"glProgramStringARB", [{"len",{c_only,{length,"string"}}}, {"string",[{base,string},{single,true}]}]}. {"glGetProgramStringARB", {"string", [in,{base,memory}]}}. {"glGenProgramsARB", {"programs", {single,{list,"n","n"}}}}. @@ -250,7 +278,7 @@ {"glGetProgramLocalParameter", {"params", {single,{tuple,4}}}}. {"glGetObjectParameter", {"params", {single,true}}}. {"glGetInfoLogARB", [{"length", [skip,{single,true}]}, - {"infoLog", {single, {list,"maxLength","length"}}} + {"infoLog", {string,"maxLength","length"}} ]}. {"glGetAttachedObjectsARB", [{"count", [skip,{single,true}]}, {"obj", {single, {list,"maxCount","count"}}} @@ -280,9 +308,10 @@ {"objW",[{single,true},out]}]}. {"gluBuild", {"data", [binary]}}. {"gluScaleImage", [{"dataIn", [in, binary]}, {"dataOut", [in, {base, memory}]}]}. -{"gluCheckExtension", [{"extName", {single, list}}, {"extString", {single, list}}]}. -{"gluErrorString", {"result", {single, {list,null}}}}. -{"gluGetString", {"result", {single, {list,null}}}}. +{"gluCheckExtension", [{"extName", string}, + {"extString", string}]}. +{"gluErrorString", {"result", string}}. +{"gluGetString", {"result", string}}. {"gluDeleteQuadric", {"quad", in}}. {"gluQuadric", {"quad", in}}. @@ -291,15 +320,21 @@ {"gluDisk", {"quad", in}}. {"gluCylinder", {"quad", in}}. -%% OpenGL 3.0 +%% OpenGL 3.0 and later {"glGetBooleani_v", {"data", {single,{list,16}}}}. {"glGetIntegeri_v", {"data", {single,{list,16}}}}. +{"glGetFloati_v", {"data", {single,{list,16}}}}. +{"glGetDoublei_v", {"data", {single,{list,16}}}}. +{"glGetInteger64i_v", {"data", {single,{list,16}}}}. + +{"glGetBufferParameteriv", {"params", {single,{list,16}}}}. +{"glGetBufferParameteri64v", {"params", {single,{list,16}}}}. {"glTransformFeedbackVaryings", [{"count", {c_only,{length,"varyings"}}}, {"varyings", [{base,string}, {single,list}]}]}. -{"glGetTransformFeedbackVarying", [{"size", {single, true}},{"type", {single, true}}, +{"glGetTransformFeedbackVarying", [{"size", {single, true}},{"type", {single, true}}, {"length", [skip, {single, true}]}, - {"name", {single, {list,"bufSize","length"}}}]}. + {"name", {string,"bufSize","length"}}]}. {"glGenRenderbuffers", {"renderbuffers", {single,{list,"n","n"}}}}. @@ -327,7 +362,133 @@ {"params", [out, {single, {list, "uniformIndicesLen", "uniformIndicesLen"}}]}]}. {"glGetActiveUniformName", [{"length",[skip,{single, true}]}, - {"uniformName", {single, {list,"bufSize","length"}}}]}. + {"uniformName", {string,"bufSize","length"}}]}. {"glGetActiveUniformBlockName", [{"length",[skip,{single, true}]}, - {"uniformBlockName", {single, {list,"bufSize","length"}}}]}. + {"uniformBlockName", {string,"bufSize","length"}}]}. {"glGetActiveUniformBlockiv", {"params", [in, {base,memory}]}}. + + +{"glGetSynciv", [{"values", {single, {list, "bufSize","length"}}}, + {"length", [skip,{single, true}]}]}. + +{"glGetMultisamplefv", {"val", [out, {single, {tuple,2}}]}}. + + +{"glNamedStringARB", [{"stringlen", {c_only, {length, "string"}}}, + {"namelen", {c_only, {length, "name"}}}]}. +{"glDeleteNamedStringARB", [{"namelen", {c_only, {length, "name"}}}]}. +{"glIsNamedStringARB", [{"namelen", {c_only, {length, "name"}}}]}. +{"glGetNamedStringARB",[{"namelen", {c_only, {length, "name"}}}, + {"stringlen",[skip,{single, true}]}, + {"string", {string,"bufSize","stringlen"}}]}. +{"glGetNamedStringivARB",[{"namelen", {c_only, {length, "name"}}}, + {"params", [out, {single, true}]}]}. +{"glCompileShaderIncludeARB", [{"length", {c_only,{constant,"NULL"}}}, + {"count", {c_only,{length,"path"}}}, + {"path", {single,list}}]}. + + +{"glGenSamplers", {"samplers", {single, {list,"count","count"}}}}. +{"glDeleteSamplers", [{"count", {c_only, {length, "samplers"}}}, + {"samplers", {single, list}}]}. +{"glGetSamplerParameter", {"params", {single, {list, 4}}}}. +{"glSamplerParameterI", {"param", {single, list}}}. +{"glSamplerParameterfv", {"param", {single, list}}}. +{"glSamplerParameteriv", {"param", {single, list}}}. + +%{"glGetActiveSubroutineUniformiv", {"values", }}. +{"glGetActiveSubroutineUniformName", [{"length",[skip,{single, true}]}, + {"name", {string,"bufsize","length"}}]}. +{"glGetActiveSubroutineName", [{"length",[skip,{single, true}]}, + {"name", {string,"bufsize","length"}}]}. +{"glGetProgramStageiv", {"values", {single, true}}}. +{"glUniformSubroutinesuiv", [{"count",{c_only,{length,"indices"}}},{"indices", {single, list}}]}. + +{"glGenTransformFeedbacks", {"ids", {single, {list,"n","n"}}}}. +{"glDeleteTransformFeedbacks", [{"n", {c_only, {length, "ids"}}}, + {"ids", {single, list}}]}. + +{"glPatchParameterfv", {"values", {single, list}}}. + + +{"glGetQueryIndexediv", {"params", {single, true} }}. +{"glShaderBinary", [{"count", {c_only, {length, "shaders"}}}, + {"length", {c_only, {size, "binary"}}}, + {"shaders", {single, list}}, + {"binary", binary} + ]}. +{"glGetShaderPrecisionFormat", [{"range", {single, {tuple, 2}}}, + {"precision", {single, true}}]}. + +{"glGetProgramBinary", [{"length",[skip,{single, true}]}, + {"binary", [out, {binary, "bufSize", "length"}]}, + {"binaryFormat", {single, true}}]}. +{"glProgramBinary", [{"binary", binary}, {"length", {c_only, {size, "binary"}}}]}. + +{"glGenProgramPipelines", {"pipelines", {single, {list,"n","n"}}}}. +{"glDeleteProgramPipelines", [{"n", {c_only, {length, "pipelines"}}}, + {"pipelines", {single, list}}]}. + +{"glCreateShaderProgramv", [{"count", {c_only, {length, "strings"}}}, + {"strings", {single, list}}]}. +{"glGetProgramPipelineInfoLog", [{"length", [skip,{single, true}]}, + {"infoLog", {string,"bufSize","length"}}]}. +{"glGetProgramPipelineiv", {"params", {single, true}}}. + + +%% {"glCreateSyncFromCLeventARB", {"context", }}. + +{"glDebugMessageControlARB", [{"count", {c_only, {length, "ids"}}}, + {"ids", {single, list}}]}. +{"glDebugMessageInsertARB", {"length", {c_only, {length, "buf"}}}}. +{"glGetDebugMessageLogARB", [{"sources", {single, {list, "count", "result"}}}, + {"types", {single, {list, "count", "result"}}}, + {"ids", {single, {list, "count", "result"}}}, + {"severities", {single, {list, "count", "result"}}}, + {"lengths", [{c_only, undefined}, {single, {list, "count", "result"}}]}, + {"messageLog", [{string, "bufsize", "lengths"}, + {single, {list, "bufsize", "result"}}]}]}. + + +{"glUniformMatrix2dv", [{"count",{c_only,{length,"value"}}},{"value", [{single,{tuple_list,4}}]}]}. +{"glUniformMatrix3dv", [{"count",{c_only,{length,"value"}}},{"value", [{single,{tuple_list,9}}]}]}. +{"glUniformMatrix4dv", [{"count",{c_only,{length,"value"}}},{"value", [{single,{tuple_list,16}}]}]}. +{"glUniformMatrix2x3dv", [{"count",{c_only,{length,"value"}}},{"value", [{single,{tuple_list,6}}]}]}. +{"glUniformMatrix3x2dv", [{"count",{c_only,{length,"value"}}},{"value", [{single,{tuple_list,6}}]}]}. +{"glUniformMatrix2x4dv", [{"count",{c_only,{length,"value"}}},{"value", [{single,{tuple_list,8}}]}]}. +{"glUniformMatrix4x2dv", [{"count",{c_only,{length,"value"}}},{"value", [{single,{tuple_list,8}}]}]}. +{"glUniformMatrix3x4dv", [{"count",{c_only,{length,"value"}}},{"value", [{single,{tuple_list,12}}]}]}. +{"glUniformMatrix4x3dv", [{"count",{c_only,{length,"value"}}},{"value", [{single,{tuple_list,12}}]}]}. + +{"glProgramUniform1", [{"count",{c_only,{length,"value"}}}, {"value", [{single,list}]}]}. +{"glProgramUniform2", [{"count",{c_only,{length,"value"}}}, {"value", [{single,{tuple_list,2}}]}]}. +{"glProgramUniform3", [{"count",{c_only,{length,"value"}}}, {"value", [{single,{tuple_list,3}}]}]}. +{"glProgramUniform4", [{"count",{c_only,{length,"value"}}}, {"value", [{single,{tuple_list,4}}]}]}. + +{"glProgramUniformMatrix2fv", [{"count",{c_only,{length,"value"}}},{"value", [{single,{tuple_list,4}}]}]}. +{"glProgramUniformMatrix2dv", [{"count",{c_only,{length,"value"}}},{"value", [{single,{tuple_list,4}}]}]}. +{"glProgramUniformMatrix3dv", [{"count",{c_only,{length,"value"}}},{"value", [{single,{tuple_list,9}}]}]}. +{"glProgramUniformMatrix3fv", [{"count",{c_only,{length,"value"}}},{"value", [{single,{tuple_list,9}}]}]}. +{"glProgramUniformMatrix4dv", [{"count",{c_only,{length,"value"}}},{"value", [{single,{tuple_list,16}}]}]}. +{"glProgramUniformMatrix4fv", [{"count",{c_only,{length,"value"}}},{"value", [{single,{tuple_list,16}}]}]}. +{"glProgramUniformMatrix2x3fv", [{"count",{c_only,{length,"value"}}},{"value", [{single,{tuple_list,6}}]}]}. +{"glProgramUniformMatrix3x2fv", [{"count",{c_only,{length,"value"}}},{"value", [{single,{tuple_list,6}}]}]}. +{"glProgramUniformMatrix2x4fv", [{"count",{c_only,{length,"value"}}},{"value", [{single,{tuple_list,8}}]}]}. +{"glProgramUniformMatrix4x2fv", [{"count",{c_only,{length,"value"}}},{"value", [{single,{tuple_list,8}}]}]}. +{"glProgramUniformMatrix3x4fv", [{"count",{c_only,{length,"value"}}},{"value", [{single,{tuple_list,12}}]}]}. +{"glProgramUniformMatrix4x3fv", [{"count",{c_only,{length,"value"}}},{"value", [{single,{tuple_list,12}}]}]}. + +{"glProgramUniformMatrix2x3dv", [{"count",{c_only,{length,"value"}}},{"value", [{single,{tuple_list,6}}]}]}. +{"glProgramUniformMatrix3x2dv", [{"count",{c_only,{length,"value"}}},{"value", [{single,{tuple_list,6}}]}]}. +{"glProgramUniformMatrix2x4dv", [{"count",{c_only,{length,"value"}}},{"value", [{single,{tuple_list,8}}]}]}. +{"glProgramUniformMatrix4x2dv", [{"count",{c_only,{length,"value"}}},{"value", [{single,{tuple_list,8}}]}]}. +{"glProgramUniformMatrix3x4dv", [{"count",{c_only,{length,"value"}}},{"value", [{single,{tuple_list,12}}]}]}. +{"glProgramUniformMatrix4x3dv", [{"count",{c_only,{length,"value"}}},{"value", [{single,{tuple_list,12}}]}]}. + +{"glViewportArrayv", [{"count",{c_only,{length,"v"}}}, {"v", [{single,{tuple_list,4}}]}]}. +{"glViewportIndexedfv", {"v", {single,{tuple,4}}}}. +{"glScissorArrayv", [{"count",{c_only,{length,"v"}}}, {"v", [{single,{tuple_list,4}}]}]}. +{"glScissorIndexedv", {"v", {single,{tuple,4}}}}. +{"glDepthRangeArrayv", [{"count",{c_only,{length,"v"}}}, {"v", [{single,{tuple_list,2}}]}]}. + + |