Re: Problems Installing SDL

2017-06-05 Thread Tobias Leich
Hi, I pushed a fix: 
https://github.com/PerlGameDev/SDL/commit/8bbe63d0b9b0e565bdfce3d8f4ed945c5d950ee5


I also replied to this mailing list thread already, but perhaps it did 
not get through...



Am 05.06.2017 um 16:15 schrieb breno:

Hello!

After downloading/unpacking the SDL dist, try adding the following 
line to the top of inc/My/Builder/Darwin.pm:


use File::Spec::Functions qw(rel2abs);

and let us know how the build goes.

If it still fails, please let us know the output of:

* perl -V  (note capital V)
* set | grep -e SDL -e PERL
* perl -MData::Dumper -MAlien::SDL -E 'say 
Dumper(Alien::SDL->config(q(libs))); say 
Dumper(Alien::SDL->config(q(ld_shlib_map)))'


Thanks!

On Sat, Jun 3, 2017 at 7:52 PM pmesa1 > wrote:


Hello,

I need SDL for a project that I am working on however I am unable
to install it because when I run Build.pl I receive an error
"Undefined subroutine ::Builder::Darwin::rel2abs called at
inc/My/Builder/Darwin.pm line 115.". The same thing happens when I
install using cpan or manually. I don’t know where to go from here
so any help would be appreciated. Thank you.

Best,

Paul





Re: [Alien-SDL2] Don't use $ENV{HOME} (#6)

2014-08-02 Thread Tobias Leich
HOME is gone since Win7+, one should really use: File::HomeDir-my_home

Cheers

Am 02.08.2014 17:25, schrieb Kartik Thakore:
 Hi! 
 Hmm weird. Can you set your %home% variable?


 On Sat, Aug 2, 2014 at 7:53 AM, Alex notificati...@github.com
 mailto:notificati...@github.com wrote:

 Hi!

 I just installed Alien::SDL2 on my computer and I got the
 following output:

 Set up gcc environment - 3.4.5 (mingw-vista special r3)
 Build option used:
 Binaries Win/32bit SDL2 (20130305) RECOMMENDED
 (gfx, image, mixer, net, smpeg, ttf)
 Building Alien-SDL2
 Use of uninitialized value $ENV{HOME} in concatenation (.) or
 string at C:/Per
 l/lib/CPAN/Config.pm line 6.
 Fetching
 'http://strawberryperl.com/package/kmx/sdl/32bit_SDL2_20130305.zip'...

 There is $ENV{HOME}. Is it something that has to do with
 Alien::SDL2 or is it not related to this module? If it is related,
 then could we switch to File::HomeDir?

 —
 Reply to this email directly or view it on GitHub
 https://github.com/PerlGameDev/Alien-SDL2/issues/6.





Re: Legend for the colored bubbles

2014-06-10 Thread Tobias Leich
The is no meaning, just bare beauty :/

Cheers, Tobias

Am 10.06.2014 21:54, schrieb Alex:
 Hi!

 On sdl.perl.org, in the documentation section, there are bubbles or marbles 
 of different colors right before the links. Do they mean something or is it 
 just arbitrary beauty?

 Best regards,
 Alex

 Von meinem iPad gesendet



Re: perltidy style?

2013-08-16 Thread Tobias Leich
+1

Am 15.08.2013 02:12, schrieb Mason James:
 On 2013-08-15, at 5:47 AM, Kartik Thakore wrote:

 :p Mason, if you make a .pertidy I will use it. (I think people prefer 
 spaces to tabs, and methods are like_this_for_now )
 cool!, and yes to spaces and that style of method names too


 guys, before i commit that file - can we have a quick vote for a perltidy 
 style?
 (i don't want anyone to be forced to use a perl-style they are unhappy with)

 +1 for the original -nopro 'larry wall' style and -pbp 
 (--perl-best-practices) style, from me


 anyone else?


 On Wed, Aug 14, 2013 at 4:13 AM, Tobias Leich em...@froggs.de wrote:
 There is more than *one* style? :P

 Cheers, Tobias

 PS: I'd say the set style is the one used mainly in the code.

 Am 13.08.2013 15:08, schrieb Mason James:
 hi all

 has anyone discussed a preferred perltidy style for the project, yet?




Re: automated building/testing for SDL_Perl?

2013-08-11 Thread Tobias Leich
Hi Mason,

that is pretty cool. If it does a rebuild and test after every commit,
can I see a matrix of commits?

Cheers, Tobias

Am 11.08.2013 21:20, schrieb Mason James:
 hi All

 I've recently learnt how to use the Travis [1] automated build system with 
 github repos

 its a pretty handy tool that detects errors in commits; and also builds/tests 
 your codebase after any commit series is pushed, on multiple versions of perl 
 even (currently 5.10 - 5.18) 


 with some pretty small changes, I've managed to get both the SDL and 
 Alien-SDL repos building/testing successfully with Travis [2][3]
 (i plan on sorting the SDL2 and Alien-SDL2 repos soon)

 so… is this something people are keen on using for SDL_Perl project?


 cheers, Mason

 [1] https://travis-ci.org/
 [2] https://travis-ci.org/KohaAloha/SDL
 [3] https://travis-ci.org/KohaAloha/Alien-SDL




Re: YUV Overlay

2013-08-05 Thread Tobias Leich
Hi, I installed UAV-Pilot right now, but it explodes like:
$ bin/uav_video_dump
Can't locate UAV/Pilot/Control/ARDrone/Video/FileDump.pm in @INC (@INC
contains: /etc/perl /usr/local/lib/perl/5.14.2
/usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5
/usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .) at
bin/uav_video_dump line 9.
BEGIN failed--compilation aborted at bin/uav_video_dump line 9.

Is there something I can do in order to test your example script?

Cheers, FROGGS

Am 24.07.2013 22:53, schrieb tmur...@wumpus-cave.net:
 I've made a simplified, standalone example:

 http://pastebin.com/dPPNc8VL

 The big array at the top is a single YUV420P frame.  Expected behavior
 is to display that frame in a window for 5 seconds, and then quit.  If
 I comment out the overlay handling, it displays a green background.

 I've verified that I'm running SDL 2.540.

 Thanks,
 Timm

 On 24.07.2013 08:17, Kartik Thakore wrote:
 Can we run this with out needing ARDdrone?

 On Wed, Jul 24, 2013 at 8:22 AM, tmur...@wumpus-cave.net wrote:

 Short on time at the moment, but I have the complete code on a
 github repo:

 https://github.com/frezik/UAV-Pilot [2]

 The relevant code is in UAV::Pilot::SDL::Video, and the decoding
 happens in the xs file for UAV::Pilot::Video::H264Decoder.  The test
 t/160_video_decode.t should run the decoding end of things. There's
 a test video in t_data/ardrone_video_stream_dump.bin, though that
 contains the PaVE headers from the UAV before each frame.  Those
 headers can be stripped out by bin/uav_video_dump.

 I'll try to come up with a more concise example later this evening.

 Thanks,
 Timm

 On 24.07.2013 01 [3]:00, Tobias Leich wrote:

 Hi, can you paste a complete example please? Maybe with a link to a
 test
 video file.

 What I would try first is SDL's latest release, which is 2.540 or so.

 Cheers, FROGGS

 Am 23.07.2013 23:44, schrieb tmur...@wumpus-cave.net:

 I'm working on a project involving decoding h.264 video frames with
 ffmpeg and then outputting them to an SDL surface. From what I've
 read, the YUV overlay is meant for this kind of job, but I'm having
 trouble getting it to work with the Perl bindings.

 One thing that seems odd to me in the Perl docs is:

 As of release 2.3 direct right to overlay is disable.

 Besides the typos, this troubles me because it seems that disabling
 the feature makes the YUV overlay completely useless.

 Not to be deterred, I wrote this code:

 SDL::Video::lock_YUV_overlay( $overlay );
 # The order of array indexen is correct, according to:
 # http://dranger.com/ffmpeg/tutorial02.html [1]
 my $pitches = $overlay-pitches;
 $$pitches[0] = scalar @{ $last_vid_frame[0] };
 $$pitches[2] = scalar @{ $last_vid_frame[1] };
 $$pitches[1] = scalar @{ $last_vid_frame[2] };
 my $pixels = $overlay-pixels;
 $$pixels[0] = $last_vid_frame[0];
 $$pixels[2] = $last_vid_frame[1];
 $$pixels[1] = $last_vid_frame[2];
 SDL::Video::unlock_YUV_overlay( $overlay );

 SDL::Video::update_rects( $sdl, $bg_rect );
 SDL::Video::display_YUV_overlay( $sdl, $bg_rect );

 When I run this, I get an error about not being able to find the
 pitches() method against the class SDL::Overlay.  Eh?  (Same thing
 happens for the pixels() method if I put that call first.) I can call
 width() and format() and such just fine on that object.

 If needed, I can handle the overlay entirely at the C level.  I may
 end up doing that anyway; the C array that comes out of ffmpeg is
 being transformed into a Perl array-of-arrays, which is going to
 be an
 expensive operation to do for 720p at 30 fps in realtime. But I'd
 like
 to try this at the Perl level for now.

 I might also have to convert the output from ffmpeg using
 sws_scale().  It's coming out in YUV420P mode, and I'm using YV12 to
 init the overlay. But I'd like to get the above working before
 messing
 with that.

 Thanks,
 Timm Murray



 Links:
 --
 [1] http://dranger.com/ffmpeg/tutorial02.html
 [2] https://github.com/frezik/UAV-Pilot
 [3] tel:24.07.2013%2001




Re: YUV Overlay

2013-08-05 Thread Tobias Leich
Hi, I am unable tun run that script either:

$ perl bin/uav_video_display
perl: symbol lookup error:
/usr/local/lib/perl/5.14.2/auto/UAV/Pilot/Video/H264Decoder/H264Decoder.so:
undefined symbol: av_init_packet

Do you have an example of your line-drawing problem somewhere?

Am 05.08.2013 15:58, schrieb tmur...@wumpus-cave.net:
 Well, that's a bug.  I'll have to update that script with the right
 module name.  Thanks for letting me know.

 That script only dumps the video to a file without displaying it.  The
 script 'uav_video_display', released with version 0.5, is the
 important one here.

 I ended up solving my overlay issue by doing most of it in C.  I
 probably needed to do this, anyway, as doing it with Perl
 datastructures would have meant creating an SV for each value in the
 three YUV channels and pushing them onto an AV.  720p is 0.9
 megapixels, so that would have been a very expensive operation to do
 30 times a second to handle realtime video.

 The C technique is used in the recently released UAV::Pilot v0.5.

 I have run across a new problem when trying to draw on top of the YUV
 overlay.  I can draw a line using the RGB colorspace, but it shows up
 black.  Maybe I need to convert RGB to YUV?  Or perhaps draw on a
 separate surface and blit that on top?

 Thanks,
 Timm

 On 05.08.2013 08:41, Tobias Leich wrote:
 Hi, I installed UAV-Pilot right now, but it explodes like:
 $ bin/uav_video_dump
 Can't locate UAV/Pilot/Control/ARDrone/Video/FileDump.pm in @INC (@INC
 contains: /etc/perl /usr/local/lib/perl/5.14.2
 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5
 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .) at
 bin/uav_video_dump line 9.
 BEGIN failed--compilation aborted at bin/uav_video_dump line 9.

 Is there something I can do in order to test your example script?

 Cheers, FROGGS

 Am 24.07.2013 22:53, schrieb tmur...@wumpus-cave.net:
 I've made a simplified, standalone example:

 http://pastebin.com/dPPNc8VL

 The big array at the top is a single YUV420P frame.  Expected behavior
 is to display that frame in a window for 5 seconds, and then quit.  If
 I comment out the overlay handling, it displays a green background.

 I've verified that I'm running SDL 2.540.

 Thanks,
 Timm

 On 24.07.2013 08:17, Kartik Thakore wrote:
 Can we run this with out needing ARDdrone?

 On Wed, Jul 24, 2013 at 8:22 AM, tmur...@wumpus-cave.net wrote:

 Short on time at the moment, but I have the complete code on a
 github repo:

 https://github.com/frezik/UAV-Pilot [2]

 The relevant code is in UAV::Pilot::SDL::Video, and the decoding
 happens in the xs file for UAV::Pilot::Video::H264Decoder.  The test
 t/160_video_decode.t should run the decoding end of things. There's
 a test video in t_data/ardrone_video_stream_dump.bin, though that
 contains the PaVE headers from the UAV before each frame.  Those
 headers can be stripped out by bin/uav_video_dump.

 I'll try to come up with a more concise example later this evening.

 Thanks,
 Timm

 On 24.07.2013 01 [3]:00, Tobias Leich wrote:

 Hi, can you paste a complete example please? Maybe with a link to a
 test
 video file.

 What I would try first is SDL's latest release, which is 2.540 or
 so.

 Cheers, FROGGS

 Am 23.07.2013 23:44, schrieb tmur...@wumpus-cave.net:

 I'm working on a project involving decoding h.264 video frames with
 ffmpeg and then outputting them to an SDL surface. From what I've
 read, the YUV overlay is meant for this kind of job, but I'm having
 trouble getting it to work with the Perl bindings.

 One thing that seems odd to me in the Perl docs is:

 As of release 2.3 direct right to overlay is disable.

 Besides the typos, this troubles me because it seems that disabling
 the feature makes the YUV overlay completely useless.

 Not to be deterred, I wrote this code:

 SDL::Video::lock_YUV_overlay( $overlay );
 # The order of array indexen is correct, according to:
 # http://dranger.com/ffmpeg/tutorial02.html [1]
 my $pitches = $overlay-pitches;
 $$pitches[0] = scalar @{ $last_vid_frame[0] };
 $$pitches[2] = scalar @{ $last_vid_frame[1] };
 $$pitches[1] = scalar @{ $last_vid_frame[2] };
 my $pixels = $overlay-pixels;
 $$pixels[0] = $last_vid_frame[0];
 $$pixels[2] = $last_vid_frame[1];
 $$pixels[1] = $last_vid_frame[2];
 SDL::Video::unlock_YUV_overlay( $overlay );

 SDL::Video::update_rects( $sdl, $bg_rect );
 SDL::Video::display_YUV_overlay( $sdl, $bg_rect );

 When I run this, I get an error about not being able to find the
 pitches() method against the class SDL::Overlay.  Eh?  (Same
 thing
 happens for the pixels() method if I put that call first.) I can
 call
 width() and format() and such just fine on that object.

 If needed, I can handle the overlay entirely at the C level.  I may
 end up doing that anyway; the C array that comes out of ffmpeg is
 being transformed into a Perl array-of-arrays, which is going to
 be an
 expensive operation

Re: YUV Overlay

2013-07-24 Thread Tobias Leich
Hi, can you paste a complete example please? Maybe with a link to a test
video file.

What I would try first is SDL's latest release, which is 2.540 or so.

Cheers, FROGGS

Am 23.07.2013 23:44, schrieb tmur...@wumpus-cave.net:
 I'm working on a project involving decoding h.264 video frames with
 ffmpeg and then outputting them to an SDL surface. From what I've
 read, the YUV overlay is meant for this kind of job, but I'm having
 trouble getting it to work with the Perl bindings.

 One thing that seems odd to me in the Perl docs is:

 As of release 2.3 direct right to overlay is disable.

 Besides the typos, this troubles me because it seems that disabling
 the feature makes the YUV overlay completely useless.

 Not to be deterred, I wrote this code:

 SDL::Video::lock_YUV_overlay( $overlay );
 # The order of array indexen is correct, according to:
 # http://dranger.com/ffmpeg/tutorial02.html
 my $pitches = $overlay-pitches;
 $$pitches[0] = scalar @{ $last_vid_frame[0] };
 $$pitches[2] = scalar @{ $last_vid_frame[1] };
 $$pitches[1] = scalar @{ $last_vid_frame[2] };
 my $pixels = $overlay-pixels;
 $$pixels[0] = $last_vid_frame[0];
 $$pixels[2] = $last_vid_frame[1];
 $$pixels[1] = $last_vid_frame[2];
 SDL::Video::unlock_YUV_overlay( $overlay );

 SDL::Video::update_rects( $sdl, $bg_rect );
 SDL::Video::display_YUV_overlay( $sdl, $bg_rect );

 When I run this, I get an error about not being able to find the
 pitches() method against the class SDL::Overlay.  Eh?  (Same thing
 happens for the pixels() method if I put that call first.) I can call
 width() and format() and such just fine on that object.

 If needed, I can handle the overlay entirely at the C level.  I may
 end up doing that anyway; the C array that comes out of ffmpeg is
 being transformed into a Perl array-of-arrays, which is going to be an
 expensive operation to do for 720p at 30 fps in realtime. But I'd like
 to try this at the Perl level for now.

 I might also have to convert the output from ffmpeg using
 sws_scale().  It's coming out in YUV420P mode, and I'm using YV12 to
 init the overlay. But I'd like to get the above working before messing
 with that.

 Thanks,
 Timm Murray



