},
libraries => [qw( SDL SDL_ttf )],
},
+ Version => {
+ file => {
+ from => 'src/Core/objects/Version.xs',
+ to => 'lib/SDL/Version.xs',
+ },
+ libraries => [qw( SDL )],
+ },
OpenGL => {
file => {
from => 'src/OpenGL.xs',
--- /dev/null
+package SDL::Version;
+use strict;
+use warnings;
+require Exporter;
+require DynaLoader;
+our @ISA = qw(Exporter DynaLoader);
+bootstrap SDL::Version;
+
+1;
--- /dev/null
+#include "EXTERN.h"
+#include "perl.h"
+#include "XSUB.h"
+
+#ifndef aTHX_
+#define aTHX_
+#endif
+
+#include <SDL.h>
+#include <SDL_version.h>
+
+MODULE = SDL::Version PACKAGE = SDL::Version PREFIX = version_
+
+=for documentation
+
+SDL_Version -- Version structure
+
+ typedef struct SDL_version {
+ Uint8 major;
+ Uint8 minor;
+ Uint8 patch;
+ } SDL_version;
+
+=cut
+
+Uint8
+version_major ( version, ... )
+ SDL_version *version
+ CODE:
+ RETVAL = version->major;
+ OUTPUT:
+ RETVAL
+
+Uint8
+version_minor ( version, ... )
+ SDL_version *version
+ CODE:
+ RETVAL = version->minor;
+ OUTPUT:
+ RETVAL
+
+Uint8
+version_patch ( version, ... )
+ SDL_version *version
+ CODE:
+ RETVAL = version->patch;
+ OUTPUT:
+ RETVAL
+
OUTPUT:
RETVAL
+SDL_version *
+version ()
+ PREINIT:
+ char * CLASS = "SDL::Version";
+ SDL_version *version;
+ CODE:
+ version = (SDL_version *) safemalloc (sizeof(SDL_version));
+ SDL_VERSION(version);
+ RETVAL = version;
+ OUTPUT:
+ RETVAL
+
+SDL_version *
+linked_version ()
+ PREINIT:
+ char * CLASS = "SDL::Version";
+ CODE:
+ RETVAL = (SDL_version *) SDL_Linked_Version();
+ OUTPUT:
+ RETVAL
+
void
delay ( ms )
int ms
unload_fuction
unload_object
envvars
- linked_version
- version
- Version
/;
my $why = '[Percentage Completion] '.int( 100 * $#done / ($#done + $#left) ) ."\% implementation. $#done / ".($#done+$#left);
--- /dev/null
+#!/usr/bin/perl -w
+use strict;
+use SDL;
+use SDL::Version;
+use Test::More tests => 8;
+
+my $version = SDL::version();
+isa_ok( $version, 'SDL::Version' );
+like( $version->major, qr/^\d+$/, 'Compile-time version major is a number' );
+like( $version->minor, qr/^\d+$/, 'Compile-time version minor is a number' );
+like( $version->patch, qr/^\d+$/, 'Compile-time version patch is a number' );
+
+my $linked_version = SDL::linked_version();
+isa_ok( $linked_version, 'SDL::Version' );
+like( $linked_version->major, qr/^\d+$/,
+ 'Link-time version major is a number' );
+like( $linked_version->minor, qr/^\d+$/,
+ 'Link-time version minor is a number' );
+like( $linked_version->patch, qr/^\d+$/,
+ 'Link-time version patch is a number' );
SDL_Palette * O_OBJECT
SDL_PixelFormat * O_OBJECT
SDL_VideoInfo * O_OBJECT
+SDL_version * O_OBJECT
SDL_Cursor * T_PTR
SDL_AudioSpec * T_PTR
SDL_AudioCVT * T_PTR