Example #1
0
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()

}
Example #2
0
File: glfw.go Project: andrebq/glfw
// Init initializes GLFW. No other GLFW functions may be called before this
// function has succeeded.
func Init() (err error) {
	if C.glfwInit() != 1 {
		err = errors.New("Failed to initialize GLFW")
	}
	return
}
Example #3
0
//Init initializes the GLFW library. Before most GLFW functions can be used,
//GLFW must be initialized, and before a program terminates GLFW should be
//terminated in order to free any resources allocated during or after
//initialization.
//
//If this function fails, it calls Terminate before returning. If it succeeds,
//you should call Terminate before the program exits.
//
//Additional calls to this function after successful initialization but before
//termination will succeed but will do nothing.
//
//This function may take several seconds to complete on some systems, while on
//other systems it may take only a fraction of a second to complete.
//
//On Mac OS X, this function will change the current directory of the
//application to the Contents/Resources subdirectory of the application's
//bundle, if present.
//
//This function may only be called from the main thread. See
//https://code.google.com/p/go-wiki/wiki/LockOSThread
func Init() bool {
	return glfwbool(C.glfwInit())
}
Example #4
0
// This function must be called from the main thread (i.e. from either init() or main()).
func Init() error {
	if C.glfwInit() == C.GL_FALSE {
		return errors.New("Failed to initialize GLFW.")
	}
	return nil
}
Example #5
0
func Init() (err os.Error) {
	if C.glfwInit() != 1 {
		err = os.NewError("Failed to initialize GLFW")
	}
	return
}
Example #6
0
File: glfw.go Project: godispy/glfw
// Init initializes the GLFW library. Before most GLFW functions can be used,
// GLFW must be initialized, and before a program terminates GLFW should be
// terminated in order to free any resources allocated during or after
// initialization.
//
// If this function fails, it calls Terminate before returning. If it succeeds,
// you should call Terminate before the program exits.
//
// Additional calls to this function after successful initialization but before
// termination will succeed but will do nothing.
//
// This function may take several seconds to complete on some systems, while on
// other systems it may take only a fraction of a second to complete.
//
// On Mac OS X, this function will change the current directory of the
// application to the Contents/Resources subdirectory of the application's
// bundle, if present.
//
// This function may only be called from the main thread.
func Init() error {
	C.glfwInit()
	return acceptError(APIUnavailable)
}
Example #7
0
func Init() int {
	return int(C.glfwInit())
}