OpenGL as foundation for windowing system

I posted this text as a follow-up to an earlier message of mine, however I want to pursue this concept so I think it should be its own thread.

start prior
If OpenGL can be used for 2d graphics, has anyone tried using it for the foundation of a windowing system?
For instance, why or why not would it make sense to implement XWindows using OpenGL as the foundation?
end prior

It was pointed out that ultimately OpenGL requires a native windowing subsystem as a foundation to work on.

It seems though that others have already pursued this concept as there is a toolkit for OpenGL called GLUI. Info here:
http://www.cs.unc.edu/~rademach/glui/

Why don’t we have an open source layer below OpenGL that is native and provides a standard windowing interface on all platforms for OpenGL ( or any other future libraries )?

I think this layer would be relatively small. It would be just primitive functions and it knows about a platforms graphiccard device drivers.

If we had another open source layer below OpenGL that OpenGL could use as its windowing system then:

  1. We would not need different implementations of OpenGL, we could implement one source code implementation that could be recompiled on any system that uses this native windowing foundation.

  2. OpenGL could be brought to any operating system, not just those that have their own windowing systems.

  3. Operating System developers would no longer have to worry about implementing their own GUIs. They just implement this foundation layer, recompile OpenGL, and use all the future OpenGL windowing systems that people would write. Don’t like your windowing system? Swap it for another one. Want to use three different Windowing systems at once? No problem.

If someone who deeply understands the underpinnings of OpenGL could explain to me why this would or would not be sensible I would love to hear it.

Thank you!

what about glut ?

I think you should think of opengl is a primitive which lies below the windowing system. Opengl is for handling the drawing for images or primitives that make up complex objects.

Example of levels in a windowing system:
My_program is at the top level.
My_program call’s for a window to be open.
Windowing API send’s information to opengl on how to draw the window.
Opengl then renders the graphics for the window. lowest level.

The same with GLUT which manages windows, mouse, keyboard and menu functions.
Then opengl draw’s what GLUT requests.

As stated by another post glut supports a primitive windowing system for opengl and is supported by diffrent operating systems. So if you write a program with GLUT you can compile it to run on any platform that supports the GLUT library.

As to your multiple windowing system, check out linux. Linux has a few diffrent windows API’s.

Windows, GNOME, KDE top level window API’s,
Windows being the only one not open source or cross platform. What you have asked about cross platform GUI, was the idea behind x-windows which has opengl support.

You should also look at http://www.trolltech.com/ at their cross platform compiler and GUI API interface.

The idea of crossplatform API’s is so that you can write a program once and then just re-compile it to run on any computer without having to write new code.

Originally posted by ogl_is_great:
[b]I posted this text as a follow-up to an earlier message of mine, however I want to pursue this concept so I think it should be its own thread.

start prior
If OpenGL can be used for 2d graphics, has anyone tried using it for the foundation of a windowing system?
For instance, why or why not would it make sense to implement XWindows using OpenGL as the foundation?
end prior

It was pointed out that ultimately OpenGL requires a native windowing subsystem as a foundation to work on.

It seems though that others have already pursued this concept as there is a toolkit for OpenGL called GLUI. Info here:
http://www.cs.unc.edu/~rademach/glui/

Why don’t we have an open source layer below OpenGL that is native and provides a standard windowing interface on all platforms for OpenGL ( or any other future libraries )?

I think this layer would be relatively small. It would be just primitive functions and it knows about a platforms graphiccard device drivers.

If we had another open source layer below OpenGL that OpenGL could use as its windowing system then:

  1. We would not need different implementations of OpenGL, we could implement one source code implementation that could be recompiled on any system that uses this native windowing foundation.
  1. OpenGL could be brought to any operating system, not just those that have their own windowing systems.
  1. Operating System developers would no longer have to worry about implementing their own GUIs. They just implement this foundation layer, recompile OpenGL, and use all the future OpenGL windowing systems that people would write. Don’t like your windowing system? Swap it for another one. Want to use three different Windowing systems at once? No problem.

If someone who deeply understands the underpinnings of OpenGL could explain to me why this would or would not be sensible I would love to hear it.

Thank you![/b]

[This message has been edited by nexusone (edited 04-23-2002).]

[This message has been edited by nexusone (edited 04-23-2002).]

GLUT is close to what I’m looking for however, GLUT seems to require a native windowing system underneath it in order to run. In other words, GLUT lets you program OpenGL without knowing about the underlying Windowing system.

