xlib residents

Linux specific forum
User avatar
luis
Addict
Addict
Posts: 3895
Joined: Wed Aug 31, 2005 11:09 pm
Location: Italy

xlib residents

Post by luis »

I was looking at the structures in the residents.
There is much GTK stuff, but no xlib stuff.

Is there some way I didn't see to access all that or I have to convert what I need from Xlib.h to PB code ?
And I suppose have to import the various xlib function by myself.

Maybe someone else already did some of this and is willing to share something ?

Just asking before starting a lot of work when maybe I can avoid some :)
"Have you tried turning it off and on again ?"
User avatar
luis
Addict
Addict
Posts: 3895
Joined: Wed Aug 31, 2005 11:09 pm
Location: Italy

Re: xlib residents

Post by luis »

Well, I'll start in the meantime and good luck to me :wink:
"Have you tried turning it off and on again ?"
User avatar
idle
Always Here
Always Here
Posts: 6026
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: xlib residents

Post by idle »

I don't have any xlib includes but I'm curious as to what you need it for?
over come windowed screen issues perhaps ?
Windows 11, Manjaro, Raspberry Pi OS
Image
User avatar
luis
Addict
Addict
Posts: 3895
Joined: Wed Aug 31, 2005 11:09 pm
Location: Italy

Re: xlib residents

Post by luis »

No, I'm just experimenting with opengl for a library I'm making (SGL, I've mentioned it sometime on the forum).
I've made the core part of the library on Windows doing all in PB from scratch, and using a lot of API (hello Chris :mrgreen: ) for the windowing/keyboard/mouse/rendering context parts.
Before going forward I was curious to see If I would be able to do the same for Linux. After some investigations (and experiments) I've decided the best route, equivalent to the one I've used on Windows, was to not rely on GTK (and its X11 wrapped stuff available there) and going straight for xlib.
I hoped to find the residents already in PB but it wasn't the case.
I'm progressing, certainly it's something a lot harder for me to do than under Windows.
I've zero practical experience, and the documentation under Linux doesn't seem comparable to what we have under Win.
Or maybe I'm not enough used to the environment, yet.
Certainly someone with Linux and OpenGL experience could do this faster/better than me but even if I fail I'll end up learning something :)
And I'll try again later !
"Have you tried turning it off and on again ?"
User avatar
idle
Always Here
Always Here
Posts: 6026
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: xlib residents

Post by idle »

Probably easier to take a look at the sources of glfw and freeglut if the xlib documentation isn't clear enough.
Windows 11, Manjaro, Raspberry Pi OS
Image
User avatar
luis
Addict
Addict
Posts: 3895
Joined: Wed Aug 31, 2005 11:09 pm
Location: Italy

Re: xlib residents

Post by luis »

The biggest problem I've found so far is the correct conversion of the structures.
Using GCC a long should be the equivalent of .i , an int should be the equivalent of .l, pointers are all .i, and then 50% of the fields are typedef defined and then redefined and then redefined again and you have to backtrace them to the source, then there is the right alignment to consider.
Probably I'll have to use GCC in parallel to verify my assumptions...
This part it's not a lot of fun.
"Have you tried turning it off and on again ?"
User avatar
idle
Always Here
Always Here
Posts: 6026
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: xlib residents

Post by idle »

yes the typedefs can be a pain when there's multiple redefinitions
Windows 11, Manjaro, Raspberry Pi OS
Image
User avatar
luis
Addict
Addict
Posts: 3895
Joined: Wed Aug 31, 2005 11:09 pm
Location: Italy

Re: xlib residents

Post by luis »

UPDATE -> Oh yeah !

Two things:
Align #PB_Structure_AlignC
It's really a time saver. Fred thank you very much for adding it (and to everyone requesting it).

And second: I've just witnessed a window popping out from nowhere, with a rendering context and a nice GL triangle on it and with some minimal event processing already in place !

All created from zero using just Xlib and nothing else, not a bad start considering I've started looking at Xlib 48 hours ago :wink:

yippie-kai-yay !
"Have you tried turning it off and on again ?"
Post Reply