IRC-Chat is logged again

2013-05-23 Thread Tobias Leich
Hi, our irc-chat finally gets logged again, see:
http://irclog.perlgeek.de/sdl/today

If you have concerns about that please contact me directly, and I'll see
what I can do.

Cheers

--
Tobias


Re: SDL-Perl: Developing cross platform games

2013-03-06 Thread Tobias Leich
Hi Harman,

Am 03.03.2013 22:51, schrieb Harman:
 Hello,

 A little long email, so in the interest of time you could skip directly to
 the section marked Question in bold below :)


 *Context:*
 Currently using:
 SDL Version 1.2
 Platform (Windows for development)
 Visual Studio 2010
 *
 *
 I wanted to create cross platform games on Android/iOS/Windows which is
 where I came across SDL.

 I am proficient in unix shell scripting so I initially started out with
 learning python pygame as my language for games. Unfortunately I realized
 the games are not cross platform and I read about a few folks struggling
 online when porting. Lost 2 weeks

 I then started with SDL/C++ ( despite having being warned online against
 starting directly on C++). After 3 more weeks of learning SDL modules,
 tutorials, videos, I realized the warnings were not out of order :)

 C++ has never been the language of choice for me ( when I studied it in my
 degree course). Now it seems its a completely new language and a simple
 loop through a list of strings took me a while to code. (something which a
 1 line ls command in unix would do).

 Also today I spent 14+ hours finding a code base on how to render videos
 through SDL. ffMPEG, SMPEG on SDL didnt work since everytime there was a
 library file version mismatch with the code available online.


 *Question:*
 My 3rd attempt at game programming would be on perl since its again the
 closest to bash scripting ( I dont think I can handle C++ anymore ). Would
 be great if you could provide some pointers on the following:

 1) Are games on perl+SDL cross platform? i.e. Android/iOS/Windows
Well, there was/is an Android port of Perl, but I don't think it is in a
useful state right now.
iOS/Windows and Linux shouldn't be a problem though.
 2) How do I best approach learning the 2? as in which documents to read
 first for perl followed by SDL-perl tutorials?
This should be a good start:
https://github.com/PerlGameDev/SDL_Manual/raw/master/dist/SDL_Manual.pdf
For learning Perl there should be books even in your local Stores :o)
 3) Unrelated: I did not come across touch screen handling in SDL in my
 limited study of it. How are the same handled in SDL events?
The current SDL library we use will treat touch screens like a normal
mouse. But we are currently working
on libSDL2 bindings, which is capable of that.


 Would be great if you could provide some direction on this. Frankly my
 brain is scrambled after a decent start with SDL 2 weeks back.


 Cheers
 Harman


Cheers, Tobias



Fwd: Re: [SDL] [PATCH] DirectX - Failed loading D3DX9_*.dll

2013-03-05 Thread Tobias Leich
Hi, patch got applied.


 Original-Nachricht 
Betreff:Re: [SDL] [PATCH] DirectX - Failed loading D3DX9_*.dll
Datum:  Tue, 5 Mar 2013 18:53:20 -0800
Von:Sam Lantinga slou...@libsdl.org
Antwort an: SDL Development List s...@lists.libsdl.org
An: SDL Development List s...@lists.libsdl.org



Patch applied, thanks!

FYI, the best place to submit patches is buzilla so they don't get lost
in the mailing list traffic:
http://bugzilla.libsdl.org

Cheers!

On Tue, Mar 5, 2013 at 2:18 AM, Tobias Leich em...@froggs.de
mailto:em...@froggs.de wrote:

Hi, we have a patch for loading DirectX dlls on Windows.

Cheers, Tobias

 Original-Nachricht 
Betreff:DirectX - Failed loading D3DX9_*.dll
Datum:  Tue, 05 Mar 2013 11:09:05 +0100
Von:kmx k...@volny.cz mailto:k...@volny.cz
An: sdl-devel@perl.org mailto:sdl-devel@perl.org
sdl-devel@perl.org mailto:sdl-devel@perl.org



Hi Kartik and Tobias,

ad our last discussion on IRC.

I have investigated the warning Failed loading D3DX9_*.dll and
come up with the enclosed patch (please forward it to relevant SDL2
mailing list/bugtracker).

The warning has gone and DirectX seems to be loaded but I was not
able to test it more.

--
kmx



___
SDL mailing list
s...@lists.libsdl.org mailto:s...@lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org




___
SDL mailing list
s...@lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org



Re: SDL2.0 Dev

2013-02-28 Thread Tobias Leich
Hi kmx!

The decision to make Alien::SDL2 was already made :o)

So, feel free to create a new repository. I can do the linux/BSD-magic
then...

Cheers, Tobias

Am 28.02.2013 22:04, schrieb kmx:

 On 28.2.2013 2:09, Kartik Thakore wrote:
 Hey Froggs,

 I am in windows lappy lately :(. How do you compile SDL1.2 and can you
 compile SDL2.0 for strawberry perl?

 Hi Kartik,

 Check these:
 http://strawberryperl.com/package/kmx/sdl/32bit_SDL-2.0.0-6921_20130228.zip

 http://strawberryperl.com/package/kmx/sdl/64bit_SDL-2.0.0-6921_20130228.zip


 (just unpack them into c:\strawberry)

 If you decide to go for Alien:SDL2 I just want you to know that I am
 ready :)

 It is quite a long time since I was hacking on Alien::SDL

 -- 
 kmx



Re: SDL2.0 Dev

2013-02-28 Thread Tobias Leich
Thats not true, you still need to download and install the diectx sdk.

