AntTweakBar

 view release on metacpan or  search on metacpan

lib/AntTweakBar.pm  view on Meta::CPAN

  $bar->set_bar_params(
    size        => '350 700,
    valueswidth => '200'
    visible     => 'false',
  );

Updates bar definition at runtime. See
L<http://anttweakbar.sourceforge.net/doc/tools:anttweakbar:twbarparamsyntax>.

=cut

sub set_bar_params {
    my ($self, %params) = @_;
    while (my ($k, $v) = each(%params)) {
        _set_bar_parameter($self->{_bar_ptr}, $k, $v);
    }
}

=head2 set_variable_params($var_name, $var_definition)

  $bar->set_variable_params('ObjRotation', readonly => 'true');

Updates variable definition at runtime. See
L<http://anttweakbar.sourceforge.net/doc/tools:anttweakbar:varparamsyntax#parameters>

=cut

sub set_variable_params {
    my ($self, $variable, %params) = @_;
    while (my ($k, $v) = each(%params)) {
        _set_variable_parameter($self->{_bar_ptr}, $variable, $k, $v);
    }
}


=head1 INITIALIZATION AND DRAW FUNCTIONS


=head2 init

  AntTweakBar::init(TW_OPENGL);

Initializes AntTweakBar

=head2 terminate

  AntTweakBar::terminate

Uninitializes AntTweakBar

=head2 window_size

  AntTweakBar::window_size(640, 480);

Tell AntTweakBar the actual size of your window

=head2 draw

  AntTweakBar::draw;

Draw AntTweakBar just before the frame buffer is presented (swapped).



=head1 OPENGL EVENT FUNCTIONS


=head2 eventMouseButtonGLUT

  glutMouseFunc(\&AntTweakBar::eventMouseButtonGLUT);

Let AntTweakBar handles mouse button clicks

=head2 eventMouseMotionGLUT

  glutMotionFunc(\&AntTweakBar::eventMouseMotionGLUT);
  glutPassiveMotionFunc(\&AntTweakBar::eventMouseMotionGLUT);

Let AntTweakBar handles mouse movements with pressed button(s)
and passive mouse movements

=head2 eventKeyboardGLUT

  glutKeyboardFunc(\&AntTweakBar::eventKeyboardGLUT);

Let AntTweakBar handles key presses

=head2 eventSpecialGLUT

  glutSpecialFunc(\&AntTweakBar::eventSpecialGLUT);

=head2 GLUTModifiersFunc

  AntTweakBar::GLUTModifiersFunc(\&glutGetModifiers);

=head1 SDL EVENT FUNCTION

=head2 eventSDL

If you use SDL than it is more simple to let AntTweakBar process
all input-related events via single call:

  AntTweakBar::eventSDL($sdl_event);


=head1 SEE ALSO


L<Alien::AntTweakBar>, L<SDL>, L<OpenGL>, L<http://anttweakbar.sourceforge.net/>


=head1 AUTHOR

Ivan Baidakou E<lt>dmol@(gmx.com)E<gt>

=head1 CREDITS

=over 2

David Horner



( run in 0.684 second using v1.01-cache-2.11-cpan-df04353d9ac )