func Init(width int, height int) { eventCore = new(_GLFWEventCore) eventCore.Listeners = new(list.List) C.glfwInit() C.glfwOpenWindow(_Ctype_int(width), _Ctype_int(height), 8, 8, 8, 8, 8, 8, C.GLFW_WINDOW) C.SetupCallbacks() }
// OpenWindow opens a window that best matches the parameters given to the // function. 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 of // buffers and channel sizes 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. // // Note: For additional control of window properties, see glfw.OpenWindowHint. // // 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, width will be set to 640. // // height: The height of the window. If height is zero, it will be calculated // as height = 4/3 width, if width is not zero. If both width and // height are zero, height will be set to 480. // // r, g, b: The number of bits to use for each color component of the color // buffer (0 means default color depth). For instance, setting // r=5, g=6 and b=5 will create a 16-bit color buffer, if possible. // // a: The number of bits to use for the alpha channel of the color // buffer (0 means no alpha channel). // // depth: The number of bits to use for the depth buffer (0 means no depth buffer). // // stencil: 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 must be either // glfw.Windowed, which will generate a normal desktop window, or // glfw.Fullscreen, which will generate a window that 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. func OpenWindow(width, height, r, g, b, a, depth, stencil, mode int) (err error) { if C.glfwOpenWindow( C.int(width), C.int(height), C.int(r), C.int(g), C.int(b), C.int(a), C.int(depth), C.int(stencil), C.int(mode), ) != 1 { err = errors.New("Failed to open window") } return }
func OpenWindow(width int, height int, redbits int, greenbits int, bluebits int, alphabits int, depthbits int, stencilbits int, mode int) int { return int(C.glfwOpenWindow(C.int(width), C.int(height), C.int(redbits), C.int(greenbits), C.int(bluebits), C.int(alphabits), C.int(depthbits), C.int(stencilbits), C.int(mode))) }