Git Product home page Git Product logo

lwjgl3-swt's Introduction

What is it?

Revised drop-in implementation of SWT's GLCanvas.

What does it get me?

Support for:

  • creating OpenGL 3.0 and 3.2 core/compatibility contexts (including debug/forward compatible)
  • OpenGL ES contexts
  • floating-point and sRGB pixel formats
  • multisampled framebuffers (also with different number of color samples - Nvidia only)
  • v-sync/swap control
  • context flush control
  • robust buffer access (with application/share-group isolation)
  • sync'ing buffer swaps over multiple windows and cards - Nvidia only
  • delay before swap - Nvidia only

Why does it exist?

The above features have been lacking for some years in the SWT-provided GLCanvas implementation. The purpose of the new implementation on top of LWJGL 3 is to have full support for those features in an OpenGL SWT application.

How to use it?

In your existing SWT application just replace all imports of org.eclipse.swt.opengl.* with org.lwjgl.opengl.swt.*. The new implementation is a drop-in replacement, which means that your current SWT code should work like before. To use the new features you can use the new fields in the GLData class, such as using real multisampled framebuffers on Windows or creating a OpenGL 3.2 core context.

If your current OpenGL SWT setup looks like this:

Display display = new Display();
Shell shell = new Shell(display);
shell.setLayout(new FillLayout());
GLData data = new GLData();
GLCanvas canvas = new GLCanvas(shell, 0, data);

then adding multisampling and using a OpenGL 3.2 core context is as easy as doing:

Display display = new Display();
Shell shell = new Shell(display);
shell.setLayout(new FillLayout());
GLData data = new GLData();
data.profile = GLData.Profile.CORE;
data.majorVersion = 3;
data.minorVersion = 2;
data.samples = 4; // 4x multisampling
data.swapInterval = 1; // for enabling v-sync (swapbuffers sync'ed to monitor refresh)
GLCanvas canvas = new GLCanvas(shell, 0, data);

Vulkan support

Much like with the GLCanvas/GLData for OpenGL there is now also first exprimental Win32 support for Vulkan:

Display display = new Display();
Shell shell = new Shell(display);
shell.setLayout(new FillLayout());
VKData data = new VKData();
data.instance = instance; // <- the VkInstance created outside via LWJGL 3
VKCanvas canvas = new VKCanvas(shell, 0, data);
long surface = canvas.surface;

What is planned for the future?

Support for:

  • Vulkan
  • Linux and OS X
  • associating rendering contexts with specific GPUs on Nvidia and AMD
  • pbuffers (there are interesting extensions that are only supported for pbuffers, such as EXT_packed_float and NV_video_output)

lwjgl3-swt's People

Contributors

httpdigest 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.