Example #1
0
r_fov controls the field of view of the camera. Measured
in degrees.
`)
	lastFOV               int = 90
	lastWidth, lastHeight int = -1, -1
	perspectiveMatrix         = mgl32.Mat4{}
	cameraMatrix              = mgl32.Mat4{}
	frustum                   = vmath.NewFrustum()

	syncChan = make(chan func(), 500)

	glTexture       gl.Texture
	textureDepth    int
	texturesCreated bool

	debugFramebuffers = console.NewBoolVar("r_debug_buffers", false, console.Mutable).Doc(`
r_debug_buffers blits all frame buffers to the screen for
debugging.
`)

	LightLevel, SkyOffset float32 = 0.8, 1.0
	ClearColour                   = struct{ R, G, B float32 }{
		122.0 / 255.0, 165.0 / 255.0, 247.0 / 255.0,
	}
)

// Start starts the renderer
func Start() {
	if os.Getenv("STEVEN_DEBUG") == "true" {
		gl.DebugLog()
	}
Example #2
0
r_fov controls the field of view of the camera. Measured
in degrees.
`)
	lastFOV               int = 90
	lastWidth, lastHeight int = -1, -1
	perspectiveMatrix         = mgl32.Mat4{}
	cameraMatrix              = mgl32.Mat4{}
	frustum                   = vmath.NewFrustum()

	syncChan = make(chan func(), 500)

	glTexture       gl.Texture
	textureDepth    int
	texturesCreated bool

	debugFramebuffers = console.NewBoolVar("r_debug_buffers", false, console.Mutable).Doc(`
r_debug_buffers blits all frame buffers to the screen for
debugging.
`)

	LightLevel, SkyOffset float32 = 0.8, 1.0
	ClearColour                   = struct{ R, G, B float32 }{
		122.0 / 255.0, 165.0 / 255.0, 247.0 / 255.0,
	}

	slidyChunks = console.NewBoolVar("r_slidy_chunks", false, console.Mutable, console.Serializable).Doc(`
r_slidy_chunks makes chunks slide into view instead of just
popping in.
`)
)
Example #3
0
	"github.com/go-gl/glfw/v3.1/glfw"
	"github.com/thinkofdeath/steven/console"
	"github.com/thinkofdeath/steven/protocol"
	"github.com/thinkofdeath/steven/render/gl"
	"github.com/thinkofdeath/steven/ui"
)

var window *glfw.Window

func init() {
	runtime.LockOSThread()
}

var (
	renderVSync = console.NewBoolVar("r_vsync", true, console.Mutable, console.Serializable).
			Doc(`
r_vsync controls whether vsync is enabled. VSync tries to
keep the refreshing of the game in sync with the monitor's
refresh rate.
`)
	mouseSensitivity = console.NewIntVar("cl_mouse_speed", 8000, console.Mutable, console.Serializable).
				Doc(`
cl_mouse_speed controls how fast you rotate when moving 
the mouse. Higher values means faster rotation.
`)
)

func init() {
	renderVSync.Callback(func() {
		if glfw.GetCurrentContext() == nil {