in reply to Setting Video Mode in SDL

SDL::Video can be diffficult to install and use. Here's a list of dependencies and a Makefile.PL that I used to install SDL. The documentation's SYNOPSIS gives a working example of usage. Here it is:
#!/usr/bin/perl use strict; use warnings; use SDL; use SDL::Video; use SDL::Surface; use SDL::Rect; my $screen_width = 800; my $screen_height = 600; SDL::init(SDL_INIT_VIDEO); my $screen_surface = SDL::Video::set_video_mode( $screen_width, $screen_height, 32, SDL_ANYFORMAT); my $mapped_color = SDL::Video::map_RGB( $screen_surface->format(), 0, 0, 255); SDL::Video::fill_rect($screen_surface, SDL::Rect->new( $screen_width / 4, $screen_height / 4, $screen_width / 2, $screen_height / 2), $mapped_color); SDL::Video::update_rect( $screen_surface, 0, 0, $screen_width, $screen_height); sleep(5); SDL::quit();

Replies are listed 'Best First'.
Re^2: Setting Video Mode in SDL
by SomeNetworkGuy (Sexton) on Nov 09, 2010 at 19:05 UTC

    I think I may be making progress. That example you gave is what I was using. After running your CPAN install script (woowee that is a lot of stuff) I had an issue running your Build.PL script.

    Gonna use 'My::Builder::Unix' class ... Require 'My::Builder::Unix' failed: Can't locate My/Builder/Unix.pm in + @INC

    Assuming I should've used the My/Builder/* files in the Alien::SDL package, I copied them over, but got another error

    Can't locate object method "find_subsystems" via package "My::Builder: +:Unix" at Build.PL line 526.

    Where and what version is the My::Builder::Unix class in your Build script coming from?

    Using the Build.PL that comes with SDL Perl, the Build test gives these results.
    root@sw:~/sdl/SDL_Perl-v2.2.6# ./Build test t/apppm.t .......... ok t/cdrompm.t ........ ok t/colorpm.t ........ ok t/cursorpm.t ....... ok t/eventpm.t ........ ok t/fontpm.t ......... ok t/manifest.t ....... skipped: Author tests not required for installati +on t/mixerpm.t ........ ok t/mpegpm.t ......... skipped: smpeg support not compiled t/musicpm.t ........ ok t/opengl.t ......... ok t/palettepm.t ...... ok t/rectpm.t ......... ok t/sdlgamerect.t .... ok t/sdlpm.t .......... ok t/soundpm.t ........ ok t/surfaceML.t ...... skipped: Author tests not required for installati +on t/surfacepm.t ...... ok t/timerpm.t ........ ok t/toolfontpm.t ..... ok t/toolgraphicpm.t .. skipped: SDL_gfx support not compiled t/ttfontpm.t ....... ok t/videopm.t ........ skipped: smpeg support not compiled All tests successful. Files=23, Tests=184, 2 wallclock secs ( 0.12 usr 0.25 sys + 1.03 cu +sr 0.50 csys = 1.90 CPU) Result: PASS

    The t/videopm.t being skipped seems like something to be concerned about. I thought I saw smpeg being installed as a dependency in that CPAN script?

    Currently, when I run the SDL test script, I get this.

    Use of inherited AUTOLOAD for non-method SDL::init() is deprecated at +./test.pl line 14. Can't locate auto/SDL/init.al in @INC

    I changed that part of the code to SDL->init() and got this  Can't locate auto/SDL/init.al in @INC Is it safe to assume that that init() sub should get installed when t/videopm.t isn't 'skipped'?