Page 1 of 1

PB and OpenGL calls

Posted: Fri May 02, 2014 1:43 am
by juankprada
Hello everybody!,

I am looking for a way to call OpenGL functions directly from PB. I really dont know how to achieve that and I couldnt really find anything useful on the forums that lead me in the right direction. So, does anyone know how to make this?

I know there must be a way as OpenGL is used eventually when rendering something on screen (at least in Linux and Mac by default) So I would like to know how to do that myself.

Thanks

Re: PB and OpenGL calls

Posted: Fri May 02, 2014 1:16 pm
by IdeasVacuum
Luis has an excellent post on OpenGL: OpenGL framework

Re: PB and OpenGL calls

Posted: Fri May 02, 2014 2:46 pm
by applePi
thats a great demos from luis, i have tried it now for PB 5.22 LTS , but for me i should comment the lines:
With G_lstAvailRes()
\flgCurrent = #True
PokeL(*MaxX, \lcSizeX)
PokeL(*MaxY, \lcSizeY)
EndWith
and then it will work okay.
this is in windows xp /32bit
and if you want easier way to use opengl look the glfw wrapper http://purebasic.fr/english/viewtopic.php?f=40&t=57875

there is also an example in "C:\PureBasic\Examples\Sources - Advanced\OpenGL Cube"