wgl

package
v0.26.5 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2026 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package wgl provides Windows OpenGL (WGL) context management.

This package handles the Windows-specific parts of OpenGL initialization:

  • Loading opengl32.dll, gdi32.dll, user32.dll
  • WGL context creation and management
  • Pixel format selection
  • Buffer swapping

Usage

if err := wgl.Init(); err != nil {
    return err
}
ctx, err := wgl.NewContext(hwnd)
if err != nil {
    return err
}
defer ctx.Destroy(hwnd)
ctx.MakeCurrent()

Function Loading

Use GetGLProcAddress to load OpenGL functions:

glCtx := &gl.Context{}
glCtx.Load(wgl.GetGLProcAddress)

Jump to

Keyboard shortcuts

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