.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Module::Build::SDL 3pm" .TH Module::Build::SDL 3pm 2024-03-28 "perl v5.38.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Module::Build::SDL \- Module::Build subclass for building SDL apps/games [not stable yet] .SH SYNOPSIS .IX Header "SYNOPSIS" When creating a new SDL application/game you can create Build.PL like this: .PP .Vb 1 \& use Module::Build::SDL; \& \& my $builder = Module::Build::SDL\->new( \& module_name => \*(AqGames::Demo\*(Aq, \& dist_version => \*(Aq1.00\*(Aq, \& dist_abstract => \*(AqDemo game based on Module::Build::SDL\*(Aq, \& dist_author => \*(Aqcoder@cpan.org\*(Aq, \& license => \*(Aqperl\*(Aq, \& requires => { \& \*(AqSDL\*(Aq => 0, \& }, \& #+ others Module::Build options \& )\->create_build_script(); .Ve .PP Once you have created a SDL application/game via Module::Build::SDL as described above you can use some extra build targets/actions: .IP \(bu 4 you can create a PAR distribution like: .Sp .Vb 3 \& $ perl ./Build.PL \& $ ./Build \& $ ./Build par .Ve .Sp There are some extra parameters related to 'par' action you can pass to Module::Build::SDL\->\fBnew()\fR: .Sp .Vb 4 \& parinput => \*(Aqbin/scriptname.pl\*(Aq \& paroutput => \*(Aqfilename.par.exe\*(Aq, \& parlibs => [ qw/SDL SDL_main SDL_gfx/ ], #external libraries (.so/.dll) to be included into PAR \& parmods => [ qw/Module::A Module::B/ ], #extra modules to be included into PAR .Ve .IP \(bu 4 to run the game from distribution directory you can use: .Sp .Vb 3 \& $ perl ./Build.PL \& $ ./Build \& $ ./Build run .Ve .IP \(bu 4 TODO: maybe some additional actions: parexe, parmsi, deb, rpm .SH DESCRIPTION .IX Header "DESCRIPTION" Module::Build::SDL is a subclass of Module::Build created to make easy some tasks specific to SDL applications \- e.g. packaging SDL application/game into PAR archive. .SH "APPLICATION/GAME LAYOUT" .IX Header "APPLICATION/GAME LAYOUT" Module::Build::SDL expects the following layout in project directory: .PP .Vb 9 \& #example: game with the main *.pl script + data files + modules (*.pm) \& Build.PL \& lib/ \& Games/ \& Demo.pm \& bin/ \& game\-script.pl \& data/ \& whatever_data_files_you_need.jpg .Ve .PP the most simple game should look like: .PP .Vb 4 \& #example: simple one\-script apllication/game \& Build.PL \& bin/ \& game\-script.pl .Ve .PP In short \- there are 3 expected subdirectories: .IP \(bu 4 \&\fBbin\fR \- one or more perl scripts (*.pl) to start the actual application/game .IP \(bu 4 \&\fBlib\fR \- application/game specific modules (*.pm) organized in dir structure in "usual perl manners" .IP \(bu 4 \&\fBdata\fR \- directory for storing application data (pictures, sounds etc.). This subdirectory is handled as a "ShareDir" (see File::ShareDir for more details) .IP \(bu 4 As the project is (or could be) composed as a standard perl distribution it also support standard subdirectory \fB't'\fR (with tests). .SH "RULES TO FOLLOW" .IX Header "RULES TO FOLLOW" When creating a SDL application/game based on Module::Build::SDL it is recommended to follow these rules: .IP \(bu 4 Use the name for your game from \fIGames::*\fR namespace; it will make the later release to CPAN much easier. .IP \(bu 4 Put all data files into \fBdata\fR subdirectory and access the \fBdata\fR subdir only via File::ShareDir (namely by calling \fBdistdir()\fR function) .IP \(bu 4 TODO: maybe add more