Am 28.02.2013 20:52, schrieb Kartik Thakore:
 How do I set that up? I opened it in vs2013 and it kept complaining
 about missing directx headers. But when I google it, msdn says that
 directx is part of vs2013 since vs2008. So fucking weird.

 Kartik Thakore

 On 2013-02-28, at 1:20 AM, Tobias Leich em...@froggs.de wrote:

 I'm using VC2010 Express or so... But I can give it a try to compile
 libSDL2.

 Am 28.02.2013 02:09, schrieb Kartik Thakore:
 Hey Froggs,

 I am in windows lappy lately :(. How do you compile SDL1.2 and can you
 compile SDL2.0 for strawberry perl?



Re: SDL2.0 Dev

2013-02-27 Thread Tobias Leich
I'm using VC2010 Express or so... But I can give it a try to compile
libSDL2.

Am 28.02.2013 02:09, schrieb Kartik Thakore:
 Hey Froggs,

 I am in windows lappy lately :(. How do you compile SDL1.2 and can you
 compile SDL2.0 for strawberry perl? 



AW: Fwd: [SDL] SDL 2.0 API stabilization

2013-02-22 Thread Tobias Leich
SDL2 is fine!

I'll make the perl 6 pendant at some point...

Kartik Thakore thakore.kar...@gmail.com hat geschrieben:

SDL 2.0 API is STABLE! I will be working on getting libperl-sdl2 started.
Any thoughts on name space?

SDL2 seems more logical. Would there be any issues with perl for having a
number in the package name?

-- Forwarded --
From: Sam Lantinga slou...@libsdl.org
Date: Mon, Feb 18, 2013 at 2:19 AM
Subject: [SDL] SDL 2.0 API stabilization
To: A list for developers using the SDL library. (includes SDL-announce) 
s...@lists.libsdl.org


We're on the road to release for SDL 2.0.

To that end, most of the existing APIs are stable, and we'll only change
them if it's critical.
There are a few things which are still being considered, such as the iOS
event handling, and touch/mouse event semantics, but by and large the API
is set for release.

Please report bugs which are affecting you in the current snapshot:
http://www.libsdl.org/tmp/SDL-2.0.zip

If anyone wants to fix anything currently in bugzilla, they are more than
welcome:
http://bugzilla.libsdl.org

Cheers!
--Sam

___
SDL mailing list
s...@lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Re: install SDL fails for Strawberry Perl 5.16.2 x64

2013-01-09 Thread Tobias Leich
Already solved via irc.

Win7 with strawberry x64 is buggy, the x86 is fine.

Cheers, Tobias

Am 09.01.2013 16:41, schrieb Kartik Thakore:
 Can you paste the output?

 Thanks

 On Tue, Jan 8, 2013 at 5:32 AM, Dov Levenglick 
 dov.levengl...@gmail.comwrote:

 Hi,
 When performing
 cpan install SDL

 The mixer_channelstest causes Perl to crash.



בברכה  |  Best Regards,
 דוב לוונגליק  |  Dov Levenglick




Re: PDL image to SDL::Surface

2012-09-24 Thread Tobias Leich
Hi Chris,

The performance is poor of course.

I tried to use the piddels pointer (-dataref or so) but it looks like
it is not pointing to a usable memory area.
It looks like there are more than 4 bytes per pixel, and libSDL can't
handle that.

The pdl.pl example is working, I see colored squares.

I think we should need to improve our examples btw, there is not a
single comment, thats bad.
In the pdl.pl is a var $ref, which is never used. Thats a bit confusing.

Cheers, Tobias

Am 24.09.2012 16:09, schrieb Chris Marshall:
 I took a look at the gist and it looks reasonable
 (I can't run it because I don't have the SDL module
 and lib installed on my system), however...

 I would expect the performance to be *very* poor
 since the image data is essentially being converted
 from packed byte data to a perl list and then poked
 a byte at a time into the SDL surface data.

 The better approach would be to wrap a PDL object
 (a.k.a. piddle) into an SDL surface.  Then you could
 just lock, copy the data via a PDL direct assignment,
 unlock and use SDL.  There is an examples/pdl.pl
 that shows how to do the wrapping.

 BUT, I took a look at the xs code and it appears
 that your SDL_Surface objects no longer use a
 packed-string representation for the SDL surface
 data.  If that is the case, I would be surprised if
 the pdl.pl example works at all now.

 If someone could verify this, I would appreciate it.
 If that is the case, it should be straightforward to
 modify the SDL_CreateRGBSurfaceFrom routine
 to allow for a SvPV for pixel data as one alternative.

 Given the power of PDL for whole-image data
 manipulation, allowing for easy interoperability
 with the current SDL module would benefit both
 our user and developer communities.

 Regards,
 Chris


 On Sun, Sep 23, 2012 at 3:07 PM, Tobias Leich em...@froggs.de wrote:
 Hi, Andrei asked some days ago how to load an image via PDL and but it
 in a Surface to use it in SDL.

 The example is here: https://gist.github.com/3772701

 I'll put that in the examples folder too.

 Cheers, Tobias



Re: PDL image to SDL::Surface

2012-09-24 Thread Tobias Leich

Am 24.09.2012 18:07, schrieb Chris Marshall:
 On Mon, Sep 24, 2012 at 10:41 AM, Tobias Leich em...@froggs.de wrote:
 Hi Chris,

 The performance is poor of course.

 I tried to use the piddle's pointer (-dataref or so) but it looks like
 it is not pointing to a usable memory area.
 $piddle-get_dataref returns a scalar reference to a perl
 PV whose string content _is_ the data block.  You should
 be able to get the starting location for the pixel data (i.e.,
 the string) via SvPV.
Okay, so we need to change the Surface's XS code to accept that.

 It looks like there are more than 4 bytes per pixel, and libSDL can't
 handle that.
 Per the above, the get_dataref returns an RV to an Sv with
 the data in the string.  It is just a contiguous block of memory.
 As far as I know, all the SDL memory buffers are just
 contiguous blocks of memory (ignoring variations due to
 stride, alignment,...)
The memory block is not the point. It matters how the pixels are stored
in that block.
LibSDL can use 1 to 4 bytes per Pixel. And we can tell it how a pixel
looks like. If it is RGB or RGBA or ABGR or whatever.
But it is important to know how the pixels are stored, since otherwise
it might use the alpha channel for the red color.

 The pdl.pl example is working, I see colored squares.
 I don't know what the output should look like.  I'm
 cc-ing our PDL mailing list in the hopes that someone
 with access to both PDL and SDL can give it a try.

 Is there a cygwin install of SDL and libSDL?
I'm afraid that cygwin support is currently half-broken. If you would
install only the libSDL core components and no SDL_ttf stuff you might
get a chance to install SDL-perl.

 I think we should need to improve our examples btw, there is not a
 single comment, thats bad.
 In the pdl.pl is a var $ref, which is never used. Thats a bit confusing.
 I think the ref is from a previous iteration in the code
 trying to get things working.

 Speaking of documentation, do you have any on the
 actual perl-libSDL bindings an data structures?  Trying
 to read XS is not the simplest way to sort things out---
 especially since I am far for an expert on some of the
 tricky XS technologies.
Of course. for example:
http://sdl.perl.org/documentation.html
http://search.cpan.org/~jtpalmer/SDL-2.540/
https://github.com/PerlGameDev/SDL/tree/master/lib/pods


 --Chris

 Cheers, Tobias

 Am 24.09.2012 16:09, schrieb Chris Marshall:
 I took a look at the gist and it looks reasonable
 (I can't run it because I don't have the SDL module
 and lib installed on my system), however...

 I would expect the performance to be *very* poor
 since the image data is essentially being converted
 from packed byte data to a perl list and then poked
 a byte at a time into the SDL surface data.

 The better approach would be to wrap a PDL object
 (a.k.a. piddle) into an SDL surface.  Then you could
 just lock, copy the data via a PDL direct assignment,
 unlock and use SDL.  There is an examples/pdl.pl
 that shows how to do the wrapping.

 BUT, I took a look at the xs code and it appears
 that your SDL_Surface objects no longer use a
 packed-string representation for the SDL surface
 data.  If that is the case, I would be surprised if
 the pdl.pl example works at all now.

 If someone could verify this, I would appreciate it.
 If that is the case, it should be straightforward to
 modify the SDL_CreateRGBSurfaceFrom routine
 to allow for a SvPV for pixel data as one alternative.

 Given the power of PDL for whole-image data
 manipulation, allowing for easy interoperability
 with the current SDL module would benefit both
 our user and developer communities.

 Regards,
 Chris


 On Sun, Sep 23, 2012 at 3:07 PM, Tobias Leich em...@froggs.de wrote:
 Hi, Andrei asked some days ago how to load an image via PDL and but it
 in a Surface to use it in SDL.

 The example is here: https://gist.github.com/3772701

 I'll put that in the examples folder too.

 Cheers, Tobias



PDL image to SDL::Surface

2012-09-23 Thread Tobias Leich
Hi, Andrei asked some days ago how to load an image via PDL and but it
in a Surface to use it in SDL.

The example is here: https://gist.github.com/3772701

I'll put that in the examples folder too.

Cheers, Tobias


Re: Next release

2012-08-24 Thread Tobias Leich
Hi, I tried exporting that machine from virtualbox, but it fails with a
stupid errormessage that I dont understand.
You cant access that box from internet, I'm sorry. I'll let you know
when I got an export of that machine.

Cheers.

Am 24.08.2012 18:21, schrieb Kartik Thakore:

 Ok i will twiddle with it. Do you have a freebsd machine I can ssh
 too? Or a vmware image?

 On Aug 24, 2012 4:11 AM, em...@froggs.de mailto:em...@froggs.de wrote:

 Hi pals!

 In the last time we did, in my opinion, a big mistake. In test
 scripts we checked for libpng like: SDL::Config-has('png'). But
 this didnt ever returned true, Simply because the HAVE_PNG was
 only set when actually building that lib in SDL. (Note: not
 Alien::SDL)
 This -has() method works pretty fine for stuff like SDL_gfx,
 since it will return true if we found SDL_gfx*.h. But there was no
 check for png.h at this stage. So even if we found libpng in
 system dirs or when we build it on our own, -has('png') never
 returned true.

 I changed the tests so it checks now for libpng in the shlib-hash
 that we get from Alien::SDL. This hash contains all found/build
 libs, and their path.

 And why does it fail then?
 BSD. LibPNG needs libz to run. Normally you would think that
 libpng is actually linked against libz, but hey, the BSD ppl dont
 think that way. I dont know the reasons but they decided to
 somehow build libpng without linking against libz.
 when you do: ldd /path/to/libpng.so you will get all the
 dependencies printed as a list. This works pretty fine on most
 systems, like on our ubuntu's and what not.
 On OpemBSD it prints an error message that the lib cant be loaded.
 But if you do LD_PRELOAD_LIBS=/path/to/libz.so ldd
 /path/to/libpng.so it will work. So we have to preload the lib in
 order libpng will use it.
 Doing this needs to happen on a very early level. Doing it from
 within a running perl is to late, even if we load libpng using
 DynaLoader.
 The only thing I can think about atm is that we run a perl, load
 that libz.so, and start a child perl process that does the stuff
 we do now.

 This problem applies to libpng (needs libz), libtiff (needs
 libjpeg) and libvorbis (needs libogg).
 Before YAPC::EU I was working hard on that thing, I guess I can
 supply a patch in a few days.

 Another problem that exists right now is that the old G4-Macs dont
 have a header file we want to use, I will debug that at some
 point. I dont think that there are so many users with a G4. These
 fails only come from BinGOs so far.

 And there are still SDL::Controller(::Interface) fails. But since
 I dont really understand whats happening there it would be cool if
 the author (you kathekore ;o) would have a look at it.

 So far from me, I will write a msg about the YAPC later.

 See ya and take care,
 Tobias

 Zitat von Kartik Thakore thakore.kar...@gmail.com
 mailto:thakore.kar...@gmail.com:

 Awesome thanks.

 Kartik Thakore

 On 2012-08-23, at 9:40 PM, Jeffrey Palmer
 jeffrey.t.pal...@gmail.com mailto:jeffrey.t.pal...@gmail.com
 wrote:

 Hi,

 I think the problem is TIFF support on BSD and Solaris, but
 FROGGS will
 know for sure.

 Jeff

 On Thu, Aug 23, 2012 at 8:49 PM, Kartik Thakore
 thakore.kar...@gmail.com mailto:thakore.kar...@gmail.comwrote:

 Hey guys,

 It looks like SDL lastest experimental has quite a few bit
 of fails. May I
 get a summary of what the fails are?

 Regards







Re: sdl-config file for Alien::SDL

2012-07-09 Thread Tobias Leich
Good idea.

Ticket?

Am 09.07.2012 01:41, schrieb Kartik Thakore:
 Hey guys,

 I am proposing Alien::SDL makes sdl-config available as a script file. It
 would just print out config('libs') and etc. This way it makes it the same
 as using `sdl-config ...` in other XS projects. It is a pain to always to
 use Alien::SDL and so on.


 Regards





AW: Re: Current dev releases

2012-06-13 Thread Tobias Leich
My mistake...

Jeffrey Palmer jeffrey.t.pal...@gmail.com hat geschrieben:

Is the problem sdlx_controller_interface.t or sdlx_controller.t?  I'm not
seeing the failures for sdlx_controller_interface.t.

Jeff

On Wed, Jun 13, 2012 at 4:30 AM, em...@froggs.de wrote:

 Hi all,

 the current releases doesnt look that bad, but not quit good yet.

 Alien-SDL 1.435_1 ( 11 ALL, 11 PASSes )
 SDL 2.541_03 ( 12 ALL, 3 FAILs, 9 PASSes )

 These 3 fails are on FreeBSD, twice about sdlx_controllier_interface.t,
 one about loading a lib (SDL_mixer).

 SDL_mixer cant be loaded on this box because it cant find libogg and
 libvorbis, even when Alien::SDL found it during installation.

 So there will be a new dev release for Alien::SDL these days, providing
 the needed information about installed libs.
 There will be included a patch about MSVC (ActivePerl on windows) too,
 after that I hope we will get ActivePerl ppm packages for windows
 automagically!

 Btw, can sombody have a look at the SDLx::Controller::Interface issues?

 Cheers, Tobias




-- 
Jeffrey T. Palmer


Re: SDL 2.541_02 Released

2012-06-11 Thread Tobias Leich
Ya, it should.

So in the test it can read the file as an SDL::RWOps-object, but
SDL::Mixer::Music::load_MUS_RW can't handle it.
A few lines later SDL::Mixer::Music::load_MUS($ogg_test_file) failes too.

I'll check my VMs this evening, maybe I can reproduce that thing.

Am 11.06.2012 01:08, schrieb Jeffrey Palmer:
 This problems still occurs occasionally with Alien-SDL 1.434

  
   http://www.cpantesters.org/cpan/report/04921c82-b30c-11e1-9066-3d54fb7543f5

 I created an issue about this a while ago:

 https://github.com/PerlGameDev/SDL/issues/233

 The build option include ogg, but those same tests fail.  Should those
 tests pass with those build options?

 Jeff

 On Sun, Jun 10, 2012 at 1:21 PM, Tobias Leich em...@froggs.de
 mailto:em...@froggs.de wrote:

 Ya, would be sweet to make another dev release, requiring a newer
 Alien::SDL.

 Check t/mixer.t for audio support, its basically just that you try
 to init OGG, and skip if it fails.

 Am 10.06.2012 18:03, schrieb Jeffrey Palmer:
 So are we ready to bump our Alien::SDL prereq (at least in the
 dev release)?  Also, I'm assuming we should skip these tests if
 libogg support isn't available.  What's the proper way to detect
 audio format support?

 Jeff

 On Sat, Jun 9, 2012 at 9:51 PM, Tobias Leich em...@froggs.de
 mailto:em...@froggs.de wrote:

 Hi, the tester is still using the old Alien::SDL, this one
 doesnt build libogg and libvorbis.

 Jeffrey Palmer jeffrey.t.pal...@gmail.com
 mailto:jeffrey.t.pal...@gmail.com hat geschrieben:

 Hi All,
 
 I released SDL 2.541_02 today after Blaizer++ merged in his
 changes that
 were accidentally included in 2.538.  The early test reports
 are in and
 we're still having some issues with the SDL::Mixer::MixMusic
 tests that use
 ogg:
 
 
 
 http://www.cpantesters.org/cpan/report/5399278a-b262-11e1-bea2-18293af89482
 
 
 http://www.cpantesters.org/cpan/report/e352e802-b262-11e1-85c4-09343af89482
 
 If anyone has any problems, or if anyone knows what is
 causing this
 problem, please let us know.
 
 Thanks,
 Jeff




 -- 
 Jeffrey T. Palmer




 -- 
 Jeffrey T. Palmer


AW: Transparency?

2012-06-10 Thread Tobias Leich
Hi, you have to know that draw_rect works differently for your app surface and 
regular surfaces. If you draw to your app, the pixels just get the value of the 
color. But if you do this to a regular surface, and blit that to your app 
surface, the pixels will be blendet...
So create a new surface, modify that, blit and update.

Cheers

Jack Maney jma...@adknowledge.com hat geschrieben:

Hello,

I'm not so terribly new to Perl but very new to SDL.  I was fiddling with the 
following Hello, World!-ish code in the SDL manual:

use strict;
use warnings;

use SDL;
use SDLx::App;

my $app = SDLx::App-new( width= 800, height = 600 );

$app-draw_rect([ $app-width / 4, $app-height / 4,
  $app-width / 2, $app-height / 2, ],
  [ 0, 0, 255, 255] );

$app-update();

sleep(5);

and found that changing the alpha portion of the rectangle color (eg fading 
the rectangle out completely via [0,0,255,0]) had no effect on the rendering 
of the rectangle.  I did some searching on this and found some 
oldhttp://www.velocityreviews.com/forums/t906303-problem-with-alphachannel-with-sdl-xxx-blitting.html
 
questionshttp://markmail.org/message/lqtdvmmjmiryumrw#query:+page:1+mid:q63xng5hz7lpcsbl+state:results
 from 4+ years ago, but I'm wondering if there is a simple workaround or an 
approach that has come about since then.

Thank you for your time,

Jack




Re: SDL 2.541_02 Released

2012-06-10 Thread Tobias Leich
Ya, would be sweet to make another dev release, requiring a newer
Alien::SDL.

Check t/mixer.t for audio support, its basically just that you try to
init OGG, and skip if it fails.

Am 10.06.2012 18:03, schrieb Jeffrey Palmer:
 So are we ready to bump our Alien::SDL prereq (at least in the dev
 release)?  Also, I'm assuming we should skip these tests if libogg
 support isn't available.  What's the proper way to detect audio format
 support?

 Jeff

 On Sat, Jun 9, 2012 at 9:51 PM, Tobias Leich em...@froggs.de
 mailto:em...@froggs.de wrote:

 Hi, the tester is still using the old Alien::SDL, this one doesnt
 build libogg and libvorbis.

 Jeffrey Palmer jeffrey.t.pal...@gmail.com
 mailto:jeffrey.t.pal...@gmail.com hat geschrieben:

 Hi All,
 
 I released SDL 2.541_02 today after Blaizer++ merged in his
 changes that
 were accidentally included in 2.538.  The early test reports are
 in and
 we're still having some issues with the SDL::Mixer::MixMusic
 tests that use
 ogg:
 
 
 
 http://www.cpantesters.org/cpan/report/5399278a-b262-11e1-bea2-18293af89482
 
 
 http://www.cpantesters.org/cpan/report/e352e802-b262-11e1-85c4-09343af89482
 
 If anyone has any problems, or if anyone knows what is causing this
 problem, please let us know.
 
 Thanks,
 Jeff




 -- 
 Jeffrey T. Palmer


Re: Transparency?

2012-06-10 Thread Tobias Leich
These draw_something methods out of the SDLx packages just use blit at
the end anyway.

A tip: dont care about speed right now, just try to get things working.
Optimize at the end.

Cheers

Am 10.06.2012 18:42, schrieb Alex:
 Hi!

 When do we use blit and when do we use draw_something? Is blit faster / 
 better?

 Best regards,
 Alex

 -Ursprüngliche Nachricht-
 Von: Tobias Leich [mailto:em...@froggs.de] 
 Gesendet: Sonntag, 10. Juni 2012 10:47
 An: Jack Maney; sdl-devel@perl.org
 Betreff: AW: Transparency?

 Hi, you have to know that draw_rect works differently for your app surface 
 and regular surfaces. If you draw to your app, the pixels just get the value 
 of the color. But if you do this to a regular surface, and blit that to your 
 app surface, the pixels will be blendet...
 So create a new surface, modify that, blit and update.

 Cheers

 Jack Maney jma...@adknowledge.com hat geschrieben:

 Hello,

 I'm not so terribly new to Perl but very new to SDL.  I was fiddling with 
 the following Hello, World!-ish code in the SDL manual:

 use strict;
 use warnings;

 use SDL;
 use SDLx::App;

 my $app = SDLx::App-new( width= 800, height = 600 );

 $app-draw_rect([ $app-width / 4, $app-height / 4,
  $app-width / 2, $app-height / 2, ],
  [ 0, 0, 255, 255] );

 $app-update();

 sleep(5);

 and found that changing the alpha portion of the rectangle color (eg fading 
 the rectangle out completely via [0,0,255,0]) had no effect on the rendering 
 of the rectangle.  I did some searching on this and found some 
 oldhttp://www.velocityreviews.com/forums/t906303-problem-with-alphachannel-with-sdl-xxx-blitting.html
  
 questionshttp://markmail.org/message/lqtdvmmjmiryumrw#query:+page:1+mid:q63xng5hz7lpcsbl+state:results
  from 4+ years ago, but I'm wondering if there is a simple workaround or an 
 approach that has come about since then.

 Thank you for your time,

 Jack


 -
 eMail ist virenfrei.
 Von AVG überprüft - www.avg.de
 Version: 2012.0.2177 / Virendatenbank: 2425/5054 - Ausgabedatum: 07.06.2012 



AW: SDL 2.541_02 Released

2012-06-09 Thread Tobias Leich
Hi, the tester is still using the old Alien::SDL, this one doesnt build libogg 
and libvorbis.

Jeffrey Palmer jeffrey.t.pal...@gmail.com hat geschrieben:

Hi All,

I released SDL 2.541_02 today after Blaizer++ merged in his changes that
were accidentally included in 2.538.  The early test reports are in and
we're still having some issues with the SDL::Mixer::MixMusic tests that use
ogg:


http://www.cpantesters.org/cpan/report/5399278a-b262-11e1-bea2-18293af89482

http://www.cpantesters.org/cpan/report/e352e802-b262-11e1-85c4-09343af89482

If anyone has any problems, or if anyone knows what is causing this
problem, please let us know.

Thanks,
Jeff


Re: play videos

2012-05-05 Thread Tobias Leich
Hi,

basically smpeg support is there on windows (talking about the library
aka dll).
But the bindings to it (SDL::SMPEG) has never felt much love so its
still pre-alpha state.
We made tests at least a year ago and playing videos was like one frame
per second.

So if you are interested in that you may need to fiddle around with it,
but we are there to help and guide.

Cheers, FROGGS

Am 05.05.2012 21:06, schrieb Alex:
 Dear all!

 I want to play a video in a part of my application. How do I do that? Is
 there any documentation for this? 
 There are 2 cases I'm interested in: 
 a) play a video in a part of the application window. Imagine a window, a big
 rect and a button. The button starts the video playback.
 b) play a video in the background of a menu. Ever played Battlefield 1942?
 When starting up, there is an ugly menu with a video in the background. Such
 a thing would be cool!

 Here is some technical information:
 OS: Windows 7 x64
 Perl: strawberry perl 5.14.2 x64
 SDL: 2.536
 Alien::SDL: 1.43 (without smpeg support I think - how do I look up the
 things that are compiled in my bundle?)

 Best regards,
 Alex



Re: Problem viewing bug list via CPAN RT

2012-04-30 Thread Tobias Leich
Hi, this is a known issue and will be fixed on next release.

Thanks for your message.

Cheers, Tobias.

Am 28.04.2012 17:03, schrieb Alexander Becker:
 Hi there!

 If you go to this page on CPAN:
 http://search.cpan.org/~froggs/Alien-SDL-1.430/, you cannot access the
 View/Report Bugs link. 
 The target (http://search.cpan.org/~froggs/Alien-SDL-1.430/) returns an
 error (cannot connect to server).

 This should probably redirect to the github page, shouldn't it?

 HTH,
 Alex



Re: SDLx::Sprite rotation artifacts and size limitation

2012-04-23 Thread Tobias Leich
Hi Andreas,

Am 23.04.2012 09:53, schrieb Andreas Lund:
 Hi,

 Running Strawberry Perl on Win 7 x64 I have installed SDL and Alien::SDL from
 CPAN (selecting option 1) and I'm writing a twin stick shooter game for fun. I
 have three questions:

 1) When rotating sprites using the -rotation() method the sprites often get a
 line of artifact noise along one of the sides, usually the right and/or
 bottom edge of the original sprite. The effect is not constant and the
 original sprites are all 100% transparent at the edges so I believe the
 artifacts are introduced by the rotation algorithm. Or is it?
Do you have a screenshot? I just can think of problems when
anti-aliasing and transparency come together...

 2) After experimenting with different sprite sizes, it seems that there's a
 limit somewhere. When attempting to load a sprite that's too large, I get a
 seemingly valid sprite object that just doesn't seem to render anything. Is
 there a known size limit to sprites or could this be a driver issue? Or am I
 overlooking something?
See http://sdl.perl.org/SDL-GFX-Rotozoom.html, I believe width+height
must be less than 16384.

 3) How exactly does the 'alpha_key' property work? I tried setting it to the
 ubiquitous bright purple (FF00FF) but this just caused half my sprites to
 become completely invisible. When using PNG files with an alpha channel, using
 a key color seems pointless to me, which makes the POD example code somewhat
 confusing:

 # spawning can include almost all of the above:
 my $sprite = SDLx::Sprite-new(
   image   = 'hero.png',   # or surface = SDL::Surface
   rect= SDL::Rect,# or x = $x, y = $y
   clip= SDL::Rect,
   alpha_key = SDL::Color, # or [$r, $g, $b]
   alpha = 1,
   rotation  = 45, # degrees
  );
