Code Monkey home page Code Monkey logo

go-wayland-simple-shm's Introduction

An attempt at porting the "simple-shm" demo client in the wayland-demos 
repository to Go. Currently, it does paint to the screen, but only does it 
once.

This is some of the worst code I've ever written and is strictly meant as a 
"Hey it can be done" sort of thing.

So far, while this is working, I still considered it a failed experiment. 
Primarily because the Wayland libraries use C function pointers gratuitously, 
and cgo cannot deal with these elegantly.

Moreover, all of the "callback" functions (prefixed with "go...") must be 
exported, and for whatever reason, the Wayland structs are not being properly 
translated to Go types. Thus, the callback functions must be stripped of all 
struct parameters, and data must be passed using unsafe.Pointer. Not pretty.

Please see 
https://groups.google.com/group/golang-nuts/browse_thread/thread/21839cae97586b79
for a more in depth description of the exporting problem.

Install
=======
This package is indeed Go gettable, but for it to do anything meaningful, 
you'll need to have a Wayland compositor running. (This has only been tested 
with the reference compositor, Weston.)

Run Weston (under X11 is fine) and then run 
$GOPATH/bin/go-wayland-simple-shm from a terminal.

Build instructions for Wayland can be found here: 
http://wayland.freedesktop.org/building.html -- If you're lucky, your Linux 
distribution has packaged it for you.

go-wayland-simple-shm's People

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.