Giter VIP home page Giter VIP logo

eglx's Introduction

EGLX 0.1

A X11/GLX Wrapper for EGL/Wayland

by Tarnyko <tarnyko@*.net>

Description

EGLX wraps basic X11/GLX calls, used by popular Unix OpenGL applications, to EGL/Wayland ones.

Coupled with the jwzGLES wrapper, it permits to run legacy OpenGL applications on a Wayland compositor, eventually using hardware acceleration.

EGLX in action

Prerequisites

Wayland 1.2, Mesa EGL >= 9.0.3, Mesa GLESv1 >= 9.0.3

Usage

  • Create libEGLX.so by running : ./compile_eglx.sh Or for some early GTK+3/X11 wrapping, better run : ./compile_eglx-withgtk3.sh

Put the resulting libEGLX.so and all EGLX*.h files in the same directory as the GLX application you want to wrap.

  • Then take this application source code, glxgears.c e.g., and replace GLX headers such as :
#include <X11/Xlib.h>
#include <GL/glx.h>
#include <GL/glxext.h>

by :

#include "EGLX.h"
  • Then, in the app "main()" function, add at the beginning :
EGLX_main(0);
  • Then compile your application with this kind of command : gcc glxgears.c -o glxgears `pkg-config --cflags --libs wayland-client wayland-egl egl` libEGLX.so

  • If the application uses desktop GL, thus pulling X11 :

#include <GL/gl.h>

and you happen to have the jwzGLES wrapper handy, do :

#include <GLES/gh.>
#include "jwzgles.h"

And then compile using : gcc glxgears.c -o glxgears `pkg-config --cflags --libs wayland-client wayland-egl egl glesv1_cm` libEGLX.so libjwzgles.so -DHAVE_JWZGLES -DGL_VERSION_ES_CM_1_0

(If the app does some GTK+3 X11 calls (GtkGLArea3 e.g.), don't forget to comment :

#include <gdk/gdkx.h>

and to add on your compilation line : `pkg-config --cflags --libs gtk+-3.0`)

Examples

Most GLX famous examples (GLXDemo, GLXGears, GLXHeads, ManyWin, Offset) work with the wrapper. To test with GLXGears, once you've got "libEGLX.so" ; copy it to the "examples" folder and run : ./compile_glxgears.sh

Licensing

See COPYING ; except for "EGLX-eventdef.h" and "EGLX-keysymdef", which are more and less copies from X11's ones (and therefore, under the terms of its MIT license) ; and "examples/jwzgles*" files which are under the terms of their author.

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.