d2d.window.window



class Window: d2d.core.iverifiable.IVerifiable, d2d.core.idisposable.IDisposable, d2d.rendering.irendertarget.IRenderTarget;
Single-Window class wrapping SDL_Window.

Examples:
Window window = new Window(800, 600, "Unittest");

assert(window.valid);

assert(window.title == "Unittest");
window.title = "Window Title";
assert(window.title == "Window Title");
// Automatic conversion from c-strings to D-strings

assert(window.width == 800);

window.close();
assert(!window.valid);


static SDL_GLContext glContext;
Static variable to a SDL GL Context.

this(string title = "D2DGame", uint flags = WindowFlags.Default);
Creates a new centered window with specified title and flags on a 800x480 resolution.

this(int width, int height, string title = "D2DGame", uint flags = WindowFlags.Default);
Creates a new centered window with specified dimensions, title and flags.

this(int x, int y, int width, int height, string title, uint flags = WindowFlags.Default);
Creates a new window with specified parameters.

bool pollEvent(ref WindowEvent event);
Polls a event from the stack and returns
true
if one was found.

void quit();
Pushes
WindowEvent.Quit
to the event stack.

@property Texture texture();
Texture containing rendered content.

void display(ShaderProgram post = null);
Displays rendered content to the window.

@property void title(string title);
Dynamically sets the title of the window.

@property string title();
Dynamically gets the title of the window.

@property void width(int width);
Dynamically sets the width of the window.

@property int width();
Dynamically gets the width of the window.

@property void height(int height);
Dynamically sets the height of the window.

@property int height();
Dynamically gets the height of the window.

@property void maxWidth(int maxWidth);
Dynamically sets the maximum width of the window.

@property int maxWidth();
Dynamically gets the maximum width of the window.

@property void maxHeight(int maxHeight);
Dynamically sets the maximum height of the window.

@property int maxHeight();
Dynamically gets the maximum height of the window.

@property void minWidth(int minWidth);
Dynamically sets the minimum width of the window.

@property int minWidth();
Dynamically gets the minimum width of the window.

@property void minHeight(int minHeight);
Dynamically sets the minimum height of the window.

@property int minHeight();
Dynamically gets the minimum height of the window.

@property void x(int x);
Dynamically sets the x position of the window.

@property int x();
Dynamically gets the x position of the window.

@property void y(int y);
Dynamically sets the y position of the window.

@property int y();
Dynamically gets the y position of the window.

void show();
Shows the window if hidden.

void hide();
Hides the window.

void minimize();
Minimizes the window.

void maximize();
Maximizes the window.

void restore();
Restores the window state from minimized or maximized.

void focus();
Raises the window to top and focuses it for input.

void setIcon(Bitmap icon);
Sets the icon to a Btimap.

void dispose();
Closes the window and invalidates it.

See Also:
Window.close

void close();
Closes the window and invalidates it.

See Also:
Window.dispose

@property bool open();
Returns if the is still open.

See Also:
Window.valid

@property bool valid();
Returns if the window is still open.

See Also:
Window.open


Page generated by Ddoc.