Glut is dead, that live the gl

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

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

You can download the Linux/GLX versions of the NeHe tutorials at the following site:
http://www.uni-karlsruhe.de/~Mihael.Vrbanec/projekte.html

Ive just started OpenGL on Linux and I have been using GLUT alot. Are you saying I should give it up?

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.

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

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 …

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).]

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 !

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)

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

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

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

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

(Pfew, I hope that was enough peptalk )

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.

Yès. 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!

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

Yès. 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 )

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 )
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
(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).]

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

Yep

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

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!

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.

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

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

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.
The XOpenDisplay call is for getting a connection to the X server.

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