Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDLX::EventDispatcher #65

Open
kthakore opened this issue Jul 26, 2011 · 4 comments
Open

SDLX::EventDispatcher #65

kthakore opened this issue Jul 26, 2011 · 4 comments
Assignees
Labels

Comments

@kthakore
Copy link
Member

Create an dispatcher which polls the Events.

If it finds a sub e.g. called on_key_down() or on_quit() it will call this function with the params...

So you can easily write something like this:

on_key_down
{
$key = shift;

print "heureka, we've got an 'a'!\n" if 'a' == $key;
}

@ghost ghost assigned kthakore Jul 26, 2011
@kthakore
Copy link
Member Author

Author: kthakore
Time: 1257953009
Field: difficulty
Value: Tough

@kthakore
Copy link
Member Author

Author: kthakore
Time: 1257953009
Field: version
Value: 3.5

@kthakore
Copy link
Member Author

Author: kthakore
Time: 1257953009
Field: comment
Value:

@kthakore
Copy link
Member Author

Author: Blaizer
Time: 1279890852
Field: comment
Value: I would like this. Good idea.

Here's an idea, Win32::GUI does it like this:

my $main = Win32::GUI::Window->new(
    -name => 'Main',
    -width => 200,
    -height => 200
);

sub Main_Terminate {
    return -1;
}

sub Main_Minimize {
    $main->Disable();
    $main->Hide();
    return 1;
}

It's neat, but probably not needed because SDL can't have multiple windows. Still, it would be good to have a quick look at how Win32::GUI does stuff, it's all pretty neat.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant