Recent

Author Topic: [ May be Solved] Problem installing GLscene  (Read 13677 times)

BlueIcaro

  • Hero Member
  • *****
  • Posts: 737
    • My github
[ May be Solved] Problem installing GLscene
« on: September 17, 2011, 01:22:25 am »
Hello, I download the last GLscene SVN, but I got he followings errors:
Quote
C:\lazarus\components\Glscne\Source\GLSceneForm.pas(722,29) Error: Identifier not found "GetDesigningBorderStyle"
C:\lazarus\components\Glscne\Source\GLSceneForm.pas(738,29) Error: Identifier not found "GetDesigningBorderStyle"
C:\lazarus\components\Glscne\Source\GLSceneForm.pas(750,41) Error: Identifier not found "GetDesigningBorderStyle"
C:\lazarus\components\Glscne\Source\GLSceneForm.pas(751,35) Error: Identifier not found "BorderStyleToWin32Flags"
C:\lazarus\components\Glscne\Source\GLSceneForm.pas(758,50) Error: Identifier not found "BorderStyleToWin32FlagsEx"
C:\lazarus\components\Glscne\Source\GLSceneForm.pas(773,41) Error: Identifier not found "GetDesigningBorderStyle"
C:\lazarus\components\Glscne\Source\GLSceneForm.pas(774,64) Error: Identifier not found "BorderStyleToWin32Flags"
C:\lazarus\components\Glscne\Source\GLSceneForm.pas(775,37) Error: Identifier not found "BorderStyleToWin32FlagsEx"
C:\lazarus\components\Glscne\Source\GLSceneForm.pas(879, stopping

I was "surfing" into the Lazarus's code, and I found that GetDesingningBorderStyle is a function, into Win32WsForm, but If I put this unit, into uses clause, I got a error that says: "Duplicate unit".  SO I think it's no a problem about a missing unit into uses line.

Any idea?

Thanks in advance.
« Last Edit: September 17, 2011, 04:45:46 pm by BlueIcaro »

Leledumbo

  • Hero Member
  • *****
  • Posts: 8494
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Problem installing GLscene
« Reply #1 on: September 17, 2011, 06:01:33 am »
Please post the unit's uses clause, in both interface and implementation section.

BlueIcaro

  • Hero Member
  • *****
  • Posts: 737
    • My github
[Solved] Problem installing GLscene
« Reply #2 on: September 17, 2011, 02:25:00 pm »
Please post the unit's uses clause, in both interface and implementation section.
Hello, Thanks Leledumbo for your answer. But I solved the problem by my self.
I delete the folder with the glscene files, copy into the folder a fresh files.

I think my problem, was that I download some svn versions from svn glscene version, also I mixed files from diferences versions.

But, I got a error, Compilers says: "Could not determine the overload functions", in a VectorGeometry function into VectorGeometry file.

The error:
Quote
C:\lazarus\components\Glscne\Source\Base\VectorGeometry.pas(3803,32) Error: Can't determine which overloaded function to call
The line was in the
Code: Pascal  [Select][+][-]
  1. function InterpolatePower(const Start, Stop, Delta: Single; const DistortionDegree: Single): Single;
  2. (...)
  3. Result := (Stop - Start) * VectorGeometry.Power(Delta, Round(DistortionDegree)) + Start
  4. (...)
  5.  
So I changed the line  for this one
Code: Pascal  [Select][+][-]
  1. Result := (Stop - Start) * Math.Power(Delta, Round(DistortionDegree)) + Start
  2.  

And Now I can install the Glscene package.

/BlueIcaro.

P.D. I installed Glscene under Lazarus 0.9.31 and FPC 2.5.1
« Last Edit: September 17, 2011, 02:27:07 pm by BlueIcaro »

Leledumbo

  • Hero Member
  • *****
  • Posts: 8494
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: [Solved] Problem installing GLscene
« Reply #3 on: September 17, 2011, 02:52:51 pm »
Glad you made it work. For function power problem, you might want to check VectorGeometry.Power, just to ensure that it doesn't behave differently from Math.Power...

BlueIcaro

  • Hero Member
  • *****
  • Posts: 737
    • My github
Re: [Solved] Problem installing GLscene
« Reply #4 on: September 17, 2011, 04:44:33 pm »
Glad you made it work. For function power problem, you might want to check VectorGeometry.Power, just to ensure that it doesn't behave differently from Math.Power...
Hello Leledumbo, I was looking througth the source, and I find that the function in Glscene returns a Single, and the "Original" functions in Math unit (FPC unit) returns a Float.

Also I found in VectorGeometry unit this line:
Code: Pascal  [Select][+][-]
  1. SysUtils{$ifdef GEOMETRY_NO_ASM}, Math{$endif};
  2.  

So, this is the reason why I must use Math.power to compile. But I read at the begin of the unit,
Quote
  As a general rule, procedures implementations (asm or not) are the fastest
   (up to 800% faster than function equivalents), due to reduced return value
   duplication overhead (the exception being the matrix operations).<p>

   For better performance, it is recommended <b>not</b> to use the "Math" unit
   that comes with Delphi, and only use functions/procedures from this unit
   (the single-based functions have been optimized and are up to 100% faster,
   than extended-based ones from "Math")

Well, I think my solutions it's a "temp" solution.

In VectoryUnit, only there declaration of power function with the overload instruccion. So I still looking for the original definition in Glscene source.

/BlueIcaro

Leledumbo

  • Hero Member
  • *****
  • Posts: 8494
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: [ May be Solved] Problem installing GLscene
« Reply #5 on: September 17, 2011, 07:16:16 pm »
Quote
Well, I think my solutions it's a "temp" solution.
Probably, if you need speed.
Quote
In VectoryUnit, only there declaration of power function with the overload instruccion. So I still looking for the original definition in Glscene source.
Ctrl+Shift+Down or Ctrl+Shift+F if the former finds nothing. Anyway, just the headers are actually OK, we could find out which ones are causing the compiler not to be able to differentiate the parameters.

BlueIcaro

  • Hero Member
  • *****
  • Posts: 737
    • My github
Re: [ May be Solved] Problem installing GLscene
« Reply #6 on: September 17, 2011, 08:04:05 pm »
Another test, If I remove Overload operator from the first declaration, Compiler gives a error, said "All declaration should have overload operator"

/BlueIcaro

Leledumbo

  • Hero Member
  • *****
  • Posts: 8494
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: [ May be Solved] Problem installing GLscene
« Reply #7 on: September 18, 2011, 03:02:55 am »
Quote
Another test, If I remove Overload operator from the first declaration, Compiler gives a error, said "All declaration should have overload operator"
Yes, since GLScene is compiled in Delphi compatibility mode.

BlueIcaro

  • Hero Member
  • *****
  • Posts: 737
    • My github
Re: [ May be Solved] Problem installing GLscene
« Reply #8 on: September 19, 2011, 12:25:45 pm »
Quote
Well, I think my solutions it's a "temp" solution.
Probably, if you need speed.
Quote
In VectoryUnit, only there declaration of power function with the overload instruccion. So I still looking for the original definition in Glscene source.
Ctrl+Shift+Down or Ctrl+Shift+F if the former finds nothing. Anyway, just the headers are actually OK, we could find out which ones are causing the compiler not to be able to differentiate the parameters.

The problem is only in this line:
Result := (Stop - Start) * MAth.VectorGeometry.Power(Delta, Round(DistortionDegree)) + Start 

I change Round(DistortionDegree) for a Integer, and It's compiles. I reading in the web, That Round returns Int64, So This is the problem .

But I don't understant why the original declaration of Power in MAth unit function can Compile.

Quote
power(base,exponent : float) : float;

But I added a new function:
Code: Pascal  [Select][+][-]
  1. (...)
  2.  
  3. Function Power (Base: Single; Exponent: Int64):Single; Overload;
  4.  
  5. (...)
  6. Function Power (Base: Single; Exponent: Int64):Single; Overload;
  7. Begin
  8.   {$ifndef GEOMETRY_NO_ASM}
  9. asm
  10.         mov     ecx, eax
  11.         cdq
  12.         fld1                      { Result:=1 }
  13.         xor     eax, edx
  14.         sub     eax, edx          { eax:=Abs(Exponent) }
  15.         jz      @@3
  16.         fld     Base
  17.         jmp     @@2
  18. @@1:    fmul    ST, ST            { X:=Base * Base }
  19. @@2:    shr     eax,1
  20.         jnc     @@1
  21.         fmul    ST(1),ST          { Result:=Result * X }
  22.         jnz     @@1
  23.         fstp    st                { pop X from FPU stack }
  24.         cmp     ecx, 0
  25.         jge     @@3
  26.         fld1
  27.         fdivrp                    { Result:=1 / Result }
  28. @@3:
  29. {$else}
  30. begin
  31.    {$HINTS OFF}
  32.    Result:=Math.Power(Base, Exponent);
  33.    {$HINTS ON}
  34. {$endif}
  35. end;                
  36.  
I copied it from the original
Quote
function Power(Base: Single; Exponent: Integer): Single;   

And it's works!

/BlueIcaro

P.D. I really like Open Source!!!  :D

ideabrush

  • New Member
  • *
  • Posts: 24
Re: [ May be Solved] Problem installing GLscene
« Reply #9 on: February 07, 2012, 04:17:16 pm »
I'm getting the same error as described in the original post.
I think the problem is that these three functions
GetDesingningBorderStyle(),
BorderStyleToWin32Flags(), and
BorderStyleToWin32FlagsEx()

got removed from win32proc.pp (since Revision 30058) in the LCL source code, which are still being used by GLScene.
The check-in comment of Revision 30058 says these functions are moved to win32wsforms.pp, but I saw that only
GetDesingningBorderStyle() is there, the other two are not.

Should these three functions be put back into the interface of LCL win32? Thanks!

 

TinyPortal © 2005-2018