SDL-Tutorial-3DWorld

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

	  greater quality of objects you tend to be able to find for obj files.

0.19 Mon 20 Dec 2010
	- Added a "God Mode" flying camera which uses the left shift key
	  as an exponential speed accelerator, and make it the default.
	- Added ->current static method to ::3DWorld to get currently
	  world. Removes the need to pass things like the camera around
	  everywhere all the time.
	- The skybox now locates the camera via ->current->camera instead
	  having to be passed the camera.
	- Added a console for overlaying the world with diagnostic text.
	- Set min_t to zero to push frames per second as high as possible.
	- Correcting some broken versions

0.18 Sun 19 Dec 2010
	- Moving the landscape to a typical 2000-era infinite ground plane,
	  but with a more detailed texture than in that era.
	  Unfortunately, the new ground plane means our skybox looks wrong
	  now, as it was never designed for use with a ground plane.
	- Reorganised some internals so we don't need to export from OpenGL
	  so much. This will be removed later, once OpenGL fixes it constants.

lib/SDL/Tutorial/3DWorld.pm  view on Meta::CPAN

	# Normally we want fullscreen, but occasionally we might want to
	# disable it because we are on a portrait-orientation monitor
	# or for unobtrusive testing (or it doesn't work on some machine).
	# When showing in a window, drop the size to the window isn't huge.
	$self->{fullscreen} = not grep { $_ eq '--window' } @_;
	unless ( $self->{fullscreen} ) {
		$self->{width}  /= 2;
		$self->{height} /= 2;
	}

	# Text console that overlays the world
	$self->{console} = SDL::Tutorial::3DWorld::Console->new;

	# A pretty skybox background for our world
	$self->{skybox} = SDL::Tutorial::3DWorld::Skybox->new(
		type      => 'jpg',
		directory => $self->sharedir('skybox'),
	);

	# Light the world with a single overhead light
	# that matches the position of the sun.

lib/SDL/Tutorial/3DWorld/Console.pm  view on Meta::CPAN

package SDL::Tutorial::3DWorld::Console;

=pod

=head1 NAME

SDL::Tutorial::3DWorld::Console - A text-mode overlay for the world

=head1 SYNOPSIS

  $world->{console} = SDL::Tutorial::3DWorld::Console->new;

=head1 DESCRIPTION

A C<Console> is a text-mode diagnostic overlay for the world.

It is most commonly used for the display of values like frames per second
count, status, and other diagnostic information. It is not particularly
useful for proper "Heads Up Display" style overlays as the drawing is done
entirely with the glutBitmapCharacter() function.

However it does provide quite a simple and easy way to push general
information to the screen in private or scientific applications, or to
display debugging information in games and such.

This demonstration implementation generates one line of text containing
the frames-per-second cound and displays it at the bottom of the screen.

The main L<SDL::Tutorial::3DWorld> render loop considers the console to



( run in 1.138 second using v1.01-cache-2.11-cpan-49f99fa48dc )