lights FAQ Forum github.com/luapower/winapi

Native OS APIs
winapi
objc
syscall
xlib
shm

wglpanel

OpenGL panels


require'winapi.wglpanel'

This module implements the WGLPanel class which allows drawing on a panel using OpenGL.

WGLPanel

Hierarchy

Events

painting description reference
on_render() panel needs repainting WM_PAINT
on_set_viewport() window was resized

Usage

local winapi = require'winapi'
require'winapi.wglpanel'

local main = winapi.Window{
  autoquit = true,
}

local panel = winapi.WGLPanel{
  anchors = {left = true, top = true, right = true, bottom = true},
  w = main.client_w,
  h = main.client_h,
  parent = main,
}

local gl = require'winapi.gl21'

function panel:on_render()
  gl.glMatrixMode(gl.GL_MODELVIEW)
  gl.glLoadIdentity()
  --render model...
end

Last updated: 22 months ago | Edit on GitHub

Pkg type:Lua+ffi
Version: r3-8-g8ecae71
Last commit:
License: PD
Requires: cairo  glue  luajit  opengl  sg  eq  path2d  pp 
Required by: cairo  cplayer  nw  opengl  sg 

Top