Esempio n. 1
0
// Enable or disable vertical synchronization
// Activating vertical synchronization will limit the number
// of frames displayed to the refresh rate of the monitor.
// This can avoid some visual artifacts, and limit the framerate
// to a good value (but not constant across different computers).
// \param window  Window object
// \param enabled sfTrue to enable v-sync, sfFalse to deactivate
// void sfWindow_setVerticalSyncEnabled(sfWindow* window, sfBool enabled);
func (self Window) SetVerticalSyncEnabled(enabled bool) {
	if enabled {
		C.sfWindow_setVerticalSyncEnabled(self.Cref, C.sfBool(1))
	} else {
		C.sfWindow_setVerticalSyncEnabled(self.Cref, C.sfBool(0))
	}
}
Esempio n. 2
0
// Enable or disable automatic key-repeat
// If key repeat is enabled, you will receive repeated
// KeyPress events while keeping a key pressed. If it is disabled,
// you will only get a single event when the key is pressed.
// Key repeat is enabled by default.
// \param window  Window object
// \param enabled sfTrue to enable, sfFalse to disable
// void sfWindow_setKeyRepeatEnabled(sfWindow* window, sfBool enabled);
func (self Window) SetKeyRepeatEnabled(enabled bool) {
	if enabled {
		C.sfWindow_setKeyRepeatEnabled(self.Cref, C.sfBool(1))
	} else {
		C.sfWindow_setKeyRepeatEnabled(self.Cref, C.sfBool(0))
	}
}
Esempio n. 3
0
// Show or hide the mouse cursor
// \param window  Window object
// \param visible sfTrue to show, sfFalse to hide
// void sfWindow_setMouseCursorVisible(sfWindow* window, sfBool visible);
func (self Window) SetMouseCursorVisible(visible bool) {
	if visible {
		C.sfWindow_setMouseCursorVisible(self.Cref, C.sfBool(1))
	} else {
		C.sfWindow_setMouseCursorVisible(self.Cref, C.sfBool(0))
	}
}
Esempio n. 4
0
File: audio.go Progetto: num5/steven
func (s Sound) SetRelative(rel bool) {
	if rel {
		C.sfSound_setRelativeToListener(s.internal, C.sfBool(1))
	} else {
		C.sfSound_setRelativeToListener(s.internal, C.sfBool(0))
	}
}
Esempio n. 5
0
//  Activate or deactivate explicitely a context
//
// \param context Context object
// \param active  sfTrue to activate, sfFalse to deactivate
// void sfContext_setActive(sfContext* context, sfBool active);
func (self Context) SetActive(active bool) {
	if active {
		C.sfContext_setActive(self.Cref, C.sfBool(1))
	} else {
		C.sfContext_setActive(self.Cref, C.sfBool(0))
	}
}
Esempio n. 6
0
// Activate or deactivate a window as the current target
//        for OpenGL rendering
// A window is active only on the current thread, if you want to
// make it active on another thread you have to deactivate it
// on the previous thread first if it was active.
// Only one window can be active on a thread at a time, thus
// the window previously active (if any) automatically gets deactivated.
// \param window Window object
// \param active sfTrue to activate, sfFalse to deactivate
// \return sfTrue if operation was successful, sfFalse otherwise
// sfBool sfWindow_setActive(sfWindow* window, sfBool active);
func (self Window) SetActive(active bool) bool {
	if active {
		return C.sfWindow_setActive(self.Cref, C.sfBool(1)) == 1
	}
	return C.sfWindow_setActive(self.Cref, C.sfBool(0)) == 1
}
Esempio n. 7
0
func Bool(b bool) C.sfBool {
	if b {
		return C.sfBool(1)
	}
	return C.sfBool(0)
}
Esempio n. 8
0
func GoBool2SfBool(goVal bool) C.sfBool {
	if goVal {
		return C.sfBool(1)
	}
	return C.sfBool(0)
}