Ya, alpha and blitting is not the easiest things as someone might think.
If you have a png file with alpha channel, and applying an alpha color
key to it should reset the alpha channel. At least that is what I would
expect.
You cant mix the alpha channel and alpha key.


 If anyone is interested in a sneak peek, here's the code:
 http://floyd.atc.no/Programming/Perl/IfItMoves/2012-04-23.zip
Will have a look then ;o)

Cheers, FROGGS

 Suggestions are welcome :-)

 --
 Andreas Lund (fl...@atc.no)
 Tel: +47 90077162
 #include disclaimer.h
 Look at you hacker, panting and sweating as you run through my corridors.
 How can you challenge a perfect immortal machine? -- SHODAN, System Shock


Re: SDLx::Sprite rotation artifacts and size limitation

2012-04-23 Thread Tobias Leich
Hi again,

Its quit cool, but I'm not that good when it comes to do two things at
the same time ;o)

I can't see anything strange when rotating the player-sprite.

Cheers, FROGGS.

Am 23.04.2012 20:46, schrieb Tobias Leich:
 Hi Andreas,

 Am 23.04.2012 09:53, schrieb Andreas Lund:
 Hi,

 Running Strawberry Perl on Win 7 x64 I have installed SDL and Alien::SDL from
 CPAN (selecting option 1) and I'm writing a twin stick shooter game for fun. 
 I
 have three questions:

 1) When rotating sprites using the -rotation() method the sprites often get 
 a
 line of artifact noise along one of the sides, usually the right and/or
 bottom edge of the original sprite. The effect is not constant and the
 original sprites are all 100% transparent at the edges so I believe the
 artifacts are introduced by the rotation algorithm. Or is it?
 Do you have a screenshot? I just can think of problems when
 anti-aliasing and transparency come together...
 2) After experimenting with different sprite sizes, it seems that there's a
 limit somewhere. When attempting to load a sprite that's too large, I get a
 seemingly valid sprite object that just doesn't seem to render anything. Is
 there a known size limit to sprites or could this be a driver issue? Or am I
 overlooking something?
 See http://sdl.perl.org/SDL-GFX-Rotozoom.html, I believe width+height
 must be less than 16384.
 3) How exactly does the 'alpha_key' property work? I tried setting it to the
 ubiquitous bright purple (FF00FF) but this just caused half my sprites to
 become completely invisible. When using PNG files with an alpha channel, 
 using
 a key color seems pointless to me, which makes the POD example code somewhat
 confusing:

 # spawning can include almost all of the above:
 my $sprite = SDLx::Sprite-new(
   image   = 'hero.png',   # or surface = SDL::Surface
   rect= SDL::Rect,# or x = $x, y = $y
   clip= SDL::Rect,
   alpha_key = SDL::Color, # or [$r, $g, $b]
   alpha = 1,
   rotation  = 45, # degrees
  );
 Ya, alpha and blitting is not the easiest things as someone might think.
 If you have a png file with alpha channel, and applying an alpha color
 key to it should reset the alpha channel. At least that is what I would
 expect.
 You cant mix the alpha channel and alpha key.

 If anyone is interested in a sneak peek, here's the code:
 http://floyd.atc.no/Programming/Perl/IfItMoves/2012-04-23.zip
 Will have a look then ;o)

 Cheers, FROGGS
 Suggestions are welcome :-)

 --
 Andreas Lund (fl...@atc.no)
 Tel: +47 90077162
 #include disclaimer.h
 Look at you hacker, panting and sweating as you run through my corridors.
 How can you challenge a perfect immortal machine? -- SHODAN, System Shock


Re: install fails on win2003 32bit

2012-04-22 Thread Tobias Leich
Hi, looks like the test for SDL::Video::display_YUV_overlay(...) is failing.

You may force the install, because you wont ever need that.

Can you give me some more information so that I may reprodurce that problem?
Output of perl -V would be nice. Do you have any other compilers
installed (like MS Visual C)?
And, your os is a win2k3 server?

Cheers, FROGGS

Am 19.04.2012 12:22, schrieb Xiao Yafeng:
 attachment is test output with --verbose.

 C:\Perl\cpan\build\SDL-2.536-py1NeQperl Build.PL
 *** !!!WARNING!!! 
 This Release breaks back compatibility support with versions 2.4x and
 below
 **
 Using 'My::Builder::Windows' class ...
 Set up gcc environment - 3.4.5 (mingw-vista special r3)
 Set up gcc environment - 3.4.5 (mingw-vista special r3)
 Detecting available libraries ...
 [Alien::SDL] Testing header(s): SDL.h
 [Alien::SDL] Testing header(s): SDL_mixer.h
 [Alien::SDL] Testing header(s): SDL_imageFilter.h
 [Alien::SDL] Testing header(s): SDL_image.h
 [Alien::SDL] Testing header(s): SDL_ttf.h
 [Alien::SDL] Testing header(s): SDL_framerate.h
 [Alien::SDL] Testing header(s): SDL_gfxBlitFunc.h
 [Alien::SDL] Testing header(s): SDL_gfxPrimitives.h
 [Alien::SDL] Testing header(s): SDL_rotozoom.h
 [Alien::SDL] Testing header(s): SDL_Pango.h
 Writing config_data ...
 Saving some info to 'notes' ...
 [Alien::SDL] Testing header(s): execinfo.h, signal.h NOK: (execinfo.h:
 No such f
 ile or directory)
 Created MYMETA.yml and MYMETA.json
 Creating new 'Build' script for 'SDL' version '2.536'


Re: install fails on win2003 32bit

2012-04-22 Thread Tobias Leich
Is your VS2005 in PATH before perl?

Am 22.04.2012 13:40, schrieb Xiao Yafeng:
 Thanks for your reply!

 On Sun, Apr 22, 2012 at 6:55 PM, Tobias Leich em...@froggs.de
 mailto:em...@froggs.de wrote:

 Hi, looks like the test for SDL::Video::display_YUV_overlay(...)
 is failing.

 You may force the install, because you wont ever need that.


 I did, but below script don't work:
 use SDLx::App;
 my $app=SDLx::App-new(width=800,height=600,);
 $app-draw_rect([15,15,100,100],#rect
 [0,0,255,255],#blue
 );
 $app-update;
 sleep 5;#sowehavetimetosee!

 __OUTPUT__
 C:\perl sdl_test.pl http://sdl_test.pl
 No available video device at C:/Perl/site/lib/SDLx/App.pm line 109.
 SDLx::App::new('SDLx::App', 'width', 800, 'height', 600)
 called at sdl_t
 est.pl http://est.pl line 24


  

 Can you give me some more information so that I may reprodurce
 that problem?
 Output of perl -V would be nice. Do you have any other compilers
 installed (like MS Visual C)?
 And, your os is a win2k3 server?


 OS: win2k3 standard server, other compiler: VS 2005

 C:\perl -V
 Set up gcc environment - 3.4.5 (mingw-vista special r3)
 Summary of my perl5 (revision 5 version 12 subversion 4) configuration:

   Platform:
 osname=MSWin32, osvers=5.2, archname=MSWin32-x86-multi-thread
 uname=''
 config_args='undef'
 hint=recommended, useposix=true, d_sigaction=undef
 useithreads=define, usemultiplicity=define
 useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
 use64bitint=undef, use64bitall=undef, uselongdouble=undef
 usemymalloc=n, bincompat5005=undef
   Compiler:
 cc='C:/Perl/site/bin/gcc.exe', ccflags ='-DNDEBUG -DWIN32
 -D_CONSOLE -DNO_ST
 RICT -DHAVE_DES_FCRYPT -DUSE_SITECUSTOMIZE -DPERL_IMPLICIT_CONTEXT
 -DPERL_IMPLIC
 IT_SYS -DUSE_PERLIO -D_USE_32BIT_TIME_T -DPERL_MSVCRT_READFIX
 -DHASATTRIBUTE -fn
 o-strict-aliasing -mms-bitfields',
 optimize='-O2',
 cppflags='-DWIN32'
 ccversion='', gccversion='3.4.5 (mingw-vista special r3)',
 gccosandvers=''
 intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
 d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=8
 ivtype='long', ivsize=4, nvtype='double', nvsize=8,
 Off_t='__int64', lseeksi
 ze=8
 alignbytes=8, prototype=define
   Linker and Libraries:
 ld='C:\Perl\site\bin\g++.exe', ldflags ='-LC:\Perl\lib\CORE'
 libpth=\lib
 libs=-lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32
 -lshell32
 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion
 -lodbc32 -
 lodbccp32 -lcomctl32 -lmsvcrt
 perllibs=-lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32
 -ladvapi32 -lshel
 l32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm
 -lversion -lodbc
 32 -lodbccp32 -lcomctl32 -lmsvcrt
 libc=msvcrt.lib, so=dll, useshrplib=true, libperl=perl512.lib
 gnulibc_version=''
   Dynamic Linking:
 dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
 cccdlflags=' ', lddlflags='-mdll -LC:\Perl\lib\CORE'


 Characteristics of this binary (from libperl):
   Compile-time options: MULTIPLICITY PERL_DONT_CREATE_GVSV
 PERL_IMPLICIT_CONTEXT PERL_IMPLICIT_SYS
 PERL_MALLOC_WRAP PL_OP_SLAB_ALLOC USE_ITHREADS
 USE_LARGE_FILES USE_PERLIO USE_PERL_ATOF
 USE_SITECUSTOMIZE
   Locally applied patches:
 ActivePerl Build 1205 [294981]
 c6fbf28 [perl #71806] perldb does not setup %dbline with the
 shebang opt
 ion -d
 1fd8fa4 Add Wolfram Humann to AUTHORS
 f120055 make string-append on win32 100 times faster
 a2a8d15 Define _USE_32BIT_TIME_T for VC6 and VC7
 007cfe1 Don't pretend to support really old VC++ compilers
 6d8f7c9 Get rid of obsolete PerlCRT.dll support
 d956618 Make Term::ReadLine::findConsole fall back to STDIN if
 /dev/tty
 can't be opened
 321e50c Escape patch strings before embedding them in patchlevel.h
   Built under MSWin32
   Compiled at Jun 20 2011 18:35:25
   @INC:
 C:/Perl/site/lib/MSWin32-x86-multi-thread
 C:/Perl/site/lib
 C:/Perl/lib
 .
  


Re: install fails on win2003 32bit

2012-04-22 Thread Tobias Leich
I dont know if that is the problem, but I read:
DDraw Status: Disabled

On my WinXP box DDraw is enabled, and I can disable it manually.

dxdiag, on the third tab.

Cheers.

Am 22.04.2012 14:03, schrieb Xiao Yafeng:


 On Sun, Apr 22, 2012 at 7:54 PM, Tobias Leich em...@froggs.de
 mailto:em...@froggs.de wrote:

 h, Win2k3 does have DirectX? I'm running out of ideas right now...


 it does, ;) attachment is dxdiag output, would it help?


Re: How to play an mp3 file from a database

2012-04-22 Thread Tobias Leich
Hi Alex,

At first, you are on windows and used the prebuklt libSDL binaries
shipped with Alien::SDL?

If yes, mp3 should be supported, but only files without VBR. So please
try a few mp3 files and maybe check how it is encoded.

Then, to play an mp3 file from a database, do somethind like:

use DBI;
use SDL;
use SDL::Mixer;
use SDL::Mixer::Channels;
use SDL::Mixer::Samples;
use SDL::RWOps;

$dbh-prepare(SELECT music FROM ...);
$sth = $dbh-execute();
if( $row = $sth-fetchrow_hashref ) {
$rwops = SDL::RWOps-new_const_mem( $row-{music} );
$chunk = SDL::Mixer::Samples::load_WAV_RW( $rwops, 0 );
SDL::Mixer::Channels::play_channel( -1, $chunk, 1 );
}

Cheers, FROGGS


