lights FAQ Forum github.com/luapower/winapi.wglpanel
This package
winapi.wglpanel

Native OS APIs
winapi
winapi.wglpanel
winapi.cairopanel
objc
xlib

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

Package:winapi.wglpanel
Pkg type:Lua+ffi
Version: 42fac3c
Last commit:
Author: Cosmin Apreutesei
License: Public Domain
Requires: +opengl  +winapi  +events  +glue  +luajit 
Required by: opengl 

Top