pouët.net

Go to bottom

4k GL framework for Linux

category: code [glöplog]
By the way, with SDL things can get as small as your symbols take and simple calls.

sorry for cross posting.
added on the 2009-12-08 20:16:20 by sp3c sp3c
dlopen/dlsym is old-school!!!111 http://www.pouet.net/prod.php?which=51762
I think the point is that SDL isn't really integral part of the system (as opposed to DX), it's installed by default on some systems (Ubuntu), but not on others.
added on the 2009-12-08 21:24:28 by snoutmate snoutmate
I am sorry but DX was not on my system (as for Windows 7, installed 2 months ago for contracting machine).

And that is not a good excuse. SDL is not cheating, DX is much more cheating because it contains math function for instance and other crap released as dx_bla_69.dll's.

Sorry, not a good argument.

Thanks for the link of the intro:)
added on the 2009-12-08 21:30:02 by sp3c sp3c
Quote:

Also I need to set fullscreen mode, any help is welcome (that's why I need the override_redirect=1, I believe...?)
Quote:

well, iq, first you need to answer the question, why would like to do it in that way?


I don't necessarily want to do it that way - that's just the way I came with so far. I hoped I would find help here, but so far I only get "SDL", which is the answer to the wrong question here.

I don't need help to a GL window in Linux, that's a solved problem, since long ago, with SDL, with GLUT and with XServer. I'm also familiar with the progresss that has been done in the 1k Linux scene and all the ELF, import and the tricks, so again, let's obviate this for now.

The problem is I have chosen a misleading title for the thread. My bad. Let's start again:

Thead Title: "Minimal GL startup code without SDL/GLUT"
Exercise: "To find the minimal legal set of calls to open a window and create a context"
Motivation: As with the rest of the demoscene productions and absurd limitations, "None that makes sense."

I hope vinzut can elaborate a bit in his proposal, or that other Linux gurus pop by and optimize the code legal-API-calls-wse


added on the 2009-12-08 23:53:04 by iq iq
With full respect to you and full support, but still don't get it.:)
Well, I understand that, `let's do it that way', but there is huge difference, producing a decent demo, and struggling with XLib, the later is much less productive.
Isn't something that destroys the focus on what we can do with Linux for the demoscene.

Also I am not feeling like a hacker right now, but... you can try also on X11 mailing list, they might come with some fresh ideas that we cannot infer easily.
added on the 2009-12-09 00:25:15 by sp3c sp3c
iq: For "raw X way" you should also consider using XCB which is a replacement for Xlib. I wonder which one would produce smaller binary.
added on the 2009-12-09 00:30:20 by masterm masterm
ok understood bit more. Good luck!
added on the 2009-12-09 00:34:54 by sp3c sp3c
The idea is simply to exhaust all the possibilities one has to render into a window, and complete this list here (http://iquilezles.org/www/material/isystem1k4k/isystem1k4k.htm) with the SDL, GLUT and Xlib versions (the later for GL and Soft rendering, which I already have working too thru XBitmap). Of course, before uploading the new complete framework with Linux support I wish I had some reasonable approximations to the "minimun" code setup for each of them. That's where this thread comes from. It's up to the user of the framework to decide is (s)he goes for solution a, b or c depending his preferences, I just want to give all the options. But apparently this is going to be more work than expected, now it seems there is this thing called XCB? What's that???

( now, without entering such a useless discussion of "SDL is cheating" as the "D3D dlls is cheating" is, I'm personally still interested to see how much bytes I have to pay for being able to show 4k intros to my colleagues without fixing their symbolic links or whatever they are missing right now to SDL. Will it be +250 bytes,or only +50, or how many? )

added on the 2009-12-09 03:51:58 by iq iq
I so knew you were talking about the Pixar machines iq! :D
added on the 2009-12-09 08:39:50 by decipher decipher
iq: XCB is an alternative API to Xlib. It's asynchronous, thus sometimes faster (but it doesn't matter anyways since we're creating just a single window) and the developers claim it has a really small footprint (for whatever their definition of 'small footprint' is). Some window managers use it and it's generally considered a good choice over Xlib (performance-wise, as I've said I don't know whether it produces smaller or bigger binary than linking to Xlib).

Take a look at wiki page, there's even an example code.
added on the 2009-12-09 08:45:33 by masterm masterm
Quote:
the developers claim it has a really small footprint

A very well chosen logo then:
BB Image
added on the 2009-12-09 09:51:13 by hfr hfr
masterm: Did you try xcb-glx? All I managed to get is a black window :/ The other frustrating/uncool things about xcb are that you have nothing like glXChooseVisual so you have to do it by hand, and xcb_wait_for_event and friends returns a pointer to an event allocated on the heap.

Back to the minimal framework. By looking at the xcb sourcecode ([1] [2]) it seems that some kind of brutal packet replayer is possible. Maybe that's what viznut is doing.
added on the 2009-12-09 11:17:14 by MooZ MooZ
Does Xlib provide access to sound system?

SDL provides access to all multimedia systems (sound, graph and more) - it is important in linux os, because there are everything apart.
added on the 2009-12-09 11:39:55 by krzyzan krzyzan
krzyzan: I would suggest googling for Xlib before randomly talking on it… Gosh, if you are going to sink something into mud know what it does FIRST. and you seriously don't need SDL for sound on Linux as sigflup aforementioned and showed it can be handled pretty simply.
added on the 2009-12-09 12:10:37 by decipher decipher
Halt! Pants off :)

Decipher: It was just a rethorical question. Xlib dosn't support sound system at all, because it was not developed for that.

Of course, there are another systems (for sound only) as ALSA, etc. But it means that you have to pay attention to install it.

Better way is just install SDL once and making intros.
added on the 2009-12-09 12:28:02 by krzyzan krzyzan
krzyzan: Opening /dev/dsp and outputting data is faster and smaller than setting up audio with SDL. Get over it.
What is with this "How can I do X using Y?" "Use Z" attitude. It seriously is becoming annoying. "Better way" is not "just install"ing SDL. Better way is to do it the way one wishes. This is seriously irritating now, then why don't you guys all tell C64 coders to stop coding on C64 because "PC can do it faster and it provides more features"?
added on the 2009-12-09 13:01:54 by decipher decipher
Decipher: Don't teach your grandmother to suck eggs :)

better way is just 'make simpler'. I am familiar with /dev/dsp, but it is good for small intros, like 512b (but it is top secret now, hehe).

SDL is just correct way when you try to make intro with graphs and sounds for linux. Please ask sp3c (linux guru) for more.
added on the 2009-12-09 13:17:54 by krzyzan krzyzan
SDL is not standardized. hence it is not correct. if SDL was standardized on Linux today we wouldn't be having this discussion as Iq's Linux distro would have been featuring the fucking SDL already.

Also, sometimes when grandmas get old they tend to lose their abilities they had when they were younger. Just so you know.
added on the 2009-12-09 13:22:45 by decipher decipher
decipher: also, when people grow up, they get social skills.. good luck with yours!
added on the 2009-12-09 13:30:43 by dv$ dv$
Quote:
What is with this "How can I do X using Y?" "Use Z" attitude. It seriously is becoming annoying.


Too right... L O LLLSSS

http://www.pouet.net/topic.php?which=6827
hey, iq - i suggest that you use windows. it's much easier to find easy tutorials on that!



</lousy-joke>
what makes you sound even smarter than giving the answer? telling someone their WHOLE APPROACH is wrong!
added on the 2009-12-09 14:31:30 by smash smash
dudes, please pay attention that creativity isnt't the same as 'eating shit'

:)

btw. These efforts leads to create new SDL layer...
added on the 2009-12-09 14:35:38 by krzyzan krzyzan
smash: Nobody knows answer, but a lot of people can give advices. It could help you to understand subject a bit more, or not.
added on the 2009-12-09 14:43:01 by krzyzan krzyzan

login

Go to top