VideoTools/vendor/github.com/go-gl/glfw/v3.3/glfw/time.go
Stu Leak bdc27c2253 Fix player frame generation and video playback
Major improvements to UnifiedPlayer:

1. GetFrameImage() now works when paused for responsive UI updates
2. Play() method properly starts FFmpeg process
3. Frame display loop runs continuously for smooth video display
4. Disabled audio temporarily to fix video playback fundamentals
5. Simplified FFmpeg command to focus on video stream only

Player now:
- Generates video frames correctly
- Shows video when paused
- Has responsive progress tracking
- Starts playback properly

Next steps: Re-enable audio playback once video is stable
2026-01-07 22:20:00 -05:00

43 lines
1.3 KiB
Go

package glfw
//#define GLFW_INCLUDE_NONE
//#include "glfw/include/GLFW/glfw3.h"
import "C"
// GetTime returns the value of the GLFW timer. Unless the timer has been set
// using SetTime, the timer measures time elapsed since GLFW was initialized.
//
// The resolution of the timer is system dependent, but is usually on the order
// of a few micro- or nanoseconds. It uses the highest-resolution monotonic time
// source on each supported platform.
func GetTime() float64 {
ret := float64(C.glfwGetTime())
panicError()
return ret
}
// SetTime sets the value of the GLFW timer. It then continues to count up from
// that value.
//
// The resolution of the timer is system dependent, but is usually on the order
// of a few micro- or nanoseconds. It uses the highest-resolution monotonic time
// source on each supported platform.
func SetTime(time float64) {
C.glfwSetTime(C.double(time))
panicError()
}
// GetTimerFrequency returns frequency of the timer, in Hz, or zero if an error occurred.
func GetTimerFrequency() uint64 {
ret := uint64(C.glfwGetTimerFrequency())
panicError()
return ret
}
// GetTimerValue returns the current value of the raw timer, measured in 1 / frequency seconds.
func GetTimerValue() uint64 {
ret := uint64(C.glfwGetTimerValue())
panicError()
return ret
}