Am 22.04.2012 18:35, schrieb Alex:
 Dear all!

 It took me quite some time, but I'm moving forward. 
 Here are some screens from my vocabulary trainer:
 https://picasaweb.google.com/104129024313554475104/Vokabeltrainer?authuser=0
 authkey=Gv1sRgCKLyn6SSwIvCgwEfeat=directlink

 Now I want to play  a vocable audio file (that is of course, stored in a
 database :)). I can't use SDL::Mixer::Music for that, because there is
 already some background music playing. AFAIK I need to use
 SDL::Mixer::Samples.
 I tried it, but there occurred an error when using mp3 files: Cannot load
 music file [music/terminal.mp3]: Unrecognized sound file type at
 play_effect.pl line 34

 Here is the script:
 [code]
 #!perl
 use strict;
 use warnings;
 use utf8;

 use SDL;
 use SDL::Event;
 use SDL::Events;
 use SDLx::App;
 use SDLx::Controller;
 use SDL::Mixer;
 use SDL::Mixer::Music;
 use SDL::RWOps;
 use SDL::Mixer::Samples;
 use SDL::Mixer::Channels;
 SDL::init(SDL_INIT_AUDIO);
 SDL::Mixer::init( MIX_INIT_MP3 | MUS_MP3 );

 my $app = SDLx::App-new(
   title = 'play mp3 effect',
   exit_on_quit = 1,
 );

 unless( SDL::Mixer::open_audio( 44100, AUDIO_S16SYS, 2, 4096 ) == 0 ) {
   Carp::croak Cannot open audio: .SDL::get_error(); 
 }

 my $file = 'music/terminal.mp3';
 #my $file = 'music/br_crossing_bell_dop.r.wav';
 #my $file = 'music/Windows Logon Sound.wav';
 my $sample = SDL::Mixer::Samples::load_WAV( $file );

 unless( $sample ) {
   Carp::croak Cannot load music file [$file]:  . SDL::get_error();
 }

 my $playing_channel = SDL::Mixer::Channels::play_channel( -1, $sample, 0 );

 $app-run();

 SDL::Mixer::Music::halt_music();
 SDL::Mixer::close_audio;
 exit(0);
 [/code]

 There also occurred some other errors using .wav files:
 - Cannot load music file [music/br_crossing_bell_dop.r.wav]: Complex WAVE
 files not supported at play_effect.pl line 34
 - Cannot load music file [music/Windows Logon Sound.wav]: MPEG Layer 3 data
 not supported play_effect.pl line 34

 But, I only want to play mp3 files.

 Maybe you can hint me at the solution for this problem? How can I play an
 mp3 file once, e.g. on a button click event?

 Best regards,
 Alex

 -Ursprüngliche Nachricht-
 Von: breno [mailto:oainikus...@gmail.com] 
 Gesendet: Dienstag, 29. November 2011 06:34
 An: Alexander Becker
 Cc: sdl-devel@perl.org
 Betreff: Re: How to play an mp3 file from a database

 On Mon, Nov 28, 2011 at 8:13 PM, Alexander Becker alexanderbec...@gmx.net
 wrote:
 Dear all!

 Hi there!

 I just tried the example code of the SDL Manual where you play some music.
 By the SDL manual, I refer to the one that is hidden at the bottom of 
 the sdl.perl.org page, so that you really have to search for it in 
 order to find it - and even then you have to get along with an ugly github
 interface.
 There's a new project website under way, but we're missing people to work in
 it. Please join #sdl in irc.perl.org if you want to help us get it right :)

 So, in general: Is there a way to play mp3 files?
 Yup.

 If your libsdl was compiled with mp3 support, all you have to do
 (iirc) is set the MIX_INIT_MP3 (for effects) and MUS_MP3 (for audio) flags
 when you call SDL::Mixer::init():

   SDL::Mixer::init( MIX_INIT_MP3 | MUS_MP3 );

 then use load_MUS() and play_music() from SDL::Mixer::Music to play
 mp3 files as background music, or load_WAV() from SDL::Mixer::Samples to
 play mp3 effects (yes, the function is named load_WAV() but plays different
 formats too if they're available).

 The documentation in SDL::Mixer, SDL::Mixer::Music and SDL::Mixer::Samples
 should be helpful, as some of the test files (t/mixer_music.t comes to
 mind).

 And in particular: is there a way to play mp3 files that are in a
 variable?
 Or do I have to work with temporary files?

 Not sure. I *think* SDL::Mixer::quick_load_WAV( $buffer ) might do the right
 thing. You'll have to test it though.

 Cheers,

 breno 



Re: Unexpected Blue Pixels

2012-02-24 Thread Tobias Leich
Hi,

set_pixel() doesnt expect an SDL::Color object. It expects to get a
color value.

So if you have 24bit surface like you have for $app, then you have to
pass 0xRRGGBB values.
If you change the red/green/blumasks to something else, you have to pass
appropriate color values.

Please note that your $app surface doesnt have an alpha channel, even
when giving it a depth of 32.
If you are going to draw a pixel on a real 32bit surface you have to
pass colors in 0xRRGGBBAA format.

If you have an 8bit surface (with a palette) then you cant pass color
values but palette indexes.

Cheers, FROGGS

Am 24.02.2012 08:13, schrieb Jon Mitchell:
 Hi,

 I'm trying to convert some of my old SDL perl programs to use SDL perl
 version 2.536 on 64bit gentoo with perl-5.12.4. Unexpectedly
 everything that gets drawn using comes out with an blue tinge. For
 example:

 #!/usr/bin/perl -w

 use strict;

 use SDL;
 use SDL::Color;
 use SDLx::App;

 my $app = SDLx::App-new (title = 'Test', width = 320, height = 320);
 my $colour = SDL::Color-new (0,0,0);

 for my $x (0..319) {
$app-set_pixel(10, $x, $colour);
 }
 $app-sync;
 sleep(5);

 This draws a blue line, where I would have expected a black line. I've
 tried adding redmask, bluemask, greenmask and alphamask options to the
 App new call, without any noticeable effect.

 I wondered if someone could try the above code to see if it's
 something to do with my set up, or a bug in my code.

 Thanks,



[rt.cpan.org #75017] runtime failure on mac osx lion

2012-02-16 Thread Tobias Leich via RT
URL: https://rt.cpan.org/Ticket/Display.html?id=75017 

 [...]
 Note: the bugtracker link specified in the SDL dist is down.

You are right! I'll fix this in the next release. The bugtracker is here
soince a while: http://github.com/PerlGameDev/SDL/issues

 I have no problems building SDL (whether Alien::SDL uses option 1 (using
 detected existing sdl libraries installed by macports) or option 4
 (having the source downloaded and compiled by Alien::SDL). And the tests
 for SDL work fine. But any program I try to run with it fails with
 messages similar to the following (for Games::BubbleBreaker):

The difference between tests is that the tests are using a dummy display
device driver and the rest does not.


 $ perl -Iblib/lib -Iblb/arch bin/bubble-breaker.pl 
 objc[10720]: Class SDLTranslatorResponder is implemented in both

/Users/blue/local/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/auto/share/dist/Alien-SDL/1.430_a8dbcbda/lib/libSDL-1.2.0.dylib
 and /opt/local/lib/libSDL-1.2.0.dylib. One of the two will be used.
 Which one is undefined.
 [...]

Okay, looks like I need to have a look at the rpaths that are set during
building...

 [...]
 Feb 14 18:58:37 MyMac perl[10720] Error: kCGErrorInvalidConnection:
 CGSSetWindowTags: Invalid connection

On a Mac only console users have the rights to make a connection to a
display. The root user usually dont have this right. Are you running
bubblebreaker as root?
Maybe, but I'm not sure, you have to build Alien::SDL and SDL as user;
install as root; and run as user again. I hope this is not the case
because then we have a problem with the cpan-client.

Please reply to our mailing list, and feel free to open a new bug in our
new bugtracker. If you wont, I'll do this these days.

 [...]


Re: runtime failure on mac osx lion

2012-02-16 Thread Tobias Leich
I know perlbrew but just didnt seen it your message when I replied.
Using perlbrew is perfectly fine, this way we dont have problems with
console user rights.

The patches you mentioned are 4 years old, but maybe we can use some
stuff from it. It isnt much though.

I'll try to get my OSX 10.6 virtual machine back running again and test
there.

One last thing: You are logged on to the desktop with that blue user,
right?

Cheers.

Am 16.02.2012 00:08, schrieb b...@atmaildot.com:
 (replying to https://rt.cpan.org/Public/Bug/Display.html?id=75017 )

 Feb 14 18:58:37 MyMac perl[10720] Error: kCGErrorInvalidConnection:
 CGSSetWindowTags: Invalid connection
 On a Mac only console users have the rights to make a connection to a 
 display. The root user usually dont have this right. Are you running 
 bubblebreaker as root?
 No. I am using a perlbrewed perl (notice the paths). One the main
 benefits is that you can modify it without affecting the system perl.

 Maybe, but I'm not sure, you have to build Alien::SDL and SDL as user; 
 install as root; and run as user again. I hope this is not the case because 
 then we have a problem with the cpan-client.
 This would also mean it wouldn't work for perlbrew users. Installing
 as root would install to the system perl which is usually not the same
 perl.

 I see there is a macports package for sdl_perl [1] which includes
 several patchfiles. Maybe those need to be integrated into the SDL
 CPAN distribution?

 [1] https://trac.macports.org/browser/trunk/dports/perl/p5-sdl_perl




Re: perl SDL installation error

2012-02-14 Thread Tobias Leich
Hi Erick,

What version of SDL are you using?
run: perl -MSDL -e 'print $SDL::VERSION'

And what option did you choosed when instaling Alien::SDL?
run: config_data --module Alien::SDL --config

You may just paste the output of the two commands, then we should have
enough information to help you.

Cheers, FROGGS

Am 14.02.2012 19:39, schrieb Erick Bianes:
 Hi Guys,

 I hope I'm not bothering you too much. Thanks for working on this library!

 Just having some minor installation issues from perl SDL. I hope you
 can help me figure out what I'm doing wrong.

 I am unable to install SDL library. I am getting this error:
 t/sdlx_sound.t .. 1/? there is no soundcard
 SDL_mixer = 1.2.10 needed for SDL::Mixer::init( flags ) at
 lib/SDLx/Sound.pm line 35.
 SDL_mixer = 1.2.10 needed for SDL::Mixer::init( flags ) at
 lib/SDLx/Sound.pm line 35.

 t/mixer_music.t   (Wstat: 512 Tests: 35 Failed: 2)

 t/mixer_music.t . there is no soundcard
 t/mixer_music.t . 1/? Could not load SDL::RWOp object

 #   Failed test '[load_MUS_RW] isa SDL::Mixer::MixMusic'
 #   at t/mixer_music.t line 119.
 # [load_MUS_RW] isn't defined

 #   Failed test '[play_music_rw] plays test/data/silence.wav'
 #   at t/mixer_music.t line 120.
 #  got: undef
 # expected: '0'


 My machine is a lenovo thinkpad edge laptop running on ubuntu 11.04.

 I installed libsdl-mixer1.2 and libsdl-mixer1.2-dev  so I'm not really
 sure what else I could be missing. I followed the install instructions
 from the SDL_manual.

 Thanks,
 Erick



Re: Test problem on Debian/unstable armhf

2012-02-01 Thread Tobias Leich
Hi, you hit one of two problems I couldnt figure out yet right.

1) The problem you posted is IMO more a performance issue and will
happen on slow or busy machines.

2) t/mixer_channels.t: a problem with multithreading an C-callbacks.
This happens just on BSDs as far as I know.

It would help if I had a armhf virtual machine. How to get one?
There is no armhf iso-image. Is armel the same?
URL: http://www.debian.org/CD/jigdo-cd/

Cheers, Tobias

Am 01.02.2012 09:28, schrieb Dominique Dumont:
 Hello

 I've uploaded SDL-perl 2.536 on Debian/unstable . On armhf,
 sdlx-controller-interface test fails with the following message:

 # Failed test at t/sdlx_controller_interface.t line 109.
 # Structures begin differing at:
 # $got-[0] = '0'
 # $expected-[0] = '1'
 # Looks like you failed 1 test of 154.
 t/sdlx_controller_interface.t ...

 Any idea why ?

 The full build log is there:
 https://buildd.debian.org/status/fetch.php?pkg=libsdl-perlarch=armhfver=2.536-1stamp=1328045545

 (BTW you should use eq_or_diff from Test::Differences instead of
 is_deeply. we'd get more information from the test failure.)

 All the best

 --
 http://config-model.wiki.sourceforge.net/ -o-
http://search.cpan.org/~ddumont/
 http://www.ohloh.net/accounts/ddumont -o- http://ddumont.wordpress.com/





Re: SDL::Event - invalid button_state on SDL_MOUSEMOTION ?

2012-01-31 Thread Tobias Leich
Documentation tells that you have to use -motion_state instead of
-button_state.

See: http://sdl.perl.org/SDL-Event.html#Mouse_motion_events

--
Cheers, Tobias

Am 30.01.2012 23:23, schrieb Alex:
 Dear all!

 I'm still working on this kind of button-like widget and I want to implement
 the behaviour when hovering over the button.
 Unfortunately, the button_state does not work as I expected (maybe I
 expected it wrong). 

 When I click somewhere, continue to hold down the mouse button (so there is
 no SDL_MOUSEBUTTONUP event) and move the mouse, shouldn't
 $event-button_state return SDL_PRESSED (which is 1)?
 Because, using the script attached, I always get SDL_RELEASED (0).
 The single case where I get SDL_PRESSED is when I check it on
 SDL_MOUSEBUTTONDOWN.

 So, is this behaviour intended? 
 Or, to ask it in another way: do I have to keep track of the
 SDL_MOUSEBUTTONUP event myself in order to determine if the user still holds
 down the mouse button?

 Kind regards,
 Alex

 #!perl

 use strict;
 use warnings;
 use SDL;
 use SDLx::App;
 use SDL::Event;  # for the event object itself
 use SDL::Events; # functions for event queue handling

 my $app = SDLx::App-new(
   title = 'text wrap',
   exit_on_quit = 1,
   init = SDL_INIT_VIDEO
 );

 $app-add_show_handler( \render );
 $app-add_event_handler( \handle_events );

 $app-run();

 exit(0);

 sub handle_events {
 my $event = shift;
   my $controller = shift;
 
 if( $event-type == SDL_MOUSEMOTION ) {
 printf Button state: [%s]\n,$event-button_state;
 }
 
 return;
 }
  

 sub render {
 my ($delta, $app) = @_;
 
   $app-update();
   return;
 } # /render




Re: [SDL] SDL 1.2 and satellite libs PRE-RELEASE

2012-01-09 Thread Tobias Leich
I've attached the semaphore.h files of my systems, and the libSDL source
file that uses sem_timedwait.

Looks like _POSIX_C_SOURCE = 200112L || _XOPEN_SOURCE = 600 would be
the right switch according to http://linux.die.net/man/3/sem_timedwait .

Should it use the same ../generic/SDL_syssem.c like it does for macosx
when _POSIX_C_SOURCE = 200112L || _XOPEN_SOURCE = 600 isnt true?

Because You cant just replace SDL_SemWaitTimeout(), the structure of
SDL_semaphore differ.
 On Monday, January 09, 2012 at 12:17 PM, Tobias Leich wrote:

 I get the same issue on my NetBSD 5.1.3 i386. Are all BSD's affected?
 Can somebody approve?
 As I understand it, sem_timedwait isn't a part of BSD, so you're not likely 
 to 
 find it on any *BSD or Mac OS X or Solaris (though newer versions may have 
 it). 
 There ought to be a #define around code which uses it.

 -- c


/* $NetBSD: semaphore.h,v 1.3 2008/04/28 20:22:54 martin Exp $ */

/*-
 * Copyright (c) 2003 The NetBSD Foundation, Inc.
 * All rights reserved.
 *
 * This code is derived from software contributed to The NetBSD Foundation
 * by Christos Zoulas.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *notice, this list of conditions and the following disclaimer in the
 *documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#ifndef _SEMAPHORE_H_
#define _SEMAPHORE_H_

/* POSIX 1003.1b semaphores */

struct _sem_st;
typedefstruct _sem_st *sem_t;

#defineSEM_FAILED((sem_t *)0)
#defineSEM_VALUE_MAX-(~0U)

#include sys/cdefs.h
/* $NetBSD: semaphore.h,v 1.3 2008/04/28 20:22:54 martin Exp $ */

/*-
 * Copyright (c) 2003 The NetBSD Foundation, Inc.
 * All rights reserved.
 *
 * This code is derived from software contributed to The NetBSD Foundation
 * by Christos Zoulas.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *notice, this list of conditions and the following disclaimer in the
 *documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#ifndef _SEMAPHORE_H_
#define _SEMAPHORE_H_

/* POSIX 1003.1b semaphores */

struct _sem_st;
typedefstruct _sem_st *sem_t;

#defineSEM_FAILED((sem_t *)0)
#defineSEM_VALUE_MAX-(~0U)

#include sys/cdefs.h

__BEGIN_DECLS
int--- sem_close(sem_t *);
int--- sem_destroy(sem_t *);
int--- sem_getvalue(sem_t * __restrict, int * __restrict);
int--- sem_init(sem_t *, int, unsigned int);
int--- sem_post(sem_t *);
int--- sem_trywait(sem_t *);
int--- sem_unlink(const char *);
int--- sem_wait(sem_t *);
sem_t-*sem_open(const char *, int, ...);
__END_DECLS

#endif /* !_SEMAPHORE_H_ */

/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
   This file is part of the GNU C Library.

   The GNU C Library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General

Re: Button-Binding

2011-12-18 Thread Tobias Leich
Hi, if you use SDLx::App and its -run method you can use the event
handlers. SDLx::App is basically a huge while loop that loops over its
registered handlers.

If you are not using SDLx::App, you have to do it yourself in a while loop.

Thats it.

--
Cheers, FROGGS

PS: please forget about my office mail address.


Am 18.12.2011 21:34, schrieb Alex:

 Hm, when do I use a selfmade while loop that processes the event queue and
 when do I use add_event_handler() from SDLx for processing events?

 Kind regards,
 Alex

 -Ursprüngliche Nachricht-
 Von: Leich Tobias [mailto:tobias.le...@telent.de]
 Gesendet: Mittwoch, 14. Dezember 2011 10:27
 An: Alex
 Cc: sdl-devel@perl.org
 Betreff: Re: Button-Binding

 Hi, for b)

 Add an event listener like this
 http://sdl.perl.org/SDL-Events.html#SYNOPSIS
 and call the tk-callback when receiving the right event.
 (SDL_MOUSEBUTTONUP
 I suppose)

 Cheers, FROGGS

 mit freundlichen Grüßen

 Tobias Leich
 Entwicklung ICT

 telent GmbH - ein Unternehmen der euromicron Gruppe Rheinstraße 10B,
 D-14513
 Teltow

 Tel.:   +49-(0)3328 4590-512
 Fax.:   +49-(0)3328 4590-55 512
 Mobil:  +49-(0)152 579 39 064
 E-Mail: tobias.le...@telent.demailto:tobias.le...@telent.de
 Internet:   www.telent.dehttp://www.telent.de

 telent GmbH - ein Unternehmen der euomicron Gruppe, Sitz Backnang;
 Registergericht: Amtsgericht Stuttgart, HRB 738199
 Geschäftsführung: Dr. Stefan Kindt, Hans-Peter Fischer, Robert Blum,
 Alexander Thome

 Am 09.12.2011 22:00, schrieb Alex:

 Deal all!

 I continue my experiments with SDL. I found some old thread somewhere and
 now I have a button-like image that switches its appearance when I hover
 over it (with the mouse).

 Here are the questions:
 a) Is the code attached the recommended way to do it or should it be
 done in
 another fashion?
 b) I would like to add an action, when someone clicks the button. In
 Tk-terminology, this would be a callback. Any suggestions on how I
 should do
 this?

 Best regards,
 Alex

 [code]
 #!perl

 package My::SimpleButton;

 use strict;
 use warnings;
 use SDL;
 use SDLx::Rect;
 use Data::Dumper qw/Dumper/;

 =head1

 =cut

 sub new {
 my ($class,@params) = @_;
 my $self = {};
 bless($self,$class);
 for(qw(ID APP X Y IMG IMGHV IMGPRESSED)){
 $self-{$_} = shift(@params);
 }
 $self-{HV} = 0;

 $self-draw($self-{IMG});

 return($self);
 }



 sub draw{
 my ($self, $img) = @_;

 my $frame_rect = SDLx::Rect-new(0, 0, $img-width(), $img-height());
 my $dest_rect = SDLx::Rect-new(
 $self-{X},
 $self-{Y},
 $img-width(),
 $img-height(),
 );

 $self-{APP}-blit_by($img, [0, 0, $img-width(), $img-height()], [
 $self-{X},
 $self-{Y},
 $img-width(),
 $img-height(),
 ]);
 $self-{APP}-update();

 return 1;
 }

 sub check{
 my ($self,$mx,$my,$event) = @_;

 my $img = $self-{IMG};

 #Hover - Effekt
 if( $mx  $self-{X} 
 $mx  ($self-{X}+ $img-width)  
 $my  $self-{Y}
 $my  ($self-{Y}+ $img-height) ){

 if( !$self-{HV} ) {
 $self-{HV} = 1;
 $self-draw($self-{IMGHV});
 }

 } else {
 if($self-{HV}) {
 $self-{HV}=0;
 $self-draw($self-{IMG});
 }
 return 0;

 }

 return;
 }

 =head1 CREDITS

 c.f.
 Lhttp://www.perl-community.de/bat/poard/thread/7847http://www.perl-commun
 ity.de/bat/poard/thread/7847

 =cut

 1; # /My::SimpleButton

 use SDL;
 use SDLx::App;
 use SDL::Event;
 use SDL::Events;
 use SDLx::Surface;
 use SDL::Color;

 my $app = SDLx::App-new(
 w = 640,
 h = 400,
 exit_on_quit = 1,
 );
 $app-add_event_handler( \quit_event ); $app-add_event_handler(
 \mnouseover );

 my $img = SDLx::Surface-load( 'images/blueOpera_1.png' ); my $img2 =
 SDLx::Surface-load( 'images/blueOpera_2.png' ); my $img3 =
 SDLx::Surface-load( 'images/redOpera_2.png' );

 my $SimpleButton = My::SimpleButton-new(1, $app, 65, 25, $img, $img2,
 $img3);

 $app-run();

 sub quit_event {
 #The callback is provided a SDL::Event to use
 my $event = shift;

 #Each event handler also returns you back the Controller call it
 my $controller = shift;

 #Stopping the controller for us will exit $app-run() for us
 $controller-stop if $event-type == SDL_QUIT; } # /quit_event


 sub mnouseover {
 #The callback is provided a SDL::Event to use
 my $event = shift;

 #Each event handler also returns you back the Controller call it
 my $controller = shift;

 if( $event-type == SDL_MOUSEMOTION ) {
 my $click = $SimpleButton-check($event-motion_x,
 $event-motion_y,$event);
 }
 } # /mnouseover


 exit(0);
 [/code]





 Scanned by MailDefender - managed email security from intY -
 www.maildefender.net
 -
 eMail ist virenfrei.
 Von AVG überprüft - www.avg.de
 Version: 10.0.1415 / Virendatenbank: 2108/4084 - Ausgabedatum: 16.12.2011