I would like no underlying Windowing system.

Something that would be all the necessary parts needed to support an underlying windowing system. Then run OpenGL on top of that. Then run something like GLUI in OpenGL.

I guess I’m looking for something that is a merger of XWindows and OpenGL. Maybe “O-Windows”?

nexusone:

I don’t think that order of operations is correct from what I have read on the GLUT info page here:
http://www.opengl.org/developers/documentation/glut.html

which says:

“GLUT is designed for constructing small to medium sized OpenGL programs. While GLUT is well-suited to learning OpenGL and developing simple OpenGL applications, GLUT is not a full-featured toolkit so large applications requiring sophisticated user interfaces are better off using native window system toolkits like Motif.”

I believe that GLUT and OpenGL reside ON TOP of a windowing system. Maybe OpenGL by-passes the Windowing system in certain cases.

Simple proof: You can’t run OpenGL or GLUT without a Windowing system installed.

If OpenGL was below a Windowing system you could do this. Try running OpenGL on some Unix with no X11 or Motif, or any other windowing system installed. From what I understand, that is impossible.

Please correct me, with proof, if I’m wrong.

Thank you.

My term of opengl being below windows API, is that it provides primitive graphic functions vs. the higher level functions that take care of drawing windows, button’s, etc. OpenGL like Direct-x provide primitive graphics routines that are not a function of the windowing enviroment and are used to by-pass the windows normal channel of drawing to the screen to improve speed.

In most cases now you see opengl as part of a windowing system, but I see no reason that is has to be used with one. The reason you don’t see any opengl program’s without a windowing system is that you would have to write a custom opengl video driver for your card. That is why under linux you have a hard time finding hardware rendering support for opengl.

Then let’ go back to your question as to opengl as a foundation for windowing system.
First opengl is a graphics API, just like direct x. Nether was writen to replace the windowing system but to provide graphics functions mainly 3D.

But there is nothing that ties opengl to any windowing system, so the anwser is yes the opengl could be the foundation for a GUI in handling writing to the screen. But then you now you are talking about creating a new operating system.

Also back to your three points, the reason for x-windows or MS windows API is so that programmer would not have to re-write GUI’s every time they wrote a program.

What you have asked is being done now already with thing’s like opengl, glut, x-windows, QT… If you write a game in opengl you can easly move it to another platform, vs. direct x which will run only on a windows platform.

Originally posted by ogl_is_great:
[b]nexusone:

I don’t think that order of operations is correct from what I have read on the GLUT info page here:
http://www.opengl.org/developers/documentation/glut.html

which says:

“GLUT is designed for constructing small to medium sized OpenGL programs. While GLUT is well-suited to learning OpenGL and developing simple OpenGL applications, GLUT is not a full-featured toolkit so large applications requiring sophisticated user interfaces are better off using native window system toolkits like Motif.”

I believe that GLUT and OpenGL reside ON TOP of a windowing system. Maybe OpenGL by-passes the Windowing system in certain cases.

Simple proof: You can’t run OpenGL or GLUT without a Windowing system installed.

If OpenGL was below a Windowing system you could do this. Try running OpenGL on some Unix with no X11 or Motif, or any other windowing system installed. From what I understand, that is impossible.

Please correct me, with proof, if I’m wrong.

Thank you.[/b]

First x-windows does have support for opengl, and there has been GUI mod’s to x-windows to use opengl to render the x-windows menu’s and pop-up windows.

There was an story on here a few weeks back on it.

Originally posted by ogl_is_great:
[b]GLUT is close to what I’m looking for however, GLUT seems to require a native windowing system underneath it in order to run. In other words, GLUT lets you program OpenGL without knowing about the underlying Windowing system.

I would like no underlying Windowing system.

Something that would be all the necessary parts needed to support an underlying windowing system. Then run OpenGL on top of that. Then run something like GLUI in OpenGL.

I guess I’m looking for something that is a merger of XWindows and OpenGL. Maybe “O-Windows”?

[/b]

Nex, I think you are missing the point… X-windows, the same as any windowng system can work with opengl… The point is though that there should be a way to do a windowing system with opengl underneath, since it is crossplatform… Now, what this means is that you dont have to develop a gui in Linux (gnome, kde!, whatever), in Windows, and X-windows to use your opengl…

Check out this link… It may help… http://www.sulaco.co.za/opengl.htm#particlelines

