glGetString

Linux specific forum
User avatar
Guimauve
Enthusiast
Enthusiast
Posts: 742
Joined: Wed Oct 22, 2003 2:51 am
Location: Canada

glGetString

Post by Guimauve »

Hello everyone,

Can some one tell me why this little OpenGL code don't work :

Code: Select all

#GL_VENDOR = $1F00 
#GL_RENDERER = $1F01 
#GL_VERSION = $1F02 
#GL_EXTENSIONS = $1F03 

ImportC "/usr/lib/libGL.so"
; ImportC "/usr/lib64/libGL.so"
    
  glGetString(Name.l) 
  glGetError()
  
EndImport 
  
Debug #GL_VENDOR
Debug #GL_RENDERER
Debug #GL_VERSION
Debug #GL_EXTENSIONS
  
Debug ""
  
Debug glGetString(#GL_VENDOR) 
Debug glGetString(#GL_VERSION)
Debug glGetString(#GL_RENDERER)
Debug glGetString(#GL_EXTENSIONS)
Linux Ubnutu 9.10 x64

Best Regards

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

Re: glGetString

Post by luis »

Opengl functions cannot work until you bind a rendering context to the current thread, with wglMakeCurrent() under Windows and if I recall correctly with glXMakeContextCurrent() under Linux.
"Have you tried turning it off and on again ?"
Fred
Administrator
Administrator
Posts: 18350
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: glGetString

Post by Fred »

You can use Open(Windowed)Screen() of the OpenGL subsystem to initialize the context easily, and you should be able to use the GL functions after that.
User avatar
Guimauve
Enthusiast
Enthusiast
Posts: 742
Joined: Wed Oct 22, 2003 2:51 am
Location: Canada

Re: glGetString

Post by Guimauve »

For the moment I use SDL library to manage the screen, Keyboard, mouse and Joystick (5 axis, 32 buttons) inputs. As far as I know PureBasic use the SDL Library so my code should work but I have to learn how to manage screen and render scene properly. And to be honnest my knowledge about this is nearly zero. My knowledge about 3D in general (graphic and physics) are good enough to create 3D game.

BTW, sorry Fred but for my project I will not use the PB internal game library.

Best regards.
Guimauve
Foz
Addict
Addict
Posts: 1359
Joined: Tue Nov 13, 2007 12:42 pm
Location: Manchester, UK

Re: glGetString

Post by Foz »

Fred wrote:You can use Open(Windowed)Screen() of the OpenGL subsystem to initialize the context easily, and you should be able to use the GL functions after that.
Now that is a snippet of information that is HIGHLY useful. I have been searching high and low on a simple method of getting an opengl window that I can use.

Thanks Fred! :D
User avatar
Guimauve
Enthusiast
Enthusiast
Posts: 742
Joined: Wed Oct 22, 2003 2:51 am
Location: Canada

Re: glGetString

Post by Guimauve »

Fred wrote:You can use Open(Windowed)Screen() of the OpenGL subsystem to initialize the context easily, and you should be able to use the GL functions after that.
I get a Linker error

/usr/bin/id : cannot find -lXxf86vm
collect2: id returned 1 exit status

Linux Ubuntu 9.10 x64
PB 4.41

Best regards.
Guimauve
Foz
Addict
Addict
Posts: 1359
Joined: Tue Nov 13, 2007 12:42 pm
Location: Manchester, UK

Re: glGetString

Post by Foz »

you need to install the library libxxf86vm & the dev package to go with it
User avatar
Guimauve
Enthusiast
Enthusiast
Posts: 742
Joined: Wed Oct 22, 2003 2:51 am
Location: Canada

Re: glGetString

Post by Guimauve »

markiecork wrote:Have you try to use the library libxxf86vm & the dev package to go with it.
Did you solve the error?
Not Yet !

I'm very busy right now, so I don't have time work on this project, sorry.

Best regards.
Guimauve
Post Reply