Re: How to play an mp3 file from a database

2011-12-01 Thread Tobias Leich
Great!

So I will add RWOps support today, I'll drop you a note when its done.

Cheers, FROGGS

Am 30.11.2011 23:09, schrieb Alexander Becker:
 Hi!

 The example code in your link gives me version 1.2.11 on Win 7 x64 with
 strawberry perl 5.12.2 built for MSWin32-x64-multi-thread.

 HTH, 
 Alex

 [code]
  use SDL::Mixer;
  use SDL::Version;

  my $version = SDL::Mixer::linked_version();

  printf(%d.%d.%d\n, $version-major, $version-minor, $version-patch); #
 prints 1.2.11 for me
 [/code]

 -Ursprüngliche Nachricht-
 Von: Tobias Leich [mailto:em...@froggs.de] 
 Gesendet: Mittwoch, 30. November 2011 13:18
 An: Alexander Becker
 Cc: 'breno'; sdl-devel@perl.org
 Betreff: Re: How to play an mp3 file from a database

 Hi, can you please check what version of libSDL_mixer do you have installed?

 http://sdl.perl.org/SDL-Mixer.html#linked_version

 In case you have 1.2.7 or better we can add support for RWOps objects.
 So you dont need temp files.

 Cheers, FROGGS


 Am 29.11.2011 20:37, schrieb Alexander Becker:
 Hi breno,

 thank you for the quick response. It helped.
 I had a look into mixer_samples.t and line 106 states, that 
 quick_load_WAV is not (yet? Who do I have to bribe with what to get it?)
 implemented.
 Here is a working piece of code using temporary files. Of course, you 
 need a database containing audio files.

 Best regards,
 Alex

 [code]
 #!perl

 use strict;
 use warnings;
 use utf8;
 use DBI;
 use SQL::Abstract::Limit;
 use File::Temp;
 use SDL;
 use SDL::Audio;
 use SDL::Mixer;
 use SDL::Mixer::Samples;
 use SDL::Mixer::Channels;
 use SDL::Mixer::Music;
 SDL::init(SDL_INIT_AUDIO);
 SDL::Mixer::init( MIX_INIT_MP3 | MUS_MP3 );

 unless( SDL::Mixer::open_audio( 44100, AUDIO_S16SYS, 2, 4096 ) == 0 ) {
  Carp::croak Cannot open audio: .SDL::get_error(); }

 my $buffer = get_audio_buffer();

 # -- write audio buffer to temp file
 my $fh = File::Temp-new( UNLINK = 1, SUFFIX = '.mp3' ); 
 $fh-unlink_on_destroy( 1 ); print $fh $buffer; my $fname = 
 $fh-filename;

 # close the handle or the temfile will have some sort of lock on it 
 and cannot be read $fh-close();

 my $background_music = SDL::Mixer::Music::load_MUS( $fname );

 unless( $background_music ) {
  Carp::croak Cannot load music file [buffer from DB]:  .
 SDL::get_error();
 }

 SDL::Mixer::Music::play_music( $background_music,0 );

 sleep(6);

 SDL::Mixer::Music::halt_music();
 SDL::Mixer::close_audio;
 exit(0);



 sub get_audio_buffer {
 my $sql = SQL::Abstract::Limit-new( limit_dialect = 'LimitXY' 
 );;
 
 my $table = 'audio_files';
 my @fields = (qw/audio/);
 my %where = (
 id = 2,
 );
 my @order = ();
 my $limit = 1;
 my $offset = 0;
 my ( $stmt, @bind ) = $sql-select( $table, \@fields, \%where, 
 \@order, $limit, $offset );
 my $database = 'database_name';
 my $db_host = 'your_host';
 my $db_port = '3306';
 my $dsn = DBI:mysql:database=$database;host=$db_host;port=$db_port;
 my $username = 'username';
 my $password = 'password';
 my $dbh = DBI-connect($dsn, $username, $password) or die('Cannot 
 connect to DB: ' . DBI-errstr());
 my $sth = $dbh-prepare( $stmt );
 $sth-execute( @bind );
 
 my ($buffer) = $sth-fetchrow_array();
 
 return $buffer;
 } # /get_audio_buffer
 [/code]

 -Ursprüngliche Nachricht-
 Von: breno [mailto:oainikus...@gmail.com]
 Gesendet: Dienstag, 29. November 2011 06:34
 An: Alexander Becker
 Cc: sdl-devel@perl.org
 Betreff: Re: How to play an mp3 file from a database

 On Mon, Nov 28, 2011 at 8:13 PM, Alexander Becker   wrote:
 Dear all!

 Hi there!

 I just tried the example code of the SDL Manual where you play some
 music.
 By the SDL manual, I refer to the one that is hidden at the bottom of 
 the sdl.perl.org page, so that you really have to search for it in 
 order to find it - and even then you have to get along with an ugly 
 github
 interface.
 There's a new project website under way, but we're missing people to 
 work in it. Please join #sdl in irc.perl.org if you want to help us 
 get it right :)

 So, in general: Is there a way to play mp3 files?
 Yup.

 If your libsdl was compiled with mp3 support, all you have to do
 (iirc) is set the MIX_INIT_MP3 (for effects) and MUS_MP3 (for audio) 
 flags when you call SDL::Mixer::init():

   SDL::Mixer::init( MIX_INIT_MP3 | MUS_MP3 );

 then use load_MUS() and play_music() from SDL::Mixer::Music to play
 mp3 files as background music, or load_WAV() from SDL::Mixer::Samples 
 to play mp3 effects (yes, the function is named load_WAV() but plays 
 different formats too if they're available).

 The documentation in SDL::Mixer, SDL::Mixer::Music and 
 SDL::Mixer::Samples should be helpful, as some of the test files 
 (t/mixer_music.t comes to mind).

 And in particular: is there a way to play mp3 files that are in a
 variable?
 Or do I have to work with temporary files?

 Not sure. I *think* SDL::Mixer::quick_load_WAV( $buffer ) might do

Re: How to play an mp3 file from a database

2011-12-01 Thread Tobias Leich
Hi, this feature will be officially released, yes. But I can't tell if
this will be already within december.

Cheers.

Am 01.12.2011 22:29, schrieb Alexander Becker:

 Wohoo! That's really great! Here is my current (OMG: it's SDL + Tk)
 proof-of-concept-script.

 It plays a file via start and stop buttons. In case anyone has
 suggestions, please don't hesitate to drop me an email.

  

 [code]

 #!perl

  

 use strict;

 use warnings;

 use utf8;

 use Tk;

 use DBI;

 use SQL::Abstract::Limit;

 use SDL;

 use SDL::Audio;

 use SDL::Mixer;

 use SDL::Mixer::Samples;

 use SDL::Mixer::Channels;

 use SDL::Mixer::Music;

 use SDL::RWOps;

 SDL::init(SDL_INIT_AUDIO);

 SDL::Mixer::init( MIX_INIT_MP3 | MUS_MP3 );

  

 my $mw = tkinit();

  

 unless( SDL::Mixer::open_audio( 44100, AUDIO_S16SYS, 2, 4096 ) == 0 ) {

 Carp::croak Cannot open audio: .SDL::get_error();

 }

  

 $mw-Button(

 -text = 'play',

 -command = sub{

my $buffer = get_audio_buffer();

my $rwops = SDL::RWOps-new_const_mem(
 $buffer );

my $background_music =
 SDL::Mixer::Music::load_MUS_RW( $rwops );

   

unless( $background_music ) {

Carp::croak Cannot
 load music file [buffer from DB]:  . SDL::get_error();

}



SDL::Mixer::Music::play_music(
 $background_music, 20 );

 },

 )-pack();

  

 $mw-Button(

 -text = 'stop',

 -command = sub{

SDL::Mixer::Music::halt_music();

 },

 )-pack();

  

 $mw-MainLoop();

  

  

  

 sub get_audio_buffer {

 my $sql = SQL::Abstract::Limit-new( limit_dialect = 'LimitXY' );;



 my $table = 'words';

 my @fields = (qw/audio/);

 my %where = (

 id = 2,

 );

 my @order = ();

 my $limit = 1;

 my $offset = 0;

 my ( $stmt, @bind ) = $sql-select( $table, \@fields, \%where,
 \@order, $limit, $offset );

 my $database = 'test';

 my $db_host = '127.0.0.1';

 my $db_port = '3306';

 my $dsn = DBI:mysql:database=$database;host=$db_host;port=$db_port;

 my $username = 'test';

 my $password = 'test';

 my $dbh = DBI-connect($dsn, $username, $password) or die('Cannot
 connect to DB: ' . DBI-errstr());

 my $sth = $dbh-prepare( $stmt );

 $sth-execute( @bind );



 my ($buffer) = $sth-fetchrow_array();



 return $buffer;

 } # /get_audio_buffer

 [/code]

  

 Here is the output of perl Build.PL. There is an error for :
 execinfo.h, however, build, build test and build install runs fine.

  

 [snip]

 C:\zwischen\cpan\PerlGameDev-SDL-44c341fperl Build.PL

 *** !!!WARNING!!! 

 This Release breaks back compatibility support with versions 2.4x and
 below

 **

 Using 'My::Builder::Windows' class ...

 Detecting available libraries ...

 [Alien::SDL] Testing header(s): SDL.h

 [Alien::SDL] Testing header(s): SDL_mixer.h

 [Alien::SDL] Testing header(s): SDL_imageFilter.h

 [Alien::SDL] Testing header(s): SDL_image.h

 [Alien::SDL] Testing header(s): SDL_ttf.h

 [Alien::SDL] Testing header(s): SDL_framerate.h

 [Alien::SDL] Testing header(s): SDL_gfxBlitFunc.h

 [Alien::SDL] Testing header(s): SDL_gfxPrimitives.h

 [Alien::SDL] Testing header(s): SDL_rotozoom.h

 [Alien::SDL] Testing header(s): SDL_Pango.h

 Writing config_data ...

 Saving some info to 'notes' ...

 [Alien::SDL] Testing header(s): execinfo.h, signal.h NOK: (error:
 execinfo.h: No

 such file or directory)

 Can't find dist packages without a MANIFEST file

 Run 'Build manifest' to generate one

  

 WARNING: Possible missing or corrupt 'MANIFEST' file.

 Nothing to enter for 'provides' field in metafile.

 Created MYMETA.yml and MYMETA.json

 Creating new 'Build' script for 'SDL' version '2.535_01'

  

 C:\zwischen\cpan\PerlGameDev-SDL-44c341f

 [/snip]

  

 Will this be in an official release of SDL? Because this would be a
 really nice feature, that could be advertised, e.g. via blogs entries
 etc.. I could write a german one.

  

 Best regards  thanks a lot,

 Alex

  

 *Von:*Tobias Leich [mailto:em...@froggs.de]
 *Gesendet:* Donnerstag, 1. Dezember 2011 18:37
 *An:* Alexander Becker
 *Betreff:* Re: How to play an mp3 file from a database

  

 Hi Alex,

 You can checkout the c-sdl-rwops branch at github or download the
 zipfile if you are not experienced with git by using this link:

 https://github.com/PerlGameDev/SDL/zipball/c-sdl-rwops

 Usage:

  my $music = SDL::Mixer::Music::load_MUS_RW( $rwops );

 |load_MUS_RW| does the same like |load_MUS| except that it accepts an
 SDL::RWOps

Re: How to play an mp3 file from a database

2011-11-30 Thread Tobias Leich
Hi, can you please check what version of libSDL_mixer do you have installed?

http://sdl.perl.org/SDL-Mixer.html#linked_version

In case you have 1.2.7 or better we can add support for RWOps objects.
So you dont need temp files.

Cheers, FROGGS


Am 29.11.2011 20:37, schrieb Alexander Becker:
 Hi breno,

 thank you for the quick response. It helped.
 I had a look into mixer_samples.t and line 106 states, that quick_load_WAV
 is not (yet? Who do I have to bribe with what to get it?) implemented.

 Here is a working piece of code using temporary files. Of course, you need a
 database containing audio files. 

 Best regards,
 Alex

 [code]
 #!perl

 use strict;
 use warnings;
 use utf8;
 use DBI;
 use SQL::Abstract::Limit;
 use File::Temp;
 use SDL;
 use SDL::Audio;
 use SDL::Mixer;
 use SDL::Mixer::Samples;
 use SDL::Mixer::Channels;
 use SDL::Mixer::Music;
 SDL::init(SDL_INIT_AUDIO);
 SDL::Mixer::init( MIX_INIT_MP3 | MUS_MP3 );

 unless( SDL::Mixer::open_audio( 44100, AUDIO_S16SYS, 2, 4096 ) == 0 ) {
   Carp::croak Cannot open audio: .SDL::get_error(); 
 }

 my $buffer = get_audio_buffer();

 # -- write audio buffer to temp file
 my $fh = File::Temp-new( UNLINK = 1, SUFFIX = '.mp3' );
 $fh-unlink_on_destroy( 1 );
 print $fh $buffer;
 my $fname = $fh-filename;

 # close the handle or the temfile will have some sort of lock on it and
 cannot be read
 $fh-close();

 my $background_music = SDL::Mixer::Music::load_MUS( $fname );

 unless( $background_music ) {
   Carp::croak Cannot load music file [buffer from DB]:  .
 SDL::get_error();
 }

 SDL::Mixer::Music::play_music( $background_music,0 );

 sleep(6);

 SDL::Mixer::Music::halt_music();
 SDL::Mixer::close_audio;
 exit(0);



 sub get_audio_buffer {
 my $sql = SQL::Abstract::Limit-new( limit_dialect = 'LimitXY' );;
 
 my $table = 'audio_files';
 my @fields = (qw/audio/);
 my %where = (
 id = 2,
 );
 my @order = ();
 my $limit = 1;
 my $offset = 0;
 my ( $stmt, @bind ) = $sql-select( $table, \@fields, \%where, \@order,
 $limit, $offset );
 my $database = 'database_name';
 my $db_host = 'your_host';
 my $db_port = '3306';
 my $dsn = DBI:mysql:database=$database;host=$db_host;port=$db_port;
 my $username = 'username';
 my $password = 'password';
 my $dbh = DBI-connect($dsn, $username, $password) or die('Cannot
 connect to DB: ' . DBI-errstr());
 my $sth = $dbh-prepare( $stmt );
 $sth-execute( @bind );
 
 my ($buffer) = $sth-fetchrow_array();
 
 return $buffer;
 } # /get_audio_buffer
 [/code]

 -Ursprüngliche Nachricht-
 Von: breno [mailto:oainikus...@gmail.com] 
 Gesendet: Dienstag, 29. November 2011 06:34
 An: Alexander Becker
 Cc: sdl-devel@perl.org
 Betreff: Re: How to play an mp3 file from a database

 On Mon, Nov 28, 2011 at 8:13 PM, Alexander Becker   wrote:
 Dear all!

 Hi there!

 I just tried the example code of the SDL Manual where you play some music.
 By the SDL manual, I refer to the one that is hidden at the bottom of 
 the sdl.perl.org page, so that you really have to search for it in 
 order to find it - and even then you have to get along with an ugly github
 interface.
 There's a new project website under way, but we're missing people to work in
 it. Please join #sdl in irc.perl.org if you want to help us get it right :)

 So, in general: Is there a way to play mp3 files?
 Yup.

 If your libsdl was compiled with mp3 support, all you have to do
 (iirc) is set the MIX_INIT_MP3 (for effects) and MUS_MP3 (for audio) flags
 when you call SDL::Mixer::init():

   SDL::Mixer::init( MIX_INIT_MP3 | MUS_MP3 );

 then use load_MUS() and play_music() from SDL::Mixer::Music to play
 mp3 files as background music, or load_WAV() from SDL::Mixer::Samples to
 play mp3 effects (yes, the function is named load_WAV() but plays different
 formats too if they're available).

 The documentation in SDL::Mixer, SDL::Mixer::Music and SDL::Mixer::Samples
 should be helpful, as some of the test files (t/mixer_music.t comes to
 mind).

 And in particular: is there a way to play mp3 files that are in a
 variable?
 Or do I have to work with temporary files?

 Not sure. I *think* SDL::Mixer::quick_load_WAV( $buffer ) might do the right
 thing. You'll have to test it though.

 Cheers,

 breno
 -
 eMail ist virenfrei.
 Von AVG überprüft - www.avg.de
 Version: 10.0.1411 / Virendatenbank: 2092/4046 - Ausgabedatum: 29.11.2011 




AW: PerlGameDev Site MockUp with 2 games

2011-08-07 Thread Tobias Leich
Hi Justin,

What resolution do you use? What monitor size? The arrows are quite huge
imo...

Resizing the content div on browser resize shouldn’t be a problem. 
I want to do it this way because everything outside the content div stays on
its place.
And, the standard os scrollbars don’t look that good. At least they don’t
fit the color scheme.

Mousewheel scrolling will work later too. That’s one point on my todo.

Somebody has a crt monitor? I hope it is not too dark there.

I need an idea for the favicon btw.

Thanks so far!

Tobias

-Ursprüngliche Nachricht-
Von: Justin Hawkins [mailto:jus...@hawkins.id.au] 
Gesendet: Sonntag, 7. August 2011 07:01
An: Kartik Thakore
Cc: sdl-devel
Betreff: Re: PerlGameDev Site MockUp with 2 games


On 07/08/2011, at 5:32 AM, Kartik Thakore wrote:

 Hi, 
 
 Froggs has started work on a WIP of the PerlGameDev site. We need help
 with more design and back end work. But it looks great so far!
 
 http://gamoscope.com/work_in_progress.html

Those tiny arrows on the top and bottom right are a usability nightmare. The
browser has had the ability to provide a window on content that doesn't fit
the viewport since day one - don't try to reinvent that particular wheel. It
also doesn't resize when you resize the window. 

Otherwise I quite like the design and colour scheme :-)

- Justin

-- 
Justin Hawkins
jus...@hawkins.id.au








AW: SDL::Mixer::Channels

2011-07-21 Thread Tobias Leich
Take a look at this:

 http://sdl.perl.org/SDL-Mixer-Effects.html#set_panning
http://sdl.perl.org/SDL-Mixer-Effects.html#set_panning

 

You have to register a penning effect, on both channels.

 

This should work.

 

Cheers,

FROGGS

 

Von: Anjali Menon [mailto:anjalimeno...@gmail.com] 
Gesendet: Donnerstag, 21. Juli 2011 18:24
An: em...@froggs.de
Cc: sdl-devel@perl.org
Betreff: Re: SDL::Mixer::Channels

 

Hi,

Yes I want to play sound first on the left and then on the right channel. My
desktop is hooked to a USB sound card with Left and right Line-in and Line
out options and that is the sound card I am using to play the sounds. I
modified the program to incorporate what you said but it still does not
work.


use SDL;
use SDL::Mixer;
use SDL::Mixer::Channels;
use SDL::Mixer::Samples;
 
 
 
 SDL::init(SDL_INIT_AUDIO);
 SDL::Mixer::open_audio( 44100, AUDIO_U16SYS, 2, 4096 );
 SDL::Mixer::Channels::allocate_channels( 2 );
SDL::Mixer::Channels::volume(0,0);
SDL::Mixer::Channels::volume(1,90);
 my $chunk = SDL::Mixer::Samples::load_WAV('C:\1ksil1ch.wav');
 
 SDL::Mixer::Channels::play_channel( 0, $chunk, 0 );
 
 SDL::delay(1);
SDL::Mixer::Channels::halt_channel( 0 );
 
 
 SDL::Mixer::Channels::play_channel( 1, $chunk, 0 );
 SDL::delay(1);

 SDL::Mixer::close_audio();



I set the volume for both channels, left and right. I play the sound to the
left channel then i tried to halt the left channel and then played to the
right channel. What I saw was that the wav file played nothing to either
channel in the first case (when I said play to channel 0) and it played the
sound to both channels in the second case (when I said play to channel 1).
All the sounds I am playing are mono.

I guess I can understand the issue coz the data is going serially to the
sound card and so I thought (before I saw the SDL documentation) that the
only way to control the output on the channels would be to adjust the
channel balance in the master volume. I am not sure what the scheme is that
you guys are using to control this. Anyway, do let me know if there is
anything i can do or if there is something fundamentally wrong about the way
I understand this. thanks,

Anjali

On Thu, Jul 21, 2011 at 5:09 AM, em...@froggs.de wrote:

Hi,

Channels are not bound to left or right. A channel is just a slot that lets
you play sound samples. And if you allocate two channels, you have channel 0
and 1 (not 1 and 2), thats why you dont hear your last sample.

You want to play sounds first on left and then on right box for example?

Cheers, FROGGS

Zitat von Anjali Menon anjalimeno...@gmail.com:

Hi,

I got done with installing SDL and I wrote a simple program that opens the
audio device allocates both channels to the mixer, sets the volume of one of
the channels to be 0 , loads a wav file and then plays it twice one after
another with a delay in between. I have pasted the code below.

use SDL;
use SDL::Mixer;
use SDL::Mixer::Channels;
use SDL::Mixer::Samples;



 SDL::init(SDL_INIT_AUDIO);
 SDL::Mixer::open_audio( 44100, AUDIO_S16, 2, 4096 );
 SDL::Mixer::Channels::allocate_channels( 2 );
SDL::Mixer::Channels::volume(1,0);
 my $chunk = SDL::Mixer::Samples::load_WAV('C:\1ksil1ch.wav');

 SDL::Mixer::Channels::play_channel( 1, $chunk, 0 );

 SDL::delay(1);
SDL::Mixer::Channels::halt_channel( 1 );


 SDL::Mixer::Channels::play_channel( 2, $chunk, 0 );
 SDL::delay(1);

 SDL::Mixer::close_audio();


The questions I have are:
1) When you say channel, do you mean one set of Left and Right Channels.
This is because I saw then in this case, for the first condition of
play_channel (when it was supposed to play to channel 1), it played the wave
file in both the right and left channel and in the second case (when it was
supposed to play to channel 2) there was no sound on either channels. Is
there a way for me to access the left and right channel separately?

2)Also, I played another sound file which was just an instance of a person
saying the syllable ta and when i played that file using these settings,
the pitch of the sound changed. I noticed that when I increased the sampling
frequency from 44100 to 154100, was when the sound was the correct pitch.
How is this happening? Is it something I am doing?

