Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor SDL to unbreak BubbleBreaker
- Loading branch information
Showing
10 changed files
with
312 additions
and
400 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
|
||
unit module SDL::App; | ||
|
||
use NativeCall; | ||
use SDL::Controller; | ||
use SDL::Surface; | ||
use SDL::Surfacish; | ||
|
||
class SDL::App is SDL::Surface { | ||
also is SDL::Controller; | ||
method new( $w, $h, $bpp, $flags ) { | ||
self.bless( file => Str, rw => Pointer, pointer => _set_video_mode( $w, $h, $bpp, $flags ) ); | ||
} | ||
} | ||
class SDL::App is SDL::Controller does SDL::Surfacish { | ||
method new( $w, $h, $bpp, $flags ) { | ||
self.bless: surface => SDL::Surface::_set_video_mode( $w, $h, $bpp, $flags ) | ||
} | ||
|
||
our sub _set_video_mode( int32 $w, int32 $h, int32 $bpp, int32 $flags ) returns SDL::Surface is native('libSDL') is symbol('SDL_SetVideoMode') { * } | ||
method FALLBACK($name, |c) { | ||
$!surface."$name"(|c) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
|
||
class SDL::PixelFormat is repr('CStruct'); | ||
unit class SDL::PixelFormat is repr('CStruct'); | ||
|
||
use SDL::Palette; | ||
|
||
|
Oops, something went wrong.