PDA

View Full Version : glut is dead, that live the gl...



saian
05-14-2002, 05:39 AM
hello all of you,

i've read in the advanced forum that glut is dead. that may explain why it's released 3.7.3 for years... and it's not free, not terminated...
So, i think i'd have to use glx now. it would be better, and maybe more faster (if i code it well !).

So, here are my questions:
a window under X is called a Display, insn't it ?
how to create a simple windows under X and how to use glx ? i mean in the most simple manner. I'll see very later for next functionnalities as keyboarding...

thank you

martin_marinov
05-14-2002, 08:13 AM
Hi

I suggest you to take a look at the mesa demos - there is (at least was) a directory xdemos or something like this. http://mesa3d.sourceforge.net
If you want to stay portable, try the link proposed in the adv. forum http://freeglut.sourceforge.net/
or sdl.

Regards
Martin

richardve
05-14-2002, 12:45 PM
You can download the Linux/GLX versions of the NeHe tutorials at the following site:
http://www.uni-karlsruhe.de/~Mihael.Vrbanec/projekte.html

nukem
05-15-2002, 05:39 PM
Ive just started OpenGL on Linux and I have been using GLUT alot. Are you saying I should give it up?

saian
05-15-2002, 09:41 PM
i don't say everybody should give up. i just
read on another forum that glut is no more used, that explain that it's 3.7.3 for years.
and, it's not free, so you couldn't modify it, but only use what's implemented.
you know, some tricks had to be done for the 4.0 rel. but now, they won't be done.

richardve
05-15-2002, 11:46 PM
Originally posted by nukem:
Ive just started OpenGL on Linux and I have been using GLUT alot. Are you saying I should give it up?

As you can see in the previously mentioned tutorials, X/GLX isn't really that hard to learn.
(okay, the docs for X really suck, but don't let that stop you from using it.. it's actually very easy)

