Page 1 of 1

glGetString

Posted: Fri Mar 19, 2010 10:44 pm
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

Re: glGetString

Posted: Fri Mar 19, 2010 11:37 pm
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.

Re: glGetString

Posted: Mon Mar 22, 2010 11:41 am
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.

Re: glGetString

Posted: Wed Mar 24, 2010 4:32 am
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

Re: glGetString

Posted: Sat Mar 27, 2010 12:58 am
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

Re: glGetString

Posted: Sun Mar 28, 2010 2:50 am
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

Re: glGetString

Posted: Sun Mar 28, 2010 7:41 pm
by Foz
you need to install the library libxxf86vm & the dev package to go with it

Re: glGetString

Posted: Thu Apr 22, 2010 3:06 am
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