Announcement: SDL_Config

I have been wanting something similar to OpenPTC’s ptc.cfg mechanism
for supplying different parameters to hardware-independent SDL
applications, so I put this together.

It’s essentially a way to specify what audio or video driver you want
to use and with what parameters, like resolution, bit depth,
frequency, bits per sample, etc… all without recompiling an SDL app
that makes use of this mechanism. It also means you don’t have to add
command-line options to your SDL app or fiddle with environment
variables so that your users can configure your app to run how they
like it on their computer.

This diff was done on the SDL12 cvs, last night. Not much has changed
in the area where the modifications have been made since the official
1.2 release, anyway… It should be 100% compatible with SDL apps
that don’t make use of the new struct. This was developed and tested
on my Win95 machines.

A sample use can be found at
http://groups.yahoo.com/group/opendemogroup/message/27

(again, compiled and tested on Windows but should work on other
platforms)

It would be neat if something like this found its way in version 1.3,
where audio and video (and perhaps other subsystems) could be
configured from an external file and SDL_Mixer behaved a bit more like
SDL_Image in how it is a loader that creates a destination for the
source file that the user must manage to the output device.

For example: the user must set the video mode with SDL and then
convert and blit the surface returned by IMG_Load to the screen.
SDL_Sound could load WAV, MP3, MOD, etc… in a similar way, returning
a bunch of channels that can be hooked up (with or without processing)
to the audio device that was opened and initialized simiarily to how
the video mode/surface is opened and initialized.

Anyway, I’d like to know what people think and if some of you think
this could be useful and better than a putenv hack of some sort or by
calling internal SDL initialization functions to do the same thing.–

Olivier A. Dagenais - Software Architect and Developer

