Page 1 of 2

Critical: OpenGL API access in linux

Posted: Mon Apr 25, 2005 12:20 am
by dracflamloc
I had no idea that the OpenGL api was not available in linux pb. Its pretty ridiculus.

Please fred. Get this in ASAP.
No Sprite3d, no OpenGL... what am I supposed to use?

Posted: Mon Apr 25, 2005 10:07 am
by Polo
Opengl functions are quite easy to call...
But unfortunately creating a rendering context is really hard, that's why i've stopped linux for the moment...
And also I don't really like the fact that Purebasic is using external library such as sdl and gtk...

Posted: Mon Apr 25, 2005 10:37 am
by Inner
what? gtk sdl? pardon!? .. sorry very shocked.. what is he supposed to do re-write the entire of DirectX for windows and the WinAPI while he is at it? or have I gotten the wrong impression from your statements, please set me right?

Posted: Mon Apr 25, 2005 10:48 am
by Polo
On Windows, he's using the Windows API, he could also have used GTK and SDL but he (hopefully) haven't done it (i wouldn't be using it if he had so)
On Linux, he is using GTK and SDL, instead of using Linux API and OpenGL. Which require to install third parties .so libraries.
That's why I don't really like the linux version. Hopefully, according to what i've seen, he won't do this mistake on the mac version ;)

Posted: Mon Apr 25, 2005 2:47 pm
by dracflamloc
Ah screw it I'm just going back to C++

Posted: Mon Apr 25, 2005 6:30 pm
by Polo
BTW, I've noticed something strange: I managed, using a Purebasic Library, to create an OpenGL Context. The only matter is that we can't use PB's Windows, we must use the api to create one. I've tried with Pb's one and i get an error. I'm sure it's GTK's related ;)

Posted: Mon Apr 25, 2005 6:36 pm
by dracflamloc
Interesting... mind posting your code?

Posted: Mon Apr 25, 2005 7:31 pm
by Polo
Wait... I've got a good idea ;)
Maybe I'll do, if i manage to do that, a library that wrap the whole OpenGL commands for linux, with a few functions that i'll have added ;)

Posted: Mon Apr 25, 2005 8:13 pm
by dracflamloc
Well I'd still like to know how you managed to do it if you don't mind. If you'd like I can help you out too.

I just prefer to learn how to do something over just using someone else's lib.

Posted: Mon Apr 25, 2005 8:29 pm
by Polo
http://nehe.gamedev.net/counter.asp?fil ... glx.tar.gz

I more or less did a copy/paste of this ;)

Posted: Mon Apr 25, 2005 8:39 pm
by dracflamloc
Link doesnt work, how'd you go about getting that code.

[edit]nevermind i found it.

Posted: Mon Apr 25, 2005 8:50 pm
by dracflamloc
I'm still considering just using SDL in C++ though. I guess I'll have to try out both in pb and C++ before i decide which to go with. Theres benefits to both. Have you tried creating a separate PB window using the native pb commands and gadgets? I want a main game window and then a normal window with buttons and readouts, etc...

Posted: Mon Apr 25, 2005 9:05 pm
by Polo
You shouldn't use sdl ;) I hate third parties libraries ;)
Anyway, I still don't manage to do OpenGL on GTK Windows...
What I'm nearly sure is that OpenWindow PB's command return GTK handle, and not the API handle... It seems to get the XWindow handle of the PB's window we should just do PeekL(WindowID()+8)... But it's not working for OpenGL it seems....
I just think it's not possible to do OpenGL with a "normal" GTK window...
I hate GTK more and more now :)

Posted: Mon Apr 25, 2005 9:15 pm
by Polo
Could you test this :
http://gtnsoft.free.fr/OpenGL
You should see a black window for exactly 2 seconds ;)
Done with Purebasic, but unfortunately... It's an XWindow, so there's not way to handle Window events (well, not with the PB's functions...)

Why Fred has choosen GTK :cry: :cry: :cry:

Posted: Tue Apr 26, 2005 3:03 am
by dracflamloc
Weird....could you try global event handling and then just check to see if your xwindow has focus?