Giter Club home page Giter Club logo

xcbwin's Introduction

Xcbwin

Xcbwin - a simple C++ class for graphical outputs using XCB.

Xcbwin is a lightweight class that provides rudimental and fast methods to produce simple graphical outputs. The Xcbwin class is written for the "Computational Physics" lecture given at the University of Wuerzburg (Germany). Hence it is designed to be easy to use even by students, that are new to C++.

Currently the class provides methods to:

  • Draw Lines, Circles, Points and Rectangles
  • Change the color
  • Handle keyboard events

The Xcbwin-class is based on the Xwindow-class that was written using Xlib. Xcbwin is designed to be downwardly compatible to the Xwindow-class, but uses XCB (X protocol C-language Binding) which is intended to be a replacement for Xlib in the future.

To be easy to compile the Xcbwin-class consists only of one file. This can be downloaded here:

Download xcbwin.h

Usage

It's easy and almost self-explanatory how to use Xcbwin:

#include "xcbwin.h"
int main() {

Xcbwin Window;
Window.Open(400,400); //Opens a Window of size 400x400
Window.Black(); //Sets the drawing-color to black
Window.DrawRectangle(20,20,30,30); //Draws a Rectangle
Window.Wait(); // Waits for a keypress-event
Window.Close(); //Closes the Window

}

To compile ỳou have to link the xcb-library:

g++ mycode.cpp -lxcb

For a better example look at the "demo" folder.

##Contributions

If you have some good ideas or suggestions how to improve the Xcbwin class please do not hesitate to fork the project or get in touch. Currently the official Xcb-documentation is sometimes not very helpful. Hence a lot of the code was written by "try and error" and there are many flaws that need to be corrected. So even if you just have criticism please get in touch :-) .

License

Xcblib is published under the MIT license. See the LICENSE file for more info.

##Contact

If you have any trouble using this class, feel free to contact the author @jofalk.

xcbwin's People

Stargazers

 avatar

Watchers

 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.