win32ogl

package module
v0.0.0-...-dbc2649 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 7, 2022 License: BSL-1.0 Imports: 5 Imported by: 0

README

win32ogl

Go Reference Go Report Card

About

win32ogl provides funtions for OpenGL applications for windows. It is published on https://github.com/vbsw/win32ogl.

Copyright 2022, Vitali Baumtrok (vbsw@mailbox.org).

win32ogl is distributed under the Boost Software License, version 1.0. (See accompanying file LICENSE or copy at http://www.boost.org/LICENSE_1_0.txt)

win32ogl is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Boost Software License for more details.

References

Documentation

Overview

Package win32ogl provides funtions for OpenGL applications for windows.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Instance

func Instance() (unsafe.Pointer, error)

Instance returns HINSTANCE. HINSTANCE is the instance handle of this executable.

Types

type Context

type Context struct {
	Dc unsafe.Pointer
	Rc unsafe.Pointer
}

Context is the OpenGL context.

func (*Context) MakeCurrent

func (ctx *Context) MakeCurrent() error

MakeCurrent makes OpenGL context current.

func (*Context) Release

func (ctx *Context) Release() error

Release makes OpenGL context no longer current. If any other context is current, it stays current.

func (*Context) SwapBuffers

func (ctx *Context) SwapBuffers() error

SwapBuffers swaps the front and back buffers.

type DummyWindow

type DummyWindow struct {
	Context Context
	// contains filtered or unexported fields
}

DummyWindow is a window with OpenGL 1.1 context.

func (*DummyWindow) Destroy

func (dummy *DummyWindow) Destroy() error

Destroy releases all resources associated with dummy window.

func (*DummyWindow) Init

func (dummy *DummyWindow) Init(instance unsafe.Pointer) error

Init initializes dummy window and its OpenGL context. Parameter instance is the instance handle of this executable.

type MainLoop

type MainLoop struct {
	// contains filtered or unexported fields
}

MainLoop processes window events.

func (*MainLoop) AddUpdatable

func (loop *MainLoop) AddUpdatable(upd Updatable) int

AddUpdatable adds an Updatable to main loop. Updatable is called, when event queue has no events.

func (*MainLoop) ProcessEvents

func (loop *MainLoop) ProcessEvents()

ProcessEvents processes events and blocks until

func (*MainLoop) RemoveAllUpdatable

func (loop *MainLoop) RemoveAllUpdatable()

RemoveAllUpdatable removes all Updatable.

func (*MainLoop) RemoveUpdatable

func (loop *MainLoop) RemoveUpdatable(id int)

RemoveUpdatable makes Updatable no more identified by id.

type OpenGL

type OpenGL struct {
	Funcs *C.win32ogl_opengl_t
	// contains filtered or unexported fields
}

OpenGL holds OpenGL functions.

func (*OpenGL) LoadFunctions

func (opengl *OpenGL) LoadFunctions() error

LoadFunctions loads OpenGL functions. An OpenGL context must have been set current before.

type Updatable

type Updatable interface {
	Update()
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL