Struct kiss3d::window::Window [] [src]

pub struct Window { /* fields omitted */ }

Structure representing a window and a 3D scene.

This is the main interface with the 3d engine.

Methods

impl Window
[src]

Indicates whether this window should be closed.

Access the glfw context.

Access the glfw window.

Mutably access the glfw window.

The window width.

The window height.

The size of the window.

Sets the maximum number of frames per second. Cannot be 0. None means there is no limit.

Set window title

Closes the window.

Hides the window, without closing it. Use show to make it visible again.

Makes the window visible. Use hide to hide it.

Sets the background color.

Adds a line to be drawn during the next frame.

Adds a point to be drawn during the next frame.

Adds a string to be drawn during the next frame.

Removes an object from the scene.

Adds a group to the scene.

A group is a node not containing any object.

Adds an obj model to the scene.

Arguments

  • path - relative path to the obj file.
  • scale - scale to apply to the model.

Adds an unnamed mesh to the scene.

Creates and adds a new object using the geometry generated by a given procedural generator. Creates and adds a new object using a mesh descriptor.

Creates and adds a new object using the geometry registered as geometry_name.

Adds a cube to the scene. The cube is initially axis-aligned and centered at (0, 0, 0).

Arguments

  • wx - the cube extent along the z axis
  • wy - the cube extent along the y axis
  • wz - the cube extent along the z axis

Adds a sphere to the scene. The sphere is initially centered at (0, 0, 0).

Arguments

  • r - the sphere radius

Adds a cone to the scene. The cone is initially centered at (0, 0, 0) and points toward the positive y axis.

Arguments

  • h - the cone height
  • r - the cone base radius

Adds a cylinder to the scene. The cylinder is initially centered at (0, 0, 0) and has its principal axis aligned with the y axis.

Arguments

  • h - the cylinder height
  • r - the cylinder base radius

Adds a capsule to the scene. The capsule is initially centered at (0, 0, 0) and has its principal axis aligned with the y axis.

Arguments

  • h - the capsule height
  • r - the capsule caps radius

Adds a double-sided quad to the scene. The quad is initially centered at (0, 0, 0). The quad itself is composed of a user-defined number of triangles regularly spaced on a grid. This is the main way to draw height maps.

Arguments

  • w - the quad width.
  • h - the quad height.
  • wsubdivs - number of horizontal subdivisions. This correspond to the number of squares which will be placed horizontally on each line. Must not be 0.
  • hsubdivs - number of vertical subdivisions. This correspond to the number of squares which will be placed vertically on each line. Must not be 0. update.

Adds a double-sided quad with the specified vertices.

Returns whether this window is closed or not.

Sets the light mode. Only one light is supported.

Opens a window, hide it then calls a user-defined procedure.

Arguments

  • title - the window title

Opens a window then calls a user-defined procedure.

Arguments

  • title - the window title

Opens a window with a custom size then calls a user-defined procedure.

Arguments

  • title - the window title.
  • width - the window width.
  • height - the window height.

Reference to the scene associated with this window.

Mutable reference to the scene associated with this window.

Read the pixels currently displayed to the screen.

Arguments:

  • out - the output buffer. It is automatically resized.

Read a section of pixels from the screen

Arguments:

  • out - the output buffer. It is automatically resized
  • x, y, width, height - the rectangle to capture

Get the current screen as an image

Gets the events manager that gives access to an event iterator.

Renders the scene using the default camera.

Returns false if the window should be closed.

Render using a specific post processing effect.

Returns false if the window should be closed.

Render using a specific camera.

Returns false if the window should be closed.

Render using a specific camera and post processing effect.

Returns false if the window should be closed.

Draws the scene with the given camera and post-processing effect.

Returns false if the window should be closed.