Fixed issues with fullscreen. Replaced it with borderless window
This commit is contained in:
parent
4990a0c1bc
commit
4f0b5dace4
BIN
Ragnarokkr
BIN
Ragnarokkr
Binary file not shown.
25
main.odin
25
main.odin
|
@ -3,9 +3,12 @@ package main
|
||||||
import rl "vendor:raylib"
|
import rl "vendor:raylib"
|
||||||
import "core:path/filepath"
|
import "core:path/filepath"
|
||||||
import "core:strings"
|
import "core:strings"
|
||||||
|
import "core:fmt"
|
||||||
|
|
||||||
vec3 :: [3]f32
|
vec3 :: [3]f32
|
||||||
|
vec3i :: [3]i32
|
||||||
vec2 :: [2]f32
|
vec2 :: [2]f32
|
||||||
|
vec2i :: [2]i32
|
||||||
vec3right := vec3{1, 0, 0}
|
vec3right := vec3{1, 0, 0}
|
||||||
vec3left := vec3{-1, 0, 0}
|
vec3left := vec3{-1, 0, 0}
|
||||||
vec3up := vec3{0, 1, 0}
|
vec3up := vec3{0, 1, 0}
|
||||||
|
@ -17,6 +20,8 @@ vec3backward := vec3{0, 0, -1}
|
||||||
WSize := [2]f32{}
|
WSize := [2]f32{}
|
||||||
WSizei := [2]i32{}
|
WSizei := [2]i32{}
|
||||||
|
|
||||||
|
WSizeLast := vec2i{}
|
||||||
|
|
||||||
WindowShouldExit := false
|
WindowShouldExit := false
|
||||||
|
|
||||||
NeedTutorial := true
|
NeedTutorial := true
|
||||||
|
@ -131,14 +136,13 @@ load_resources :: proc() {
|
||||||
Res.Music.Second = load_music("alexander-nakarada-the-northern-path.mp3", 0.7)
|
Res.Music.Second = load_music("alexander-nakarada-the-northern-path.mp3", 0.7)
|
||||||
}
|
}
|
||||||
|
|
||||||
Fullscreen := true
|
|
||||||
|
|
||||||
main :: proc() {
|
main :: proc() {
|
||||||
rl.SetConfigFlags(rl.ConfigFlags{.MSAA_4X_HINT, .FULLSCREEN_MODE, .VSYNC_HINT, .WINDOW_RESIZABLE})
|
// rl.SetConfigFlags(rl.ConfigFlags{.MSAA_4X_HINT, .FULLSCREEN_MODE, .VSYNC_HINT, .WINDOW_RESIZABLE})
|
||||||
|
rl.SetConfigFlags(rl.ConfigFlags{.VSYNC_HINT, .WINDOW_RESIZABLE})
|
||||||
|
|
||||||
rl.InitWindow(0, 0, "Ragnarøkkr")
|
rl.InitWindow(800, 600, "Ragnarøkkr")
|
||||||
rl.InitAudioDevice()
|
rl.InitAudioDevice()
|
||||||
rl.SetWindowMinSize(800, 480)
|
rl.SetWindowMinSize(800, 600)
|
||||||
|
|
||||||
rl.HideCursor()
|
rl.HideCursor()
|
||||||
Cursor = rl.LoadTexture("./assets/gfx/crosshair.png")
|
Cursor = rl.LoadTexture("./assets/gfx/crosshair.png")
|
||||||
|
@ -176,3 +180,14 @@ main :: proc() {
|
||||||
rl.EndDrawing()
|
rl.EndDrawing()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Fullscreen := false
|
||||||
|
|
||||||
|
toggle_fullscreen :: proc() {
|
||||||
|
monitor := rl.GetCurrentMonitor()
|
||||||
|
rl.ToggleBorderlessWindowed()
|
||||||
|
Fullscreen = !Fullscreen
|
||||||
|
|
||||||
|
|
||||||
|
// rl.ToggleFullscreen()
|
||||||
|
}
|
||||||
|
|
|
@ -75,8 +75,8 @@ menu_button_pressed :: proc(state: ^GameState, el: Menu_Buttons) {
|
||||||
KeyboardOnly = !KeyboardOnly
|
KeyboardOnly = !KeyboardOnly
|
||||||
NeedTutorial = true
|
NeedTutorial = true
|
||||||
case .FULLSCREEN:
|
case .FULLSCREEN:
|
||||||
rl.ToggleFullscreen()
|
toggle_fullscreen()
|
||||||
Fullscreen = rl.IsWindowFullscreen()
|
// Fullscreen = rl.IsWindowFullscreen()
|
||||||
|
|
||||||
case .EXIT:
|
case .EXIT:
|
||||||
WindowShouldExit = true
|
WindowShouldExit = true
|
||||||
|
|
Loading…
Reference in New Issue