begin 666 SDL_Config.diff
M26YD97 at Z(%-$3"YC#0H]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]
M/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]#0I20U, at 9FEL
M93H at +V-V<R]31$PQ,B]S<F,O4T1,+F,L=@T*<F5T<FEE=FEN9R!R979I<VEO
M;B Q+C,-"F1I9F8 at +6, at +7(Q+C, at 4T1,+F,-"BHJB!31$PN8PDR,# Q+S U
M+S(S(#(S.C,U.C Y"3$N,PT
+2TM(%-$3"YC"3(P,#$O,#8O,3@@,#(Z,C0Z
M,#,-“BHJBHJBHJBHJBHJ*@TBHJ(#4Y+#$W,2 JBHJ#0H@(’-T871I
M8R!5:6YT,S(@4T1,7VEN:71I86QI>F5D(#T@,#L-“B @<W1A=&EC(%5I;G0S
M,B!T:6-K<U]S=&%R=&5D(#T@,#L-@T
(" C:69D968 at 0TA%0TM?3$5!2U,-
M"B @:6YT(’-U<F9A8V5S7V%L;&]C871E9" ](# [#0H@("-E;F1I9 at T*#0H@
M(&EN="!31$Q?26YI=%-U8E-Y<W1E;2A5:6YT,S(@9FQA9W,I#0H@(‘L-“B$@
M(VEF;F1E9B!$25-!0DQ%7U9)1$5/#0HA( DOB!);FET:6%L:7IE('1H92!V
M:61E;R]E=F5N="!S=6)S>7-T96T@B-"B$@“6EF(”@@&9L86=S("8 at 4T1,
M7TE.251?5DE$14\I(“8F(”$H4T1,7VEN:71I86QI>F5D("8 at 4T1,7TE.251?
M5DE$14\I("D@>PT
(2 )“6EF(”@@4T1,7U9I9&5O26YI=“AG971E;G8H(E-$
M3%]6241%3T12259%4B(I+ T*(2 )“2 @(” @(” @(” @(" @(" @(" H9FQA
M9W,F4T1,7TE.251?159%3E142%)%040I2 (# @2![#0HA( D)"7)E='5R
M;B at M,2D[#0HA( D)?0T
(2 )“5-$3%]I;FET:6%L:7IE9”!/2!31$Q?24Y)
M5%]6241%3SL-"B$@"7T-"B$@(V5L<V4-"B$@“6EF(”@@9FQA9W,@)B!31$Q?
M24Y)5%]6241%3R I('L-“B$@“0E31$Q?4V5T17)R;W(H(E-$3”!N;W0 at 8G5I
M;'0@=VET:”!V:61E;R!S=7!P;W)T(BD[#0HA( D)<F5T=7)N
"TQ3L-"B$@
M"7T-“B$@(V5N9&EF#0HA#0HA(”-I9FYD968 at 1$E304),15]!541)3PT
(2 )
M+RH at 26YI=&EA;&EZ92!T:&4 at 875D:6@<W5B<WES=&5M(“HO#0HA( EI9B H
M(“AF;&%G<R F(%-$3%])3DE47T%51$E/2 F)B A%-$3%]I;FET:6%L:7IE
M9” F(%-$3%])3DE47T%51$E/2 I('L-"B$@"0EI9B H(%-$3%]!=61I;TEN
M:70H9V5T96YV
”)31$Q?055$24]$4DE615(B2D@/" P("D@>PT(2 )"0ER
M971U<FXH+3$I.PT*(2 )"7T-"B$@“0E31$Q?:6YI=&EA;&EZ960@?#T at 4T1,
M7TE.251?055$24[#0HA( E]#0HA(”-E;’-E#0HA( EI9B H(&9L86=S(“8@
M4T1,7TE.251?055$24@2![#0HA( D)4T1,7U-E=$5R<F]R”)31$P@;F]T
M(&)U:6QT(’=I=&@@875D:6@<W5P<&]R="(I.PT*(2 )“7)E='5R;B at M,2D[
M#0HA( E]#0HA(”-E;F1I9 at T*(0T*(2 C:69N9&5F($1)4T%“3$5?5$E-15)3
M#0HA( DOB!);FET:6%L:7IE('1H92!T:6UE<B!S=6)S>7-T96T@B-“B$@
M"6EF(”@@(2!T:6-K<U]S=&%R=&5D("D@>PT
(2 )"5-$3%]3=&%R=%1I8VMS
M
"D[#0HA( D)=&EC:W-?<W1A<G1E9” ](#$[#0HA( E]#0HA( EI9B H(“AF
M;&%G<R F(%-$3%])3DE47U1)34522 F)B A%-$3%]I;FET:6%L:7IE9” F
M(%-$3%])3DE47U1)34522 I('L-"B$@"0EI9B H(%-$3%]4:6UE<DEN:70H
M
2 (# @2![#0HA( D)"7)E='5R;B at M,2D[#0HA( D)?0T(2 )“5-$3%]I
M;FET:6%L:7IE9”!/2!31$Q?24Y)5%]424U%4CL-"B$@"7T-“B$@(V5L<V4-
M"B$@“6EF(”@@9FQA9W,@)B!31$Q?24Y)5%]424U%4B I(‘L-“B$@“0E31$Q?
M4V5T17)R;W(H(E-$3”!N;W0 at 8G5I;'0@=VET:”!T:6UE<B!S=7!P;W)T(BD[
M#0HA( D)<F5T=7)N*“TQ3L-"B$@"7T-“B$@(V5N9&EF#0HA#0HA(”-I9FYD
M968 at 1$E304),15]3UE35$E#2PT(2 )+RH at 26YI=&EA;&EZ92!T:&4@:F]Y
M<W1I8VL@<W5B<WES=&5M(“HO#0HA( EI9B H(“AF;&%G<R F(%-$3%])3DE4
M7TI/65-424-+2 F)@T(2 )(” @(” A
%-$3%]I;FET:6%L:7IE9” F(%-$
M3%])3DE47TI/65-424-+2 I('L-"B$@"0EI9B H(%-$3%];WES=&EC:TEN
M:70H2 (# @2![#0HA( D)"7)E='5R;B at M,2D[#0HA( D)?0T(2 )“5-$
M3%]I;FET:6%L:7IE9”!/2!31$Q?24Y)5%]3UE35$E#2SL-"B$@"7T-"B$@
M(V5L<V4-"B$@“6EF(”@@9FQA9W,@)B!31$Q?24Y)5%]3UE35$E#2R I('L-
M"B$@“0E31$Q?4V5T17)R;W(H(E-$3”!N;W0 at 8G5I;'0@=VET:"!J;WES=&EC
M:R!S=7!P;W)T(BD[#0HA( D)<F5T=7)N
"TQ
3L-"B$@"7T-“B$@(V5N9&EF
M#0HA#0HA(”-I9FYD968 at 1$E304),15]#1%)/30T
(2 )+RH at 26YI=&EA;&EZ
M92!T:&4 at 0T0M4D]-(’-U8G-Y<W1E;2 J+PT*(2 ):68@" H9FQA9W,@)B!3
M1$Q?24Y)5%]#1%)/32D@)B8@(2A31$Q?:6YI=&EA;&EZ960@)B!31$Q?24Y)
M5%]#1%)/32D@2![#0HA( D):68@"!31$Q?0T123TU);FET
"D@/” P("D@
M>PT*(2 )"0ER971U<FXH+3$I.PT*(2 )“7T-“B$@“0E31$Q?:6YI=&EA;&EZ
M960@?#T at 4T1,7TE.251?0T123TT[#0HA( E]#0HA(”-E;’-E#0HA( EI9B H
M(&9L86=S(“8 at 4T1,7TE.251?0T123TT@2![#0HA( D)4T1,7U-E=$5R<F]R
M
”)31$P@;F]T(&)U:6QT(’=I=&@@8V1R;VT@<W5P<&]R=”(I.PT*(2 )“7)E
M='5R;B at M,2D[#0HA( E]#0HA(”-E;F1I9 at T*(2 )<F5T=7)N*# I.PT*(”!]
M#0H-"B @:6YT(%-$3%]);FET*%5I;G0S,B!F;&%G<RD-“B @>PT*(2 )+RH@
M0VQE87(@=&AE(&5R<F]R(&UE<W-A9V4@B-"B$@"5-$3%]#;&5A<D5R<F]R
M
"D[#0H-“B$@“2\J($EN:71I86QI>F4@=&AE(&1E<VER960@<W5B<WES=&5M
M<R J+PT*(2 ):68@"!31$Q?26YI=%-U8E-Y<W1E;2AF;&%G<RD@/" P("D@
M>PT
(2 )“7)E=‘5R;B at M,2D[#0HA( E]#0H-“B$@“2\J($5V97)Y=&AI;F<@
M:7,@:6YI=&EA;&EZ960@B-"B$@“6EF(”@@(2AF;&%G<R F(%-$3%])3DE4
M7TY/4$%204-(551%2 I('L-"B$@"0E31$Q?26YS=&%L;%!A<F%C:'5T92 at I
M.PT
(2 )?0T
(2 )<F5T=7)N*# I.PT*(”!]#0H-“B$@=F]I9”!31$Q?475I
M=%-U8E-Y<W1E;2A5:6YT,S(@9FQA9W,I#0H@(‘L-"B @“2\J(%-H=70 at 9&]W
M;B!R97%U97-T960@:6YI=&EA;&EZ960@<W5B<WES=&5M<R J+PT*(” C:69N
M9&5F($1)4T%“3$5?0T123TT-“BTM+2 U.2PQ,#$@+2TM+0T*(”!S=&%T:6,@
M56EN=#,R(%-$3%]I;FET:6%L:7IE9” ](# [#0H@(’-T871I8R!5:6YT,S(@
M=&EC:W-?<W1A<G1E9” ](# [#0H-"BL-“BL at +RH@5&AI<R!P87)T:6-U;&%R
M(&EN<W1A;G1I871I;VX@;V8@=&AE(%-$3%]#;VYF:6=?4W1R=6-T#0HK(” J
M(’)E<’)E<V5N=’,@=&AE(’-T871E(’-E=”!B>2!T:&4 at 4T1,7TEN:70O4T1,
M7TEN:713=6)3>7-T96T-“BL@(“H at 8V%L;’,N(” H:64Z(”!I9B!Y;W4G<F4@
M;F]T(&=O:6YG(‘1O(‘5S92!31$Q?0V]N9FEG(&9U;F-T:6]N<RP-"BL@("H@
M4T1,(’=I;&P@;6%I;G1A:6X@:71S(&]W;B!S=’)U8W0 at 86YD('1H:7,@:7,@
M:70I#0HK(” J($UA>2!W86YT('1O(&%D9”!A(&9U;F-T:6]N(‘1H870@<F5T
M=7)N<R!A(’!O:6YT97(@=&@=&AI<S-“BL@(“HO#0HK(’-T871I8R!31$Q?
M0V]N9FEG7U-T<G5C=”!31$Q?0V]N9FEG7T-U<G)E;G1#;VYF:6<[#0HK#0HK
M#0H@(”-I9F1E9B!#2$5#2U],14%+4PT*(”!I;G0@<W5R9F%C97-?86QL;V-A
M=&5D(#T@,#L-"B @(V5N9&EF#0H-"B @:6YT(%-$3%]);FET4W5B4WES=&5M
M*%5I;G0S,B!F;&%G<RD-"B @>PT*(2 )4T1,7T-O;F9I9U]#=7)R96YT0V]N
M9FEG+G-U8E-Y<W1E;7,@?#T at 9FQA9W,[#0HA( ER971U<FXH4T1,7T-O;F9I
M9U]);FET4W5B4WES=&5M*“931$Q?0V]N9FEG7T-U<G)E;G1#;VYF:6<I3L-
M"B @?0T
#0H@(&EN=”!31$Q?26YI="A5:6YT,S(@9FQA9W,I#0H@('L-“B$@
M"2\O($=R86(@=&AE(&1E9F%U;'1S#0HA( E31$Q?0V]N9FEG7T1E9F%U;'1#
M;VYF:6<@" F4T1,7T-O;F9I9U]#=7)R96YT0V]N9FEG("D[#0H-"B$@“2\O
M(%-E=”!T:&4 at 875D:6@86YD('9I9&5O(&1R:79E<G, at 9G)O;2!T:&4 at 96YV
M:7)O;FUE;G0-"B$@“5-$3%]#;VYF:6=?0W5R<F5N=$-O;F9I9RYA=61I;T1R
M:79E<B ](&=E=&5N=B H(”)31$Q?055$24]$4DE615(B("D[#0HA( E31$Q?
M0V]N9FEG7T-U<G)E;G1#;VYF:6<N=FED96]$<FEV97(@/2!G971E;G8@
” B
M4T1,7U9)1$5/1%))5D52(B I.PT*#0HA( DO+R!3970@=&AE(&9L86=S#0HA
M( E31$Q?0V]N9FEG7T-U<G)E;G1#;VYF:6<N<W5B4WES=&5M<R!/2!F;&%G
M<SL-"B$-"B$@“7)E='5R;B H(%-$3%]#;VYF:6=?26YI=” H(“931$Q?0V]N
M9FEG7T-U<G)E;G1#;VYF:6<@2 I.PT(”!]#0HK#0H-“B$@=F]I9”!31$Q?
M475I=%-U8E-Y<W1E;2 H(%5I;G0S,B!F;&%G<R I#0H@('L-"B @“2\J(%-H
M=70 at 9&]W;B!R97%U97-T960@:6YI=&EA;&EZ960@<W5B<WES=&5M<R J+PT*
M(” C:69N9&5F($1)4T%"3$5?0T123TT-"BHJBHJBHJBHJBHJ*@T
BHJ
M(#(R-“PR,CD@BHJ@T*+2TM(#$U-“PS,S$@+2TM+0T*(” )+RH at 56YI;G-T
M86QL(&%N>2!P87)A8VAU=&4@<VEG;F%L(&AA;F1L97)S(“HO#0H@( E31$Q?
M56YI;G-T86QL4&%R86-H=71E*“D[#0H@(‘T-"BL-“BL-“BL-“BL at +RH@4T1,
M7T-O;F9I9SH@(%-$3”!E>‘1E;G-I;VX at 9F]R(&EN:71I86QI>FEN9R!A=61I
M;R!A;F0@=FED96@=&-"BL@(“H@<&%R86UE=&5R<R!T:&%T(&-A;B!B92!O
M=F5R<FED96X at 8GD@=&AE(&5N9"UU<V5R+B @0VQE86YE<B!T:&%N#0HK(” J
M(&9I9&1L:6YG(’=I=&@@=&AE(&5N=FER;VYM96YT('9A<FEA8FQE<R!A;F0@
M8V%N(&)E(&QO861E9”!F<F]M#0HK(” J(&$@=F%R:65T>2!O9B!F:6QE(&9O
M<FUA=’,N#0HK(” J+PTPTPTR OB!4:&ES(&9U;F-T:6]N(&)E:&%V
M97,@<’)E=‘1Y(&UU8V@@;&EK92!31$Q?26YI=%-U8E-Y<W1E;2P at 97AC97!T
M#0HK(" J(&ET(’=O<FMS(’=I=&@@=&AE(%-$3%]#;VYF:6=?4W1R=6-T(’-T
M<G5C=“X@($EN(&9A8W0L(%-$3%]);FET4W5B4WES=&5M#0HK(” J(&YO=R!C
M86QL<R!U<RX-"BL@(“HO#0HK(&EN=”!31$Q?0V]N9FEG7TEN:713=6)3>7-T
M96T@
"!31$Q?0V]N9FEG7U-T<G5C=" J(&-O;F9I9R I#0HK('L-“BL-“BL@
M(VEF;F1E9B!$25-!0DQ%7U9)1$5/#0HK( DO*B!);FET:6%L:7IE('1H92!V
M:61E;R]E=F5N=”!S=6)S>7-T96T@B-"BL@“6EF(”@@”!C;VYF:6<M/G-U
M8E-Y<W1E;7,@)B!31$Q?24Y)5%]6241%3R I(“8F(”$H(%-$3%]I;FET:6%L
M:7IE9" F(%-$3%])3DE47U9)1$5/("D@*0T
R )>PTR )“6EF(”@@4T1,
M7U9I9&5O26YI=" H(&-O;F9I9RT^=FED96]$<FEV97(L("@@8V]N9FEG+3YS
M=6)3>7-T96US(“8 at 4T1,7TE.251?159%3E142%)%040@*2 I(#P@,” I#0HK
M( D)>PT
R )“0ER971U<FX@" M,2 I.PT**R )"7T-"BL@“0E31$Q?:6YI
M=&EA;&EZ960@?#T at 4T1,7TE.251?5DE$14[#0HK( E]#0HK(”-E;’-E#0HK
M( EI9B H(&-O;F9I9RT^<W5B4WES=&5M<R F(%-$3%])3DE47U9)1$5/("D-
M"BL@"7L-"BL@"0E31$Q?4V5T17)R;W(@
” B4T1,(&YO=”!B=6EL=”!W:71H
M(‘9I9&5O(’-U<’!O<G0B(“D[#0HK( D)<F5T=7)N(”@@+3$@3L-"BL@“7T-
M"BL@(V5N9&EF#0HK#0HK#0HK#0HK(”-I9FYD968 at 1$E304),15]!541)3PT

MR )+RH at 26YI=&EA;&EZ92!T:&4 at 875D:6@<W5B<WES=&5M(“HO#0HK( EI
M9B H(”@@8V]N9FEG+3YS=6)3>7-T96US(“8 at 4T1,7TE.251?055$24@2 F
M)B A
”!31$Q?:6YI=&EA;&EZ960@)B!31$Q?24Y)5%]!541)3R I("D-"BL@
M"7L-"BL@"0EI9B H(%-$3%]!=61I;TEN:70@
”!C;VYF:6<M/F%U9&EO1’)I
M=F5R(“D@/” P("D-"BL@"0E[#0HK( D)“7)E='5R;B H(“TQ(“D[#0HK( D)
M?0TR )“5-$3%]I;FET:6%L:7IE9”!/2!31$Q?24Y)5%]!541)3SL-"BL@
M"7T-"BL@(V5L<V4-"BL@“6EF(”@@8V]N9FEG+3YS=6)3>7-T96US("8 at 4T1,
M7TE.251?055$24@*0T
R )>PTR )“5-$3%]3971%<G)O<B H(”)31$P@
M;F]T(&)U:6QT(’=I=&@@875D:6@<W5P<&]R="(@3L-"BL@"0ER971U<FX@
M
" M,2 I.PT
R )?0TR C96YD:68-"BL-"BL-"BL-"BL@(VEF;F1E9B!$
M25-!0DQ%7U1)34524PT
R )+RH at 26YI=&EA;&EZ92!T:&4@=&EM97(@<W5B
M<WES=&5M(“HO#0HK( EI9B H(”$@=&EC:W-?<W1A<G1E9” I#0HK( E[#0HK
M( D)4T1,7U-T87)T5&EC:W,@" I.PTR )"71I8VMS7W-T87)T960@/2 Q
M.PT
R )?0T**R ):68@
” H(&-O;F9I9RT^<W5B4WES=&5M<R F(%-$3%])
M3DE47U1)3452(“D@)B8@(2@@4T1,7VEN:71I86QI>F5D(“8 at 4T1,7TE.251?
M5$E-15(@2 I#0HK( E[#0HK( D):68@”!31$Q?5&EM97));FET(”@@2
M(# @0TR )"7L-"BL@“0D)<F5T=7)N(”@@+3$@*3L-"BL@"0E]#0HK( D)
M4T1,7VEN:71I86QI>F5D('P](%-$3%])3DE47U1)3452.PT
R )?0TR C
M96QS90T
R ):68@
"!C;VYF:6<M/G-U8E-Y<W1E;7,@)B!31$Q?24Y)5%]4
M24U%4B I#0HK( E[#0HK( D)4T1,7U-E=$5R<F]R("@@(E-$3"!N;W0 at 8G5I
M;'0@=VET:"!T:6UE<B!S=7!P;W)T(B I.PTR )"7)E='5R;B H("TQ(“D[
M#0HK( E]#0HK(”-E;F1I9 at T
PTPTPTR C:69N9&5F($1)4T%"3$5?
M2D]94U1)0TL-"BL@"2\J($EN:71I86QI>F4@=&AE(&IO>7-T:6-K(’-U8G-Y
M<W1E;2 J+PT
R ):68@
” H(&-O;F9I9RT^<W5B4WES=&5M<R F(%-$3%])
M3DE47TI/65-424-+(“D@)B8@(2@@4T1,7VEN:71I86QI>F5D(“8 at 4T1,7TE.
M251?2D]94U1)0TL@2 I#0HK( E[#0HK( D):68@”!31$Q?2F]Y<W1I8VM)
M;FET(”@@2 (# @0TR )"7L-"BL@“0D)<F5T=7)N(”@@+3$@*3L-"BL@
M"0E]#0HK( D)4T1,7VEN:71I86QI>F5D('P](%-$3%])3DE47TI/65-424-+
M.PT
R )?0TR C96QS90TR ):68@
"!C;VYF:6<M/G-U8E-Y<W1E;7,@
M)B!31$Q?24Y)5%]3UE35$E#2R I#0HK( E[#0HK( D)4T1,7U-E=$5R<F]R
M("@@(E-$3"!N;W0 at 8G5I;'0@=VET:"!J;WES=&EC:R!S=7!P;W)T(B I.PT

M
R )"7)E='5R;B H("TQ(“D[#0HK( E]#0HK(”-E;F1I9 at TPTPTPT*
M*R C:69N9&5F($1)4T%"3$5?0T123TT-“BL@“2\J($EN:71I86QI>F4@=&AE
M($-$+5)/32!S=6)S>7-T96T@B-"BL@“6EF(”@@”!C;VYF:6<M/G-U8E-Y
M<W1E;7,@)B!31$Q?24Y)5%]#1%)/32 I(“8F(”$H(%-$3%]I;FET:6%L:7IE
M9” F(%-$3%])3DE47T-$4D]-("D@*0T
R )>PTR )“6EF(”@@4T1,7T-$
M4D]-26YI=" H(“D@/” P("D-"BL@"0E[#0HK( D)"7)E='5R;B H("TQ("D[
M#0HK( D)?0T
R )“5-$3%]I;FET:6%L:7IE9”!/2!31$Q?24Y)5%]#1%)/
M33L-"BL@"7T-“BL@(V5L<V4-“BL@“6EF(”@@8V]N9FEG+3YS=6)3>7-T96US
M(“8 at 4T1,7TE.251?0T123TT@0TR )>PTR )“5-$3%]3971%<G)O<B H
M(”)31$P@;F]T(&)U:6QT(’=I=&@@8V1R;VT@<W5P<&]R="(@3L-"BL@"0ER
M971U<FX@
" M,2 I.PTR )?0TR C96YD:68-"BL-"BL@“7)E='5R;B P
M.PTR!]#0HK#0HK#0HK#0HK("\J(%1H:7, at 9G5N8W1I;VX at 8F5H879E<R!P
M<F5T='D@;75C:"!L:6ME(%-$3%]);FET+"!E>&-E<‘0-"BL@(“H@:70@=V]R
M:W,@=VET:”!T:&4 at 4T1,7T-O;F9I9U]3=’)U8W0@<W1R=6-T+B @26X at 9F%C
M="P at 4T1,7TEN:70-"BL@("H@;F]W(&-A;&QS('5S+ at T
R @B-“BL@:6YT
M(%-$3%]#;VYF:6=?26YI=” H(%-$3%]#;VYF:6=?4W1R=6-T("H at 8V]N9FEG
M("D-"BL@>PTR )+RH at 0VQE87(@=&AE(&5R<F]R(&UE<W-A9V4@*B-“BL@
M"5-$3%]#;&5A<D5R<F]R(”@@*3L-"BL-"BL@"2\J($EN:71I86QI>F4@=&AE
M(&1E<VER960@<W5B<WES=&5M<R J+PT
R ):68@
”!31$Q?0V]N9FEG7TEN
M:713=6)3>7-T96T@
”!C;VYF:6<@2 (# @0TR )>PTR )"7)E='5R
M;B H("TQ("D[#0HK( E]#0HK#0HK( DO
B!%=F5R>71H:6YG(&ES(&EN:71I
M86QI>F5D(“HO#0HK( EI9B H(”$H(&-O;F9I9RT^<W5B4WES=&5M<R F(%-$
M3%])3DE47TY/4$%204-(551%(“D@0TR )>PTR )“5-$3%]);G-T86QL
M4&%R86-H=71E(”@@3L-"BL@"7T-"BL-“BL@“7)E=‘5R;B H(# @3L-"BL@
M?0TPTPTPTPT**R O
B!3970 at 82!F97<@9&5F875L=’,L(&AO<&5F
M=6QL>2!T:&5S92!W:6QL(&UE86X at 82!S=6-C97-F=6P-“BL@(“H@:6YI=”!O
M;B!!3ED@<&QA=&9O<FT@<VAO=6QD('1H97D at 8F4@=7-E9”!W:71H;W5T(&UO
M9&EF:6-A=&EO;@T**R @B-“BL@=F]I9”!31$Q?0V]N9FEG7T1E9F%U;'1#
M;VYF:6<@
”!31$Q?0V]N9FEG7U-T<G5C=” J(&-O;F9I9R I#0HK(‘L-"BL@
M"6-O;F9I9RT^<W5B4WES=&5M<R ](# [#0HK#0HK( EC;VYF:6<M/G9I9&5O
M1’)I=F5R(#T at 3E5,3#L-"BL@“6-O;F9I9RT^=VED=&@@/2 S,C [#0HK( EC
M;VYF:6<M/FAE:6=H=” ](#(P,#L-"BL@"6-O;F9I9RT^8G!P(#T@,#L-"BL@
M"6-O;F9I9RT^=FED96]&;&%G<R ](%-$3%]35U-54D9!0T4[#0HK#0HK( EC
M;VYF:6<M/F%U9&EO1’)I=F5R(#T at 3E5,3#L-"BL@"6-O;F9I9RT^9G)E<75E
M;F-Y(#T@,C(P-3 [#0HK( EC;VYF:6<M/F-H86YN96QS(#T@,3L-"BL@"6-O
M;F9I9RT^9F]R;6%T(#T at 055$24]?53@[#0HK( EC;VYF:6<M/F%U9&EO0G5F
M9F5R<R ](#0P.38[#0HK('T-“BL-”@T
(" O
B!2971U<FX@=&AE(&QI8G)A
M<GD@=F5R<VEO;B!N=6UB97(@B-"B @8V]N<W0 at 4T1,7W9E<G-I;VX@B!3
M1$Q?3&EN:V5D7U9E<G-I;VXH=F]I9"D-"DEN9&5X.B!M86EN+W=I;C,R+V5X
M<&]R=’,O4T1,+F1E9 at T
/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]
M/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/0T
4D-3(&9I
M;&4Z(”]C=G,O4T1,3(O<W)C+VUA:6XO=VEN,S(O97AP;W)T<R]31$PN9&5F
M+‘8-"G)E=’)I979I;F<@<F5V:7-I;VX@,2XQ+C$N,0T
9&EF9B M8R M<C$N
M,2XQ+C$@4T1,+F1E9 at TBHJ(&UA:6XO=VEN,S(O97AP;W)T<R]31$PN9&5F
M"3(P,#$O,#0O,C8@,38Z-#4Z-#4),2XQ+C$N,0T*+2TM(&UA:6XO=VEN,S(O
M97AP;W)T<R]31$PN9&5F"3(P,#$O,#8O,3@@,#(Z,C0Z,#0-"BHJBHJBHJ
MBHJBHJ*@T
BHJ(#,L.” JBHJ#0HM+2T@,RPQ,2 M+2TM#0H@( E31$Q?
M475I=%-U8E-Y<W1E;0T
(” )4T1,7U=A<TEN:70-"B @"5-$3%]1=6ET#0HK
M( E31$Q?0V]N9FEG7TEN:713=6)3>7-T96T-"BL@"5-$3%]#;VYF:6=?26YI
M= T**R )4T1,7T-O;F9I9U]$969A=6QT0V]N9FEG#0H@( E31$Q?1V5T07!P
K4W1A=&4-"B @"5-$3%]!=61I;TEN:70-"B @“5-$3%]!=61I;U%U:70-”@``
`
end

For example: the user must set the video mode with SDL and then
convert and blit the surface returned by IMG_Load to the screen.
SDL_Sound could load WAV, MP3, MOD, etc… in a similar way,
returning
a bunch of channels that can be hooked up (with or without
processing)
to the audio device that was opened and initialized simiarily to how
the video mode/surface is opened and initialized.

In case that wasn’t clear, I would like Mix_OpenAudio to be a core SDL
function, similar to SDL_SetVideoMode (say, SDL_SetAudioMode) and the
most of the audio stuff to be part of the core, except “audio file
decoders”, which can be in their own library.–

Olivier A. Dagenais - Software Architect and Developer

Hi there!

I’m quite new here and I have a question on $subj. We are writting an
emulator using SDL and we have gone into problems with mouse speed.

If I use the $subj call under X11 then the mouse changes its response time
(I feel it this way). I tried to keep the mouse within the window NOT
using GrabInput and this fails for probably known reason: I can’t simply
detect the mouse goes out of the window and simply WrapMouse back to the
lastly stored coordinates within the window. This causes the X mouse
flashing when at the edge (when moreover is hidden).

If I detect the mouse focus in the event loop and when the mouse left my
window I store the mouse position and when the mouse enters the window I
set the position (of the X mouse cursor) to the lastly stored coordinates.
This approach fails too just because the emulated mouse has a bit slower
response than the X one and so if I move the mouse too quicky towards the
SDL window the mouse move event is lost somehow (it is quite
intelligible).

Could anyone say why the mouse move events are differrent in GrabInput
mode to normal mode? I also have tried the env variable
SDL_VIDEO_X11_MOUSEACCEL, but I’ve found this not very useful.

regards

STan

Could anyone say why the mouse move events are differrent in GrabInput
mode to normal mode?

Well, I’ve played a bit with this. As long I’m not the SDL approved
developper (read: I don’t have the cvs write access ) and I don’t know the
consequences I can’t say whether the following patch is applicable or not
(read this like: if the patch would affect other SDL applications or not
even maybe on differrent OSes than Linux).On Tue, 19 Jun 2001, Standa Opichal wrote:

===================================================================
RCS file: /cvs/SDL12/src/video/x11/SDL_x11wm.c,v
retrieving revision 1.2
diff -r1.2 SDL_x11wm.c
279c279
< GrabModeAsync,
GrabModeAsync,

                                          GrabModeSync,

GrabModeAsync,

this is done in the

SDL_GrabMode X11_GrabInputNoLock(_THIS, SDL_GrabMode mode)

for the calls like:

result = XGrabPointer(SDL_Display, SDL_window, True, 0, GrabModeAsync,
GrabModeAsync, SDL_window, None, CurrentTime);

the change is for the pointer_mode argument to synchro mode… I don’t
even know X wins in detailed scope, but it it works here for me, so I
wander this could be a good patch fo SDL or not. There are also another
XGrabPointer calls in the X driver that could be changed in this way too,
so please check if this is good or not.

best regards

STan

Errrr… Anybody? Bueller? Bueller?–

Olivier A. Dagenais - Software Architect and Developer

“Olivier Dagenais” <olivier.dagenais at canada.com> wrote in message
news:9gmh4u$p1n$1 at ftp.lokigames.com

I have been wanting something similar to OpenPTC’s ptc.cfg mechanism
for supplying different parameters to hardware-independent SDL
applications, so I put this together.

It’s essentially a way to specify what audio or video driver you
want
to use and with what parameters, like resolution, bit depth,
frequency, bits per sample, etc… all without recompiling an SDL app
that makes use of this mechanism. It also means you don’t have to
add
command-line options to your SDL app or fiddle with environment
variables so that your users can configure your app to run how they
like it on their computer.

This diff was done on the SDL12 cvs, last night. Not much has
changed
in the area where the modifications have been made since the
official
1.2 release, anyway… It should be 100% compatible with SDL apps
that don’t make use of the new struct. This was developed and
tested
on my Win95 machines.

A sample use can be found at
http://groups.yahoo.com/group/opendemogroup/message/27

(again, compiled and tested on Windows but should work on other
platforms)

It would be neat if something like this found its way in version
1.3,
where audio and video (and perhaps other subsystems) could be
configured from an external file and SDL_Mixer behaved a bit more
like
SDL_Image in how it is a loader that creates a destination for the
source file that the user must manage to the output device.

For example: the user must set the video mode with SDL and then
convert and blit the surface returned by IMG_Load to the screen.
SDL_Sound could load WAV, MP3, MOD, etc… in a similar way,
returning
a bunch of channels that can be hooked up (with or without
processing)
to the audio device that was opened and initialized simiarily to how
the video mode/surface is opened and initialized.

Anyway, I’d like to know what people think and if some of you think
this could be useful and better than a putenv hack of some sort or
by
calling internal SDL initialization functions to do the same thing.

Olivier A. Dagenais - Software Architect and Developer