Skip to content

Display a canvas as a X11 window [experimental]

Notifications You must be signed in to change notification settings

stumpycr/stumpy_x11

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

stumpy_x11

Display a canvas as a X11 window

Example

require "stumpy_x11"

include StumpyCore

width, height = 400, 400
window = StumpyX11.new(width, height)
canvas = Canvas.new(width, height)

steps = 100
steps.times do |t|
  (0...width).each do |x|
    (0...height).each do |y|
      canvas[x, y] = RGBA.from_relative(
        x / width.to_f,
        y / height.to_f,
        t / steps.to_f,
        1.0
      )
    end
  end

  window.write(canvas)
  sleep 0.02
end

window.destroy

TODO

  • Handle window close event
  • Documentation (writing raw slices)

Credits

Troubleshooting

If you run into errors like unknown type wchar_t, run ln -s /usr/include/linux/stddef.h /usr/include/stddef.h

About

Display a canvas as a X11 window [experimental]

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published