Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

glx_opengl2_example? #1194

Closed
ivanstepanovftw opened this issue Jun 19, 2017 · 10 comments
Closed

glx_opengl2_example? #1194

ivanstepanovftw opened this issue Jun 19, 2017 · 10 comments

Comments

@ivanstepanovftw
Copy link

ivanstepanovftw commented Jun 19, 2017

Simple and functional extension, as nuklear do.
github.com/vurtun/nuklear/tree/master/demo/x11_opengl2

@ivanstepanovftw ivanstepanovftw changed the title glX example? glx_opengl2_example? Jun 19, 2017
@ocornut
Copy link
Owner

ocornut commented Jun 20, 2017

There's none, it would be nice if you want to contribute one? (closely modelled after the existing example)

@ocornut
Copy link
Owner

ocornut commented Jul 9, 2017

Closing this as it won't happen by itself. If someone is interested in creating such example they can PR it. Being a variant of initializing an OpenGL context it should be easy to recreate one if you follow X11+GL tutorials.

@ocornut ocornut closed this as completed Jul 9, 2017
@ghost
Copy link

ghost commented Nov 7, 2017

You can copy my X11 code (gpulib_imgui.h file), although it's for modern GL and C bindings of dear imgui: https://procedural.itch.io/lib0-engine

The hardest part was clipboard pasting, if you paste more than 262145 bytes of characters in X11 you have to do that asynchronously in chunks. I couldn't care less so I just wait g_ig_clipboard_paste_sleep_microseconds amount of time so an async operation could finish by that time.

@Flix01
Copy link

Flix01 commented Jan 30, 2018

[OT: just because the issue is closed] As far as I know, on Ubuntu Linux (one of the most popular Linux distribution), X11 will be replaced at some point by another library called Wayland (see: https://wayland.freedesktop.org/).

However it seems that Xorg will still be the default library in April, long term support, version (18.04 LTS) (see: https://insights.ubuntu.com/2018/01/26/bionic-beaver-18-04-lts-to-use-xorg-by-default/).

The Wayland version should have a sort of backward-compatibility layer to run X programs in any case.

So I think it makes sense to keep supporting X11 on Linux (even if I prefer using higher level libraries like glfw, glut or SDL2 to cross the gap).

Sorry for the O.T. post.

@ghost
Copy link

ghost commented Jan 30, 2018

The Wayland version should have a sort of backward-compatibility layer to run X programs in any case.

It suck so hard perf wise I can't believe people are serious about wayland at all.

@Flix01
Copy link

Flix01 commented Jan 30, 2018

It suck so hard perf wise I can't believe people are serious about wayland at all.

😄
Good to know! Maybe that's the main reason why Xorg will still be the default next Ubuntu version...

I've never tried Wayland myself. X11 works well enough for me.

@ghost
Copy link

ghost commented Jan 30, 2018

I also want to note wayland has been 9 years in development and even its native apps still have visual glitches and jerkiness. Just give them another 9 years to sort it out.

@ocornut
Copy link
Owner

ocornut commented Feb 1, 2018

I am interested in the extra example if they are proven to be useful, but they'd need to be done to match the existing examples so I can keep them in sync. I'm curious however how many of our target audience would really bother using X or Wayland without a wrapper (glfw/glut/SDL as you pointed @Flix01) and actually need an example?

By the way I expect in the upcoming month or so to refactor the examples/ folder and somehow find a way to separate the renderer (OpenGL3, DirectX11) from the platform (e.g. GLFW, Win32), that is to share more code. This is motivated by the fact that work on multiple viewport #1542 will put more burden on the platform layer. The difficulty will be to refactor that without losing some of the imgui examples simplicity.

@Flix01
Copy link

Flix01 commented Feb 1, 2018

how many of our target audience would really bother using X or Wayland without a wrapper (glfw/glut/SDL as you pointed @Flix01) and actually need an example?

To me the point is simple: X (or Wayland) is for Linux just what the plain Windows API is for Windows.
Its main advantages over wrappers are the faster startup time and the lack of dependencies (the latter can be mitigated in some cases by using static versions of the wrapper libraries).

I personally prefer using wrappers also because I can write code that is more portable, but the answer to your precise question is probably: people that use Linux and don't want to link to any wrapper library (the same happens for Windows users that want a plain Window API binding).

I expect in the upcoming month ...

Yes, this is the way to go if you need to add some other platform properties/services....
...but expect dozen of issue posts if the new binding code is not backward compatible.

@emasson-maxx
Copy link

So is there going to be a GLX w/ OpenGL3+ back-end after all? "Wastland" is still a few years from been ready and mainstream. If no one, I will do it and include it as my "default" binding for MaXX Desktop. cool?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants