/
fullscreen.go
40 lines (31 loc) · 888 Bytes
/
fullscreen.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package allegro
// #include <allegro5/allegro.h>
import "C"
import "unsafe"
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))
}
func GetNumDisplayModes() int32 {
return int32(C.al_get_num_display_modes())
}
/***********************/
/* DisplayMode getters */
/***********************/
func (d *DisplayMode) Width() int32{
dc := (*C.ALLEGRO_DISPLAY_MODE)(unsafe.Pointer(d))
return int32(dc.width)
}
func (d *DisplayMode) Height() int32{
dc := (*C.ALLEGRO_DISPLAY_MODE)(unsafe.Pointer(d))
return int32(dc.height)
}
func (d *DisplayMode) Format() int32{
dc := (*C.ALLEGRO_DISPLAY_MODE)(unsafe.Pointer(d))
return int32(dc.format)
}
func (d *DisplayMode) RefreshRate() int32{
dc := (*C.ALLEGRO_DISPLAY_MODE)(unsafe.Pointer(d))
return int32(dc.refresh_rate)
}