I hope you can help,

Thanks

On Wed, Jul 20, 2011 at 2:08 PM, Anjali Menon
anjalimeno...@gmail.comwrote:

Thanks Kartik


On Wed, Jul 20, 2011 at 12:03 PM, Kartik Thakore thakore.kar...@gmail.com
 wrote:

To work with perl, I suggest you learn CPAN. It is how all this will
be installed for you.

cpan SDL

Should work.  If you have trouble just bug us at sdl-devel@perl.org .
Also when replying to these threads CC sdl-devel@perl.org

On Wed, Jul 20, 2011 at 11:35 AM, Anjali Menon anjalimeno...@gmail.com
wrote:
 At differing times yes but with an overlap. That was what most others
could
 not do. There is nothing in the docs for SDL::Mixer that say that it
cannot
 be done so I guess I'll just have to try it. Also, is there any way of
 installing 

AW: AW: AW: Perl OpenGL Project

2011-07-10 Thread Tobias Leich
Like these two tests:

$ ./Build test --test_files t/gfx.t --verbose
[Alien::SDL] Build option used:
Source code build: SDL-1.2.14  co. (RECOMMENDED)
builds: SDL, SDL_(image|mixer|ttf|gfx|Pango)
needs preinstalled: (freetype2|pango)-devel
Building SDL
Converting Pod to HTML with Pod::Html 1.09
t/gfx.t ..
ok 1 - [linked_version] isa SDL::Version
got version: 2.0.20
ok 2 - Are we still alive? Checking for segfaults
1..2
ok
All tests successful.
Files=1, Tests=2,  1 wallclock secs ( 0.00 usr  0.05 sys +  0.23 cusr  0.19 
csys =  0.46 CPU)
Result: PASS



$ ./Build test --test_files t/gfx_primitives.t --verbose
[Alien::SDL] Build option used:
Source code build: SDL-1.2.14  co. (RECOMMENDED)
builds: SDL, SDL_(image|mixer|ttf|gfx|Pango)
needs preinstalled: (freetype2|pango)-devel
Building SDL
Converting Pod to HTML with Pod::Html 1.09
t/gfx_primitives.t .. Can't load 
'/home/SDL/blib/arch/auto/SDL/GFX/Primitives/Primitives.dll' for module 
SDL::GFX::Primitives: No such file or directory at 
/usr/lib/perl5/5.10/i686-cygwin/DynaLoader.p
m line 200.
 at t/gfx_primitives.t line 12
Compilation failed in require at t/gfx_primitives.t line 12.
BEGIN failed--compilation aborted at t/gfx_primitives.t line 12.
Dubious, test returned 2 (wstat 512, 0x200)
No subtests run

