Permalink
Browse files

Added SDL2::Video

  • Loading branch information...
1 parent 4a02eda commit 7996cf3a15e25c8976e0dc98e7e36c0479442bfc @kthakore kthakore committed Mar 8, 2013
Showing with 82 additions and 0 deletions.
  1. +5 −0 Build.PL
  2. +19 −0 lib/SDL2/Video.pm
  3. +29 −0 src/Core/Video.xs
  4. +1 −0 t/001_load_all.t
  5. +14 −0 t/100_sdlpp.t
  6. +14 −0 t/103_sdl2_video.t
View
@@ -12,6 +12,11 @@ my %mods = (
xs => [ 'src/SDL2pp.xs' => 'lib/SDL2pp.xs'],
libs => [qw( SDL2 )],
},
+ 'SDL2::Video' => {
+ xs => [ 'src/Core/Video.xs' => 'lib/SDL2/Video.xs'],
+ libs => [qw( SDL2 )],
+ },
+
'SDL2::Window' => {
xs => [ 'src/Core/objects/Window.xs' => 'lib/SDL2/Window.xs' ],
libs => [qw( SDL2 )],
View
@@ -0,0 +1,19 @@
+package SDL2::Video;
+use strict;
+use warnings;
+use vars qw(@ISA @EXPORT @EXPORT_OK);
+require Exporter;
+require DynaLoader;
+our @ISA = qw(Exporter DynaLoader);
+
+use SDL2::Internal::Loader;
+if (check_and_load(__PACKAGE__)) {
+ bootstrap SDL2::Video;
+}
+else {
+ warn "WARNING: " . __PACKAGE__ . " is not available\n";
+}
+
+use base 'Exporter';
+
+1;
View
@@ -0,0 +1,29 @@
+#include "EXTERN.h"
+#include "perl.h"
+#include "XSUB.h"
+#include "ppport.h"
+
+#include <stdio.h>
+
+#ifndef aTHX_
+#define aTHX_
+#endif
+
+#include <SDL2/SDL.h>
+
+
+
+MODULE = SDL2::Video PACKAGE = SDL2::Video PREFIX = video_
+
+const char *
+get_current_video_driver ( )
+ CODE:
+ RETVAL = SDL_GetCurrentVideoDriver();
+ OUTPUT:
+ RETVAL
+
+
+
+
+
+
View
@@ -14,6 +14,7 @@ use SDL2pp;
use SDL2::Window;
use SDL2::Renderer;
use SDL2::Rect;
+use SDL2::Video;
#add more
ok 1, 'All modules loaded successfully';
View
@@ -13,6 +13,20 @@ use SDL2pp;
pass('Loaded');
+can_ok('SDL2pp', qw/
+ init
+ init_sub_system
+ delay
+ quit_sub_system
+ quit
+ was_init
+ clear_hints
+ get_hint
+ set_hint
+ set_hint_with_priority
+ get_error
+/);
+
done_testing;
View
@@ -0,0 +1,14 @@
+use strict;
+use warnings;
+use Test::More;
+use SDL2::ConfigData;
+
+BEGIN {
+ plan skip_all => 'SDL2::Video not available' unless SDL2::ConfigData->config('mod2lib')->{'SDL2::Video'};
+}
+
+use SDL2::Video;
+
+can_ok('SDL2::Video', qw/get_current_video_driver/);
+
+done_testing();

0 comments on commit 7996cf3

Please sign in to comment.