Sweet stuff. I am thinking about adopting this and writting it in c++ because the one the link has is in delphi…

ogl_is_great, wanna help?

Mancha: thank you. I’m delighted people share a vision.

The link is very interesting. I’ll investigate it more thoroughly soon.

I think that I said that in my post, that opengl does not have to have a windowing system in order to work, just a driver to let it talk to the video card. and some basic i/o functions (mouse/keyboard/etc).

Since it is open source you can get the source and make it a basis for you low level routines and build a GUI over it.

Originally posted by mancha:
[b]Nex, I think you are missing the point… X-windows, the same as any windowng system can work with opengl… The point is though that there should be a way to do a windowing system with opengl underneath, since it is crossplatform… Now, what this means is that you dont have to develop a gui in Linux (gnome, kde!, whatever), in Windows, and X-windows to use your opengl…

Check out this link… It may help… http://www.sulaco.co.za/opengl.htm#particlelines

Sweet stuff. I am thinking about adopting this and writting it in c++ because the one the link has is in delphi…

ogl_is_great, wanna help?[/b]

ogl_is_great, I understand what you mean, and I think a GUI/windowing system based on OpenGL would be great. A couple of years ago I realized that most windowing systems are based on old 2D technology (draw lines, blit boxes etc). Today almost every video card has some 3D acceleration.

At a very minimum this new hardware could be used for e.g window transparency (alpha blending) and scaling/zooming (imagine scaling un-focused windows to 1/2 the size on the screen, with hardware filtering). The next step would be to utilize the third dimension to give more degrees of freedom for arranging windows on the desktop, etc. I think OpenGL would be ideal for such a windowing system, since it is portable, well proven etc.

Well, this will probably never happen for mainstream PCs (the only possibility would be a hacked X Window server + window manager, but I doubt that would get you very far). Perhaps this could be something for e.g. hand held devices etc in the future? (eye candy tends to $ell)

A cool project is: http://www.3dwm.org/

Yes cool idea but I’d like to point a little thing: most users are “stupid” and a 3d desktop would confuse them.

A cool thing:
SwapBuffers (almost under MS-Win) seems to be just a blitting op. between front and back buffers. I’d like it to be something like this: the memory page of the bb is used to read data for the monitor and the fb is used to write. something like the old BGI funcs:SetVisualPage,SetActivePage.

marcus256, Mac OS X uses the 2D and 3D acceleration of the graphic cards for displaying its desktop with transperancy and other effects. Looks really cool

RoCKdaFrogg

Seems like M$ are catching up (?):
http://www4.tomshardware.com/business/02q2/020417/winhec11-05.html

I think this was expexted (MS’s gpu based OS). They were considering using DirectDraw for windows98, but it was considered overkill and that GDI was good enough.

Also, there was one person who made a desktop overlay made of opengl icons and such. I dont have the URL unfortunatly, but it was annouced here.

V-man

Actually MacOS-X uses OpenGL to render its desktop… Sweet huh?

The problem would be that OpenGL does not handle hardware signals (mouse, keyboard…)
So, here we run into problems again…

I don’t think the intent is for opengl to be the os, but the underlaying graphics engine. Like on the MacOS-X.

Originally posted by mancha:
[b]Actually MacOS-X uses OpenGL to render its desktop… Sweet huh?

The problem would be that OpenGL does not handle hardware signals (mouse, keyboard…)
So, here we run into problems again…[/b]

on the who calls who topic:

-the app sets up widgets and opengl scene
-the windowing system keeps track of which windows need to be redrawn(in case of opengl scene, always) and handles the widgets
-the graphics subsystem rasterizes the widgets and/or opengl scene (in case of hardware acceleration, the driver rasterizes the opengl scene directly to video memory)
-the video card driver rasterizes to video memory

any ideas on why creating a windowing system on top of XFree (which supports OpenGL acceleration on a layer right below the windowing system) like KDE or Gnome that relies on OpenGL to draw all widgets, be it 3D or not?

It seems, from the varied responses, at the very least this is a complicated topic with many possible approaches. I’m glad my initial confusion was not unwarranted. All the input you people have given me has been great.
Thank you!

Originally posted by mancha:
[b]Actually MacOS-X uses OpenGL to render its desktop… Sweet huh?

The problem would be that OpenGL does not handle hardware signals (mouse, keyboard…)
So, here we run into problems again…[/b]

I thought it used Aqua? I have never heard OSX uses GL to render the UI. But $10 says it will someday. I hope.