Recent

Author Topic: Lazarus translation of opengl12.pas  (Read 6928 times)

Andyk

  • Jr. Member
  • **
  • Posts: 65
Lazarus translation of opengl12.pas
« on: June 27, 2012, 08:21:33 pm »

I used the interface with delphi and I have a number of visual components which use it.

The file works as is with Lazarus on windows but not under Linux.

Has anyone written a cross platform version ?

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 10399
  • FPC developer.
Re: Lazarus translation of opengl12.pas
« Reply #1 on: June 27, 2012, 08:35:46 pm »
Why not simply use the opengl unit that comes with FPC/Lazarus?

Andyk

  • Jr. Member
  • **
  • Posts: 65
Re: Lazarus translation of opengl12.pas
« Reply #2 on: June 27, 2012, 08:44:44 pm »
Why not simply use the opengl unit that comes with FPC/Lazarus?

Which one ?

I have a number of components including charts and pcb layout tools that render in both 2D and 3D on the same canvas.

It was easy to do with opengl12.pas, I'm not sure how to integrate the lazarus versions without completely rewriting everything I already have.

I did try using the GLscene version of the file which is cross platform but there appears to be a number of opengl variable types which FPC doesn't understand, even though it is supposed to be Lazarus compatible.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 10399
  • FPC developer.
Re: Lazarus translation of opengl12.pas
« Reply #3 on: June 27, 2012, 09:02:03 pm »
unit "gl" and the other units that belong to it (check the FPC unit dir and then "opengl")

Note that if your problem is related to calls to wgl* functions, those are often hard to port (they are the windows specific interface between windows and opengl)

Andyk

  • Jr. Member
  • **
  • Posts: 65
Re: Lazarus translation of opengl12.pas
« Reply #4 on: June 27, 2012, 09:21:04 pm »
Well I couldn't even resolve some of the basic types.

But yes, I'm using a lot of wgl functions, many of which converted ok.

The ones which I can't seem to find any equivalents are the ones which render fonts. This may be a problem for me.


marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 10399
  • FPC developer.
Re: Lazarus translation of opengl12.pas
« Reply #5 on: June 27, 2012, 10:32:07 pm »
Well I couldn't even resolve some of the basic types.

Maybe some are not T prefixed or so. Should work fine more or less

Quote
But yes, I'm using a lot of wgl functions, many of which converted ok.

The ones which I can't seem to find any equivalents are the ones which render fonts. This may be a problem for me.

wgluseoutline and wglusebitmap*, yes, those I meant :-)   There are no direct equivalents, usually people go in the direction of freetype to resolve that.

Andyk

  • Jr. Member
  • **
  • Posts: 65
Re: Lazarus translation of opengl12.pas
« Reply #6 on: June 28, 2012, 09:00:43 am »
I don't need anything fancy regarding font's. My apps are all scientific and ASCII based, I have no interest in unicode.

I have my own polygon library, I already transcribe each ASCII character into sets of vertex arrays in my Windows version. I guess I can just save these as ASCII files and reload them into the Linux version as pre-calculated polygons and scale them as necessary.

I'm surprised my net trawl didn't turn up any pre calculated fonts for general use.

 

TinyPortal © 2005-2018