Example #1
0
func DisplayModes() []DisplayMode {
	var n int

	n = int(C.al_get_num_display_modes())

	modes := make([]DisplayMode, n)
	for i := 0; i < n; i++ {
		var mode C.ALLEGRO_DISPLAY_MODE

		C.al_get_display_mode(C.int(i), &mode)

		modes[i] = DisplayMode{
			int(mode.width), int(mode.height),
			int(mode.format), int(mode.refresh_rate)}
	}
	return modes
}
Example #2
0
// Returns the index'th display mode. Pass in a DisplayMode struct to store the display
// mode info in.
func (self *DisplayMode) Get(index int) *DisplayMode {
	return (*DisplayMode)(C.al_get_display_mode(C.int(index), self.toC()))
}
Example #3
0
func GetDisplayMode(index int32) *DisplayMode {
	var d C.ALLEGRO_DISPLAY_MODE
	r := C.al_get_display_mode(C.int(index), &d)
	return (*DisplayMode)(unsafe.Pointer(r))
}