So you don't need GLUT at all..
(just like you don't need it on the Windoze platform)

You can also learn some more about X/GLX by reading the sources of Portalib (http://rsn.gamedev.net)

saian
05-16-2002, 12:16 AM
but the problem is when you don't use glx or don't want to use it (is that really possible in fact?). so, you may encounter some glx: unable to ...

richardve
05-16-2002, 05:53 AM
No, it isn't possible to use OpenGL without GLX on X (please note that I'm talking about X only, I don't know anything about Berlin, (X)DirectFB or SVGALib), just like it's also not possible to use OpenGL without WGL (win32/64 version of GLX) on Windoze (afaik).

But could you tell me why you wouldn't want to use GLX?
(it's only a few lines of (easy) code)

btw. GLUT is only a wrapper, which uses GLX/WGL too..

[This message has been edited by richardve (edited 05-16-2002).]

saian
05-16-2002, 10:09 PM
you mean easy code ?
what do you need to support under glx ? rendering, refreshing, keyboard interactivity ? and what else... joystick...
glut supported it easily.
I know, berlin & SVGAlib are not used a lot (i think in this case, you'll have to use the frame-buffer)....
I know about glut, glx and wgl. But glut was not created in 2 weeks. he was created by a great programmer (well known in fact) , so i wonder if I really could do a good thing under glx. In fact, i'm afraid i bad-code it, so it's slow or bad refreshed...
More, some people here told that Nehe tutors wheren't good enough, the X doc very poor...

So, i would like to know which is the best.
It seems it's glx. I understand well. So, i have to see.

Thankx you anyway you all !

richardve
05-17-2002, 03:37 AM
what do you need to support under glx ? rendering, refreshing, keyboard interactivity ? and what else... joystick...

Rendering is done with OpenGL itself, flipping the backbuffer is done with glXSwapBuffers(..), keyboard presses can be taken care of using X (ie. KeyPress message, XLookupKeysym(..)) and joysticks can be used via X too.


I know, berlin & SVGAlib are not used a lot (i think in this case, you'll have to use the frame-buffer)....

That's probably because you won't get hardware acceleration when using Berlin and/or other grahpical libs.
Well, not for NVIDIA cards anyway, because they're not releasing any specs (AFAIK)
http://www.opengl.org/discussion_boards/ubb/frown.gif


glut was not created in 2 weeks. he was created by a great programmer (well known in fact) , so i wonder if I really could do a good thing under glx. In fact, i'm afraid i bad-code it, so it's slow or bad refreshed...

You can be a great programmer too, but you will only be a great programmer when you're doing things yourself, when you know how stuff works, etc.
And definitly not by taking a library for every part of your application because it may save you from typing 100 lines of code.

Don't be affraid to type bad or slow code, just read, try and do things and you'll get more experienced.

And like I said, you won't be using GLX (and X itself) much (only when initialising, swapping the buffers and when shutting the program down)
Heck, I'm only using those functions 10 times in a game engine with 16.000 lines of code!


More, some people here told that Nehe tutors wheren't good enough, the X doc very poor...

NeHe's tutorials are no good in a way that NeHe's using far too many useless comments, all in one file, bad programming practices, etc.
But they ARE pretty good to learn OpenGL with http://www.opengl.org/discussion_boards/ubb/smile.gif

And yes, the X manuals are indeed very poor..
But you shouldn't give up because of bad documentation.
Just browse lots of code from other people to see how stuff works (but do not copy+paste http://www.opengl.org/discussion_boards/ubb/wink.gif).

Hey, you're a programmer, right?
Show what you can do and code up a spiffy OpenGL accelerated program instead of saying on a forum that you're affraid about typing bad code http://www.opengl.org/discussion_boards/ubb/smile.gif


So, i would like to know which is the best.
It seems it's glx. I understand well. So, i have to see.[/B]

Just try it http://www.opengl.org/discussion_boards/ubb/smile.gif


(Pfew, I hope that was enough peptalk http://www.opengl.org/discussion_boards/ubb/wink.gif)

saian
05-17-2002, 04:25 AM
richardve,

wouhou thanx!
Okay, glx supports all the interactivity with any user. That's find, but when you want some portability, so u need to redevelop all these parts to comply with the appropriate environment. so for windows if you want this support (and I don't like Windows as i'm a programmer not a windowser -- the shame is that windows is needed now everywhere) you need to develop them.
So the code is twice or more huge than before with many conditions in it, so it's less quick.

OK for Berlin and SvGAlib.

Ys. to be a good programmer, you need to know how the stuffs work; that's an obligation, i think. I know, but i like to think too that creating the wheel again is not very good for the evelution. that's what think many programmers you know !

One of the problem is the time. Time is spending very fast. the work, the moves... and your other activities. One of the other is that i'd like more game programming than learning and making an another nth 3D engine.
how much time you'll spend for such an engine ? and then, after for your game engine, and then finally, for the game itself and its production.
But if you want you can I know. I'd like to be reach and could work as I want on all that but it sound not me.

16000 lines ? this is huge !!

But i'm trying it. Just wanted to know what the best for it ! so, forget glut ! let's go!

richardve
05-17-2002, 06:59 AM
but when you want some portability, so u need to redevelop all these parts to comply with the appropriate environment. so for windows if you want this support (and I don't like Windows as i'm a programmer not a windowser -- the shame is that windows is needed now everywhere) you need to develop them.
So the code is twice or more huge than before with many conditions in it, so it's less quick.

Don't think about portability yet, spend your time on good programming practices, OpenGL (of course http://www.opengl.org/discussion_boards/ubb/wink.gif) and other things you would like to learn.
Windows is just a bunch of different API's to use and it won't make your code twice as large or slower (if you're doing it the 'right' way).


Ys. to be a good programmer, you need to know how the stuffs work; that's an obligation, i think. I know, but i like to think too that creating the wheel again is not very good for the evelution. that's what think many programmers you know !

You're right, recreating the wheel isn't a good idea.
But we're talking about something here in this topic wherefore you don't need a wrapper, library or whatever because it's far too simple.
It would take more time to use the wheel than to create it.


One of the problem is the time. Time is spending very fast. the work, the moves... and your other activities.

Yep, I know all about it (who doesn't http://www.opengl.org/discussion_boards/ubb/smile.gif)


how much time you'll spend for such an engine ? and then, after for your game engine

I've been busy since December 2001..
However, I'm not working fulltime on it (timeprobs http://www.opengl.org/discussion_boards/ubb/wink.gif)
And I've also taken some code from my previous projects (mostly math specific code)
And there's not only an engine, but also a set of tools (for converting data, stripping triangles, cleaning up, reordering, shadertool, etc, etc)

Let's just say that it takes MUCH time http://www.opengl.org/discussion_boards/ubb/smile.gif
(don't count on finishing an engine within 1, 2 or even 3 years, especially when you're new to all of this stuff)

But again, at this moment, don't even think about creating game engines or even games.
(except for small games like Tetris)


and then finally, for the game itself and its production.

I have no idea how much time that would take, it all depends..
(I haven't even started thinking about a game)


16000 lines ? this is huge !!

Nah, that's actually not huge at all..
And there's lots of more code coming...


[This message has been edited by richardve (edited 05-17-2002).]

jmg
05-17-2002, 06:08 PM
> (don't count on finishing an engine within 1, 2 or
> even 3 years, especially when you're new to all of
> this stuff)

saian,

I think one of the things that richardve is getting at here is to enjoy the journey. http://www.opengl.org/discussion_boards/ubb/smile.gif

richardve
05-18-2002, 06:34 AM
Yep http://www.opengl.org/discussion_boards/ubb/biggrin.gif

saian
05-21-2002, 12:19 AM
i've wrote my first all glx programm.
But it's limited to see. can't move with the mouse, nor the keyboard. i haven't seen yet how to add these stuffs. And of course, idle time or timed called functions (as glutTimerFunc).

For the game engine Richardve, i'm not new at programming, just not very good on opengl, and simply NULL in glx. Otherwise i have ideas that i hope I could develop.

you've said you're busy since december 2001 !!! it's only 6 months you're on it and it has already all these stuffs ??
is it a 3D engine or a game engine ? (think it's the first).

05-21-2002, 08:00 AM
Well, I think the best way to learn is to see an example. So if you want you can go to http://www.dcc.online.pt/~c0007032/xwindow.tar
This is a little c++ class that I made to give you an example of how easy this is! This was coded in few time and the comments aren't the best... But I think the code speak for it self!
It also as an example of how to use the class.
It as a simple keyboard interaction, once again just for example. If you have any question, I'm glad to answer you.

Carpe Diem!

saian
05-21-2002, 11:54 PM
thank you Joseph_n !!

yeah, it looks like quite easy to make keyboard interactivity with glx. So, i'm going this way. wouldn't be glut dependant anymore !
Do you know if the key relation depends on your keyboard, or is it made to comply with all types of keyboard (QWERTY, AZERTY...) ?

By the way, does someone know where can i find more information about glx: mouse interactivity, joystick, joypad ?

anyway, thank you all for such friendly manners.

amendol
05-22-2002, 07:28 AM
For my software I just use the joystick device directly.

/dev/js

It's actually very easy.
One thing that I also do is have the joystick reading code done in a thread so that the response time for user activity is not limited by the games frame rate.

I believe that the docs for this device are in: /usr/src/linux/Documentation/input/joystick-api.txt

as long as you have the kernel source and it is in /usr/src/linux http://www.opengl.org/discussion_boards/ubb/smile.gif

There are some code fragments in there, that should be enough to get you going.

You can also do a google search for force feedback.

I believe that someone has gotten it working for linux -- but it's most-likely pretty alpha right now.

Jamie

05-22-2002, 10:42 PM
Nate Robins is updating the Windows version of GLUT and linux patches could perhaps be sent to the Mesa project. GLUT is working and pretty complete so it is useable.

SGI has a book about OpenGL+Irix and most of it applies to linux also. http://toolbox.sgi.com/linux/documents/OpenGL/overviews.html#OGLSGS
OpenGL and X is also described in some articles by Mark Kilgard http://toolbox.sgi.com/linux/documents/OpenGL/overviews.html#OglXIn

GLX is just the OpenGL extension to X so most of the code is standard X code. Most OpenGL programs does not need the more advanced stuff so the same base code can be reused. Besides the man pages have I not found any really good free and complete source about Xlib. Here is two links http://tronche.com/gui/x/ http://www.rahul.net/kenton/index.shtml

A window is called a window under X. http://www.opengl.org/discussion_boards/ubb/smile.gif
The XOpenDisplay call is for getting a connection to the X server.

Moritz
05-23-2002, 08:11 AM
Originally posted by martin_marinov:
If you want to stay portable, try the link proposed in the adv. forum http://freeglut.sourceforge.net/
or sdl.


Hey Martin!
Is freeglut different than glut? Or is it just new made, free and open for all programmers?

Cya Moritz

saian
05-23-2002, 11:28 PM
hey thanx all !

i'll try all that this week-end if i could, otherwise later, but i'll try !!

thanx again

marcus256
05-28-2002, 02:22 AM
GLFW (http://hem.passagen.se/opengl/glfw/) supports X11, and it's frequenctly updated. In many situations it can serve as a GLUT replacement (and in many situations it's better than GLUT).

martin_marinov
05-28-2002, 09:43 PM
Originally posted by Moritz:
Hey Martin!
Is freeglut different than glut? Or is it just new made, free and open for all programmers?

Cya Moritz

Hi
In fact I never used it http://www.opengl.org/discussion_boards/ubb/smile.gif, but from what I've read in the site, it appears that they support the same api like glut, so you only have to recompile and link against their library. To be honest, most of my work involves more advanced GUI libraries, and I found the perfect and portable solution in wxWindows (not-paid advertise http://www.opengl.org/discussion_boards/ubb/smile.gif. (http://www.wxwindows.org)

Regards
Martin

mikael_aronsson
05-29-2002, 12:18 PM
Hi !

Even though there isn't much development going on with GLUT, it is a nice stable API and pretty useful for many applications so I don't see any reason not to use (or freeglut if you prefer), but there are lots of other alternatives if you want OpenGL on X. Like SDL, Fltk, Qt, FOX just to name a few.

Mikael

saian
05-30-2002, 05:38 AM
hey !

when i type xdpyinfo (only know it's not so far), it seems that it shows what X can support as events: mouserelease, mousemove... (i don't remember exactly what's written).
is that all the events i could use for supporting mouse ? (and keyboard).
and there are some strange events as user events or something like that.

any idea about that, or some could redirect me to some better place ?
sorry if it isn't an OpenGL question.

saian
05-30-2002, 05:52 AM
uh, i forgot.
if it wasn't that (what's upside); then could someone tell me how to stand the mouse correctly under X ?

i haven't found anything yet for this subject.

05-30-2002, 09:43 AM
Use SDL instead of GLUT, once it provides easy-to-use OpenGL initialization routines and is widely used by GNU/Linux games (besides being portable). You can find it at:
http://www.libsdl.org

06-05-2002, 06:01 PM
Do you thinking about how to detect the mouse wheel under linux? According to the following page are the scrolling reported as mouse button 4 and 5 events in Xlib. http://koala.ilog.fr/colas/mouse-wheel-scroll/

Typing "apropos wheel" gives some extra information about the wheel and Qt.

saian
06-15-2002, 08:46 AM
i didn't talked about the wheel. i wasn't focused on it, but that's a good thing !! thanx, it will avoid me to seek anywhere for it !!

yeah, thanx !!