Recent

Author Topic: How to use OpenGl  (Read 9253 times)

3Ducker

  • Newbie
  • Posts: 5
How to use OpenGl
« on: June 13, 2013, 03:46:17 pm »
I'd like to use opengl under lazarus. I tried to use glut unit after placed glut.dll to syswow64, but it doesn't work. If I run the programme with unit glut, there's a debugger expection notification with "Couldn't load glut32.dll. What is the problem?

Leledumbo

  • Hero Member
  • *****
  • Posts: 8835
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: How to use OpenGl
« Reply #1 on: June 13, 2013, 04:05:49 pm »
What's your system bitness? And where do you get the glut.dll from? In 32-bit system, the library should be glut32.dll (and perhaps it's hardcoded in the glut wrapper, haven't checked) and it can be put in the same folder as the executable or anywhere in PATH.

3Ducker

  • Newbie
  • Posts: 5
Re: How to use OpenGl
« Reply #2 on: June 13, 2013, 04:07:08 pm »
I'm have 64bit windows 7

Leledumbo

  • Hero Member
  • *****
  • Posts: 8835
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: How to use OpenGl
« Reply #3 on: June 13, 2013, 04:14:53 pm »
Seems like the dll name is still glut32.dll on 64-bit systems. Assuming your program is also 64-bit, you may put the dll along with the exe or in system32. syswow64 is for 32-bit dlls.

3Ducker

  • Newbie
  • Posts: 5
Re: How to use OpenGl
« Reply #4 on: June 13, 2013, 04:26:13 pm »
If I think what you think it still doesn't work.

User137

  • Hero Member
  • *****
  • Posts: 1791
    • Nxpascal home
Re: How to use OpenGl
« Reply #5 on: June 13, 2013, 04:48:27 pm »
Did you also try placing it in application folder?

3Ducker

  • Newbie
  • Posts: 5
Re: How to use OpenGl
« Reply #6 on: June 13, 2013, 04:52:51 pm »
Yes, but doesn't work.

User137

  • Hero Member
  • *****
  • Posts: 1791
    • Nxpascal home
Re: How to use OpenGl
« Reply #7 on: June 13, 2013, 05:04:48 pm »
Look in the GL related .pas files. Somewhere at the top of them should be path to glut32.dll. You want to know if there's something like 'lib\glut32.dll' instead, or other path to it.

Second thing that comes to mind, is that your glut32.dll would somehow be corrupted or wrong version.

Oh well, i've used OpenGL for years and never needed glut. You can try dglOpenGL header specifically made for pascal. 1 file that contains everything needed, supports OpenGL 4.3 and works crossplatform on both 32 and 64 bit systems, and on Delphi aswell.
« Last Edit: June 13, 2013, 05:06:51 pm by User137 »

3Ducker

  • Newbie
  • Posts: 5
Re: How to use OpenGl
« Reply #8 on: June 13, 2013, 05:08:03 pm »
It is work on Free Pascal or Lazarus? Or only in Delphi.

User137

  • Hero Member
  • *****
  • Posts: 1791
    • Nxpascal home
Re: How to use OpenGl
« Reply #9 on: June 13, 2013, 06:58:47 pm »
Yes it works fine with Lazarus (i said Delphi aswell). I use it along with TOpenGLContext. My game engine does window init here:
https://code.google.com/p/nxpascal/source/browse/trunk/src/nxGL.pas#869

 

TinyPortal © 2005-2018