Test Summary Report
---
t/gfx_primitives.t (Wstat: 512 Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: No plan found in TAP output
Files=1, Tests=0,  0 wallclock secs ( 0.03 usr  0.00 sys +  0.26 cusr  0.15 
csys =  0.45 CPU)
Result: FAIL
Failed 1/1 test programs. 0/0 subtests failed.


And this should be the answer:
$ ldd /home/SDL/blib/arch/auto/SDL/GFX/Primitives/Primitives.dll
ntdll.dll = /cygdrive/c/WINDOWS/system32/ntdll.dll (0x7c91)
kernel32.dll = /cygdrive/c/WINDOWS/system32/kernel32.dll (0x7c80)
??? = ??? (0x6340)
??? = ??? (0x77be)
??? = ??? (0x6100)
[...]

$ ldd /home/SDL/blib/arch/auto/SDL/GFX/GFX.dll
ntdll.dll = /cygdrive/c/WINDOWS/system32/ntdll.dll (0x7c91)
kernel32.dll = /cygdrive/c/WINDOWS/system32/kernel32.dll (0x7c80)
msvcrt.dll = /cygdrive/c/WINDOWS/system32/msvcrt.dll (0x77be)
cygwin1.dll = /usr/bin/cygwin1.dll (0x6100)
SDL.dll = /cygdrive/c/Programme/Qemu/SDL.dll (0x66e0)
[...]


-Ursprüngliche Nachricht-
Von: Kartik Thakore [mailto:thakore.kar...@gmail.com] 
Gesendet: Sonntag, 10. Juli 2011 20:19
An: Tobias Leich
Cc: 'Chris Marshall'; 'sdl-devel'; 'chromatic'; 'Dmitry Karasik'; 
per...@jach.hawaii.edu
Betreff: Re: AW: AW: Perl OpenGL Project

Can you paste them ?
On Sun, 2011-07-10 at 20:16 +0200, Tobias Leich wrote:
 I can build Alien::SDL, but too much tests are failing for SDL.
 
 -Ursprüngliche Nachricht-
 Von: Kartik Thakore [mailto:thakore.kar...@gmail.com] 
 Gesendet: Sonntag, 10. Juli 2011 09:03
 An: Tobias Leich
 Cc: 'Chris Marshall'; 'sdl-devel'; 'chromatic'; 'Dmitry Karasik'; 
 per...@jach.hawaii.edu
 Betreff: Re: AW: Perl OpenGL Project
 
 I believe it already works on cygwin no? 
 
 On Sat, 2011-07-09 at 15:48 +0200, Tobias Leich wrote:
  I can help getting Alien::SDL and SDL to work on cygwin. I will post an
  update in a few days.
  
  Cheers, 
  FROGGS
  
  -Ursprüngliche Nachricht-
  Von: Chris Marshall [mailto:devel.chm...@gmail.com] 
  Gesendet: Freitag, 8. Juli 2011 16:14
  An: Kartik Thakore
  Cc: sdl-devel; chromatic; Dmitry Karasik; per...@jach.hawaii.edu
  Betreff: Re: Perl OpenGL Project
  
  A quick SDL heads up:  the Prima::OpenGL strawman implementation
  is now working with POGL on cygwin using the native WGL OpenGL
  drivers.  For project goal #3 below, I'll be trying to get SDL installed
  on cygwin so that I can try using it with POGL for the OpenGL drawing.
  
  Anyone already using SDL + POGL on cygwin (with the Mesa+GLX
  rendering)?  Does SDL installation on cygwin use the X11+GLX
  framework or the win32+WGL one---as in any bumps I can expect
  ahead?
  
  Thanks much,
  Chris
  
  On Sun, Jul 3, 2011 at 4:44 PM, Kartik Thakore thakore.kar...@gmail.com
  wrote:
   Hi Chris,
  
   I am interested in helping out! Any bugs I can tackle I will take. I am
   also hoping to look at using some of the P5NCI optimizations chromatic
   was talking about but I will wait for a while and learn the code base so
   far.
  
   P.S. It would be appreciated if you CC'd the sdl-devel@perl.org list. We
   have several ppl on that list that are interested in this project
  
   Kartik
  
   On Sun, 2011-07-03 at 14:25 -0400, chm wrote:
   Announcing the new Perl OpenGL project site at
   sourceforge.net.  A read-only git access is at
  
  git://pogl.git.sourceforge.net/gitroot/pogl/pogl
  
   I plan on updating the plan going forward but
   the immediate goals are:
  
   (1) Continue work with Dmitry Karasik to resolve
win32 and cygwin build issues for his new

AW: Problem with SDL::Perl

2011-06-14 Thread Tobias Leich
Its not looking good imo.

See, its just installing libjpeg.la, not libjpeg.so.8 ...

-Ursprüngliche Nachricht-
Von: Kartik Thakore [mailto:thakore.kar...@gmail.com] 
Gesendet: Dienstag, 14. Juni 2011 22:19
An: Adam Fairbrother
Cc: beginn...@perl.org; sdl-devel
Betreff: Re: Problem with SDL::Perl

Hmm that is all fine. Can I see your LD_LIBRARY_PATH?

echo $LD_LIBRARY_PATH 

Are you still getting the problem btw cause the tests run fine. 

On Tue, 2011-06-14 at 09:47 -0700, Adam Fairbrother wrote:
 My bad, I guess I glossed by the sdl-devel@perl.org list when I was looking 
 through.
 
 Here is a link to a file that contains the stdout from fforce install 
 Alien::SDL SDL inside the cpan shell.  If it's not the information you were 
 looking for let me know and I can provide the correct info.
 
 http://dl.dropbox.com/u/949632/build.text
 
 #--
 Adam Fairbrother
 Help Desk Technician  
 afairbrot...@sd73.bc.ca  
 School District #73
 
 - Kartik Thakore thakore.kar...@gmail.com wrote:
 
   Hi,
  H Adam,
  
   It's been a week since I asked about this and No one has responded, 
  Did I ask incorrectly or in the wrong mailing list?
  
  Apologies for that I normally don't see this mailing list.
  sdl-devel@perl.org is a better list for these things.
   Any help that could be provided would be appreciated. 
  
  Absolutely, it seems that your Alien::SDL install had a bit of a
  hiccup. Can you paste your
  build text? 
  
  $ cpan 
= fforce install Alien::SDL SDL
  
  
   Thanks,
   
   #--
   Adam Fairbrother
   Help Desk Technician  
   afairbrot...@sd73.bc.ca   
   School District #73
  
   - Adam Fairbrother afairbrot...@sd73.bc.ca wrote:
  
Hi I'm having a bit of trouble getting a SDL::Perl running on a
  debian
Lenny setup.

I have SDL::Perl installed from CPAN.
Alien::SDL installed from cpan with the option to build all
dependencies and library's.
   
When I was testing to get things working, my short test script
  would
throw an error.  The script and the error are below.

I have libjpeg.so.8 built in the Alien SDL directory, but my guess
  is
that SDL isn't correctly configured to pick up that library
  folder.  I
don't want to mess up the system SDL install incase something
  goes
wrong, and I can't install libjpeg.so.8 from packages on Lenny,
  as
there is no package for it.
   
How do I have SDL recognize the library's provided by SDL::Alien,
  or
what am I doing wrong? 
   
Thanks,
   
   
Here is my script:
   
#!/usr/bin/perl 
use 5.010;
use strict;
use warnings;
use SDLx::App;
use SDLx::Sprite;
   
my $app = SDLx::App-new(height=1024,width=768);

my $sprite = SDLx::Sprite-new(image='pic.jpg');
$sprite-draw($app);
   
   Here is the Error
   
error loading image pic.jpg: Failed loading libjpeg.so.8:
libjpeg.so.8: cannot open shared object file: No such file or
directory at /usr/local/lib/perl/5.10.0/SDLx/Surface.pm line 188
   SDLx::Surface::load('SDLx::Surface', 'pic.jpg') called at
/usr/local/lib/perl/5.10.0/SDLx/Sprite.pm line 25
   SDLx::Sprite::new('SDLx::Sprite', 'image', 'pic.jpg')
  called
at ./slideshow.pl line 14

   
#--
Adam Fairbrother
Help Desk Technician  
afairbrot...@sd73.bc.ca   
School District #73
   
   -- 
   To unsubscribe, e-mail: beginners-unsubscr...@perl.org
   For additional commands, e-mail: beginners-h...@perl.org
   http://learn.perl.org/
  -- 
  Kartik Thakore thakore.kar...@gmail.com

-- 
Kartik Thakore thakore.kar...@gmail.com




WG: FAIL SDL-2.529_1 v5.10.1 GNU/Linux

2011-02-03 Thread Tobias Leich
Hi Chad,

looks like these everytime different errors are due to thread unsafty.

I hope we find out what went wrong... I guess we don’t need more information
from you.

Thanks, Tobias

-Ursprüngliche Nachricht-
Von: Chad Davis [mailto:chad.a.da...@gmail.com] 
Gesendet: Donnerstag, 3. Februar 2011 15:11
An: Tobias Leich
Betreff: Re: FAIL SDL-2.529_1 v5.10.1 GNU/Linux

Hi Tobias,

Thank you for following up.

I've been trying to track this down, but am having a really difficult
time isolating this.

First, Alien::SDL is a dependency, and that was already causing some
difficulty. I was not installing from within the CPAN shell, but would
test successfully from the bash shell. After I undefined PERL_MB_OPT
(which had been defined in my environment because I use local::lib, I
was able to install Alien::SDL from within the CPAN shell. Can't
decide if this was problem with CPAN.pm or with Module::Build or with
Alien::SDL.

The SDL errors also were different between the CPAN and the bash
shell. And the errors were different on different runs.

One run
mixer_channels.t
Can't coerce UNKNOWN to string in gvsv at
/usr/local/perl/Ubuntu-10.10-x86_64/lib/perl5/Test/Builder.pm line
2287.


Another run
mixer_channels.t :
All 34 subtests passed
(Seems to die after the 'expire_channel' test or on 'delay definedness
madness test \#13')


Another run
t/mixer.t ... ok
panic: restartop
# Tests were run but no plan was declared and done_testing() was not seen.
Unbalanced scopes: 12 more ENTERs than LEAVEs
Unbalanced saves: 121 more saves than restores
Unbalanced tmps: 3 more allocs than frees
Unbalanced context: 9 more PUSHes than POPs
Can't undef active subroutine during global destruction.
t/mixer_channels.t ..
All 31 subtests passed


Finally, I noticed that if the tests are interrupted, e.g. SIGINT,
then any subsequent runs of mixer_channels.t will generally also fail.
This error was repeatable (and even resulted in a 'double free or
corruption' in glibc). I was able to undo it finally by changing the
volume on my sound card, then the tests all passed again.


Most of these were on the 2.529_1 but the 2.530 seems more stable, but
I don't know what changed specifically. I can get the mixer_channel.t
in 2.530 to die after 'expire_channel' if I try to interrupt the tests
at just the right moment, but otherwise the 2.530 seems less likely to
fail, though I haven't tested it 100 times yet.


Are these errors useful for you? Can I give you some specific output?


Chad


On Wed, Feb 2, 2011 at 22:43, Tobias Leich em...@froggs.de wrote:
 Hi, we got your test report for SDL:


http://www.cpantesters.org/cpan/report/94899a96-2e50-11e0-bb60-39b910278d4b

 Thanks so far!



 The problem is that there is no helpful content within the report itself.
 May I ask you to send me a mail, with verbose out?



 I’d like to have the output of:   ./Build test --test_files
 t/mixer_channels.t –verbose



 Thanks in advance!



 Tobias



AW: patch for the configure-script for BSD-systems

2010-10-19 Thread Tobias Leich
Just to give ppl a simple way to use sdl.

Btw, it is only build on systems where it is missing.

-Ursprüngliche Nachricht-
Von: James Wright [mailto:monkey_ve...@cox.net] 
Gesendet: Dienstag, 19. Oktober 2010 21:22
An: sdl-devel@perl.org
Betreff: Re: patch for the configure-script for BSD-systems

  On 10/18/10 09:15, Leich Tobias wrote:

 Hi, on BSD systems like OpenBSD, NetBSD, FreeBSD and Dragonfly you 
 have to call 'ldconfig' with the option '-m'. Otherwise you overwrite 
 its configured directory search path.

Why are we building our own libz at all?



Today release of Alien::SDL, SDL and Games::FrozenBubble

2010-08-06 Thread Tobias Leich
Hi everyone,

 

Kartik has released the version below to CPAN. They will be available in a
few hours.

 

Latest changes to Alien::SDL:

* 1.413
   - Searching for libxxx.dll.a libs (cygwin needs this) [kmx]
   - New src build set: SDL-1.2.14  co. (builds only SDL+SDL_*) [kmx]
   - Using File::Fetch 0.24 [FROGGS]
   - Fixed path of libpng-1.4.1 (has changed due to release of libpng-1.5)
[FROGGS]
   - Added fixes for fink and get_path uses in Mac [kthakore]

 

Latest changes to SDL:

* 2.511

  - Added fixes for image and gfx uses in Surface [kthakore, garu]

  - Added raw, binary mode image detection to SDLx::Surafce [garu]

  - Minor doc fixes

  - Major segfaults in SDL::GFX::Primitives fixed [kthakore]

  - Issues with double free fixed for -DDEBUGGING tests [kthakore]

  - More delay add to test for syncing issues in VM test [FROGGS]

  - Used SDLx::Validate more [kthakore]

  - Applied patch for fink compatibiliet FULL_PERL [dmacks, kthakore]

  - 2 Character fix for set_gamma_ramp in  SDL::Video [kthakore]

  - Added register for windows [kthakore]

 

Latest changes to Games::FrozenBubble:

* 2.212 (2.2.1beta1)
  - Fixed VERSION/RELEASE_VERSION (kthakore) 
  - Added deps for IPC::System::Simple
  - Check SDL::Config for missing C deps

 



AW: Games::Frozenbubble is on CPAN

2010-05-06 Thread Tobias Leich
Hi guys,

@Guillaume: The effects copied the pixelvalue from one surface to another,
but you didn't take care of the pixelformat.

For example: 
If you load an png-image with SDL::Image::load() you can expcect to get a
32bit rgba surface. Pixelformat will be 0xRRGGBBAA.
But if you create a surface on your own by SDL::Surface-new( ..., 32bit,
...) you will get:
a) not an alpha channel unless you pass an alpha mask
b) not 0xRRGGBBAA on every platform
The visual effect before my changes was that the modified surfaces (the fb
logo) are red and half-transparent.

So my changes to the effect function was to use the SDL_GetRGBA() function
that takes care oft he pixel format.
(You can even now blit a 16bit RGB565 surface to an 32bit RGBA surface)

But you are right, these comments are not very helpful to understand what
was actually done.

Cheers, FROGGS

-Ursprüngliche Nachricht-
Von: Kartik Thakore [mailto:thakore.kar...@gmail.com] 
Gesendet: Donnerstag, 6. Mai 2010 19:01
An: Guillaume Cottenceau
Cc: em...@froggs.de; sdl-devel@perl.org
Betreff: Re: Games::Frozenbubble is on CPAN

Hi Guillaume,
Yeah I agree the commits comments suck. We will be more careful in the  
future. If you can't clone this I can tarball the git repo for you.

Kartik Thakore

On 2010-05-06, at 12:13 PM, Guillaume Cottenceau gcott...@gmail.com  
wrote:

 On Tue, Apr 13, 2010 at 3:28 PM, Kartik Thakore
 thakore.kar...@gmail.com wrote:

 Hi Guillaume,

 I did a git rebase between your master and our redesign branch to  
 make
 the new integration branch. And it has your commits

 http://github.com/kthakore/frozen-bubble/commits/integration?page=4

 I just tried to clone your repo but it failed twice, strangely:

 [...@meuh /tmp] git clone http://github.com/kthakore/frozen-bubble.git
 Initialized empty Git repository in /tmp/frozen-bubble/.git/
 got 33a6ea4f461dd2d8834f953ef6b3fc3aadaa7f91
 walk 33a6ea4f461dd2d8834f953ef6b3fc3aadaa7f91
 got 6769ff9f16dcdb43912582881bc71798293a5557
 got c7054d545e46fc52c2afce2acff40ac1926cc0cc
 got be1de28963fd5e1008f1657415bb2f387eabfc1b
 walk 6769ff9f16dcdb43912582881bc71798293a5557
 walk c7054d545e46fc52c2afce2acff40ac1926cc0cc
 got c46bc705ef70f9b7d38747fdc7bc1723485296e1
 Getting alternates list for http://github.com/kthakore/frozen-bubble.git
 got b251d7479f36064496bd889c4b35c6af2e5e5eeb
 got 4a59f6fca793762de9d276efde5c27a83c3e4efb
 got b8477303446f495e3c3c73d2fecc0f0ee0d59d7d
 got ab05f0c088aa9ac1101210754bf432dcd1a593ad
 got 634ce4e8154716125ac1a3dfe4fffe416764a7ba
 got 60481ee204bae1712fb9843b37cdb0f8b3b0ed0c
 Getting pack list for http://github.com/kthakore/frozen-bubble.git
 Getting index for pack 28008b5631a32fe2bd9e6b667da084204bfaecc7
 Getting pack 28008b5631a32fe2bd9e6b667da084204bfaecc7
 which contains 6a40d6eb282d34233f3fc1088f62dca29ad8254a
 error: Unable to get pack file

http://github.com/kthakore/frozen-bubble.git/objects/pack/pack-28008b5631a32
fe2bd9e6b667da084204bfaecc7.pack
 transfer closed with 49773388 bytes remaining to read
 error: Unable to find 6a40d6eb282d34233f3fc1088f62dca29ad8254a under
 http://github.com/kthakore/frozen-bubble.git
 Cannot obtain needed commit 6a40d6eb282d34233f3fc1088f62dca29ad8254a
 while processing commit c7054d545e46fc52c2afce2acff40ac1926cc0cc.
 fatal: Fetch failed.

 [...@meuh /tmp] git clone http://github.com/kthakore/frozen-bubble.git
 Initialized empty Git repository in /tmp/frozen-bubble/.git/
 got 33a6ea4f461dd2d8834f953ef6b3fc3aadaa7f91
 walk 33a6ea4f461dd2d8834f953ef6b3fc3aadaa7f91
 got 6769ff9f16dcdb43912582881bc71798293a5557
 walk 6769ff9f16dcdb43912582881bc71798293a5557
 got c7054d545e46fc52c2afce2acff40ac1926cc0cc
 got be1de28963fd5e1008f1657415bb2f387eabfc1b
 walk c7054d545e46fc52c2afce2acff40ac1926cc0cc
 got c46bc705ef70f9b7d38747fdc7bc1723485296e1
 Getting alternates list for http://github.com/kthakore/frozen-bubble.git
 got b251d7479f36064496bd889c4b35c6af2e5e5eeb
 got 4a59f6fca793762de9d276efde5c27a83c3e4efb
 got b8477303446f495e3c3c73d2fecc0f0ee0d59d7d
 got 634ce4e8154716125ac1a3dfe4fffe416764a7ba
 got ab05f0c088aa9ac1101210754bf432dcd1a593ad
 got 60481ee204bae1712fb9843b37cdb0f8b3b0ed0c
 Getting pack list for http://github.com/kthakore/frozen-bubble.git
 Getting index for pack 28008b5631a32fe2bd9e6b667da084204bfaecc7
 Getting pack 28008b5631a32fe2bd9e6b667da084204bfaecc7
 which contains 6a40d6eb282d34233f3fc1088f62dca29ad8254a
 error: Unable to get pack file

http://github.com/kthakore/frozen-bubble.git/objects/pack/pack-28008b5631a32
fe2bd9e6b667da084204bfaecc7.pack
 transfer closed with 49853388 bytes remaining to read
 error: Unable to find 6a40d6eb282d34233f3fc1088f62dca29ad8254a under
 http://github.com/kthakore/frozen-bubble.git
 Cannot obtain needed commit 6a40d6eb282d34233f3fc1088f62dca29ad8254a
 while processing commit c7054d545e46fc52c2afce2acff40ac1926cc0cc.
 fatal: Fetch failed.

 I'll try tomorrow again, maybe that's just github getting mad? For the
 record, I use git 1.6.4.4 on Linux.

 In the meantime I have had