Tao.Glfw SDK Documentation

Glfw.glfwOpenWindow Method 

Opens a window that best matches the parameters given to the function.

[Visual Basic]
Public Shared Function glfwOpenWindow( _
   ByVal width As Integer, _
   ByVal height As Integer, _
   ByVal redBits As Integer, _
   ByVal greenBits As Integer, _
   ByVal blueBits As Integer, _
   ByVal alphaBits As Integer, _
   ByVal depthBits As Integer, _
   ByVal stencilBits As Integer, _
   ByVal mode As Integer _
) As Integer
[C#]
public static int glfwOpenWindow(
   int width,
   int height,
   int redBits,
   int greenBits,
   int blueBits,
   int alphaBits,
   int depthBits,
   int stencilBits,
   int mode
);

Parameters

width
The width of the window. If width is zero, it will be calculated as width = (4 / 3) * height, if height is not zero. If both width and height are zero, then width will be set to 640.
height
The height of the window. If height is zero, it will be calculated as height = (3 / 4) * width, if width is not zero. If both width and height are zero, then height will be set to 480.
redBits
The number of bits to use for the red color component of the color buffer (0 means default color depth). For instance, setting redbits = 5, greenbits = 6, and bluebits = 5 will generate a 16-bit color buffer, if possible.
greenBits
The number of bits to use for the green color component of the color buffer (0 means default color depth). For instance, setting redbits = 5, greenbits = 6, and bluebits = 5 will generate a 16-bit color buffer, if possible.
blueBits
The number of bits to use for the blue color component of the color buffer (0 means default color depth). For instance, setting redbits = 5, greenbits = 6, and bluebits = 5 will generate a 16-bit color buffer, if possible.
alphaBits
The number of bits to use for the alpha buffer (0 means no alpha buffer).
depthBits
The number of bits to use for the depth buffer (0 means no depth buffer).
stencilBits
The number of bits to use for the stencil buffer (0 means no stencil buffer).
mode
Selects which type of OpenGL window to use. mode can be either GLFW_WINDOW, which will generate a normal desktop window, or GLFW_FULLSCREEN, which will generate a window which covers the entire screen. When GLFW_FULLSCREEN is selected, the video mode will be changed to the resolution that closest matches the width and height parameters.

Return Value

On success GL_TRUE is returned; otherwise GL_FALSE.

Remarks

How well the resulting window matches the desired window depends mostly on the available hardware and OpenGL drivers. In general, selecting a fullscreen mode has better chances of generating a close match than does a normal desktop window, since GLFW can freely select from all the available video modes. A desktop window is normally restricted to the video mode of the desktop.

For additional control of window properties, see glfwOpenWindowHint.

In fullscreen mode the mouse cursor is hidden by default, and any system screensavers are prohibited from starting. In windowed mode the mouse cursor is visible, and screensavers are allowed to start. To change the visibility of the mouse cursor, use glfwEnable or glfwDisable with the argument GLFW_MOUSE_CURSOR.

In order to determine the actual properties of an opened window, use glfwGetWindowParam and glfwGetWindowSize (or glfwSetWindowSizeCallback).

See Also

Glfw Class | Tao.Glfw Namespace