NAME

SDL2::Window - SDL Window Structure, Corresponding to Toplevel Windows

SYNOPSIS

use SDL2 qw[:all];
SDL_Init(SDL_INIT_VIDEO);    # Initialize SDL2

# Create an application window with the following settings;
my $window = SDL_CreateWindow(
    'An SDL2 window',           # window title
    SDL_WINDOWPOS_UNDEFINED,    # initial x position
    SDL_WINDOWPOS_UNDEFINED,    # initial y position
    640,                        # width, in pixels
    480,                        # height, in pixels
    SDL_WINDOW_OPENGL           # flags
);

# Check that the window was successfully created
exit printf 'Could not create window: %s', SDL_GetError() if !defined $window;

# The window is open: could enter program loop here (see SDL__PollEvent())
sleep 5;                       # Pause execution for 5 secconds, for example
SDL_DestroyWindow($window);    # Close and destory the window
SDL_Quit();                    # Clean up
exit;

DESCRIPTION

SDL2::Window defines a structure SDL uses to represent a window.

Fields

Every field defined is considered private. Use related functions defined in SDL2::video instead of aiming to modify this object in place.

LICENSE

Copyright (C) Sanko Robinson.

This library is free software; you can redistribute it and/or modify it under the terms found in the Artistic License 2. Other copyrights, terms, and conditions may apply to data transmitted through this module.

AUTHOR

Sanko Robinson <sanko@cpan.org>