Recent

Author Topic: [ANN] GLScene for Lazarus 1.6.2 and up  (Read 11771 times)

BeanzMaster

  • Sr. Member
  • ****
  • Posts: 268
[ANN] GLScene for Lazarus 1.6.2 and up
« on: May 06, 2017, 07:59:09 pm »
Hi to all, i updated GLScene Component Package. It's now compatible with Lazarus 1.6.2 and up and FPC 3.0.0 and up

You can download the lastest release of GLSceneLCL for Lazarus

From the page http://sourceforge.net/projects/glscene/files/ as archive file. Select Branch->GLSceneLCL
or
From current SVN version of GLScene from the URL of repository https://svn.code.sf.net/p/glscene/code/branch/GLSceneLCL

Follow instruction in GLSceneLCL\Installation folder for installation

NOTE :
Just one thing don't compile  packages : GLScene_Bass, GLScene_FMod, GLScene_ODE, GLScene_NGD, GLScene_CgShader at this time.
You can try, but  not sure there work at 100%

If you have any questions or for reporting bugs. You can  go on our dedicated forum  https://sourceforge.net/p/glscene/discussion/lazarus/

Cheers
« Last Edit: May 06, 2017, 08:03:02 pm by BeanzMaster »

Handoko

  • Hero Member
  • *****
  • Posts: 5122
  • My goal: build my own game engine using Lazarus
Re: [ANN] GLScene for Lazarus 1.6.2 and up
« Reply #1 on: May 08, 2017, 03:27:00 pm »
Thank you for the update and info.

Does it support Linux? I found no Linux thing in GLScene sourceforge project folder:
Home / GLScene / GLScene v1.5

And the svn link does not work.

BeanzMaster

  • Sr. Member
  • ****
  • Posts: 268
Re: [ANN] GLScene for Lazarus 1.6.2 and up
« Reply #2 on: May 14, 2017, 08:07:59 pm »
Hi

I've no tested under Linux but normally GLSceneLCL must work.

For SVN try https://svn.code.sf.net/p/glscene/code/branches/GLSceneLCL

Handoko

  • Hero Member
  • *****
  • Posts: 5122
  • My goal: build my own game engine using Lazarus
Re: [ANN] GLScene for Lazarus 1.6.2 and up
« Reply #3 on: May 21, 2017, 03:27:39 pm »
Tested the svn but failed. I use Ubuntu 16.10 64-bit.

I noticed the path and file name are not correct. See img1, it used lower case "resources", but the actually name is "Resources". Linux is case sensitive.

Okay, I can fix that issue. Now, I read and follow the installation instruction. I compiled the GLScene_Runtime without problem, the next thing is  GLScene_OpenAL. But it failed saying it cannot find "GlFileX", see img2.

BeanzMaster

  • Sr. Member
  • ****
  • Posts: 268
Re: [ANN] GLScene for Lazarus 1.6.2 and up
« Reply #4 on: May 21, 2017, 04:02:03 pm »
Hi to all

 i've updated GLSCENE

- Updated for Lazarus 1.80 RC1
- Remove many compilator Warning and replaced some deprecated procedures
- Little Cosmetics refunds
- Removed many Delphi Prepocessor and  reference for better multiplatforms compatibility
- Removed GR32 support (not working under Lazarus and FPC)
- Updated Samples demos (ShadowVolume, Subdivide, SkyBox, Procedural)
- Added More demos in Examples /SceneObjects/FreeForm,  /Editors

https://svn.code.sf.net/p/glscene/code/branches/GLSceneLCL


Thanks Handoko, I'll take look this day  8-)

Handoko

  • Hero Member
  • *****
  • Posts: 5122
  • My goal: build my own game engine using Lazarus
Re: [ANN] GLScene for Lazarus 1.6.2 and up
« Reply #5 on: June 21, 2017, 05:42:55 pm »
After deep investigation, I managed to install GLScene in my Lazarus 1.6.4 64-bit Ubuntu 16.10 machine. Here I want to report what I found, hope it can be useful for others.

This bug hunting was performed on svn 7052, downloaded from:
https://svn.code.sf.net/p/glscene/code/branches/GLSceneLCL/

1. Error 232

What error 232 is, I don't know. After I installed GLScene, I tried to open some examples that come from the GLScene. None of them worked. Some of them require Windows unit, the remain showed error 232. Please see the attached image.

Not much info can be found on the web. Googling the Internet, I found only thread related 232 error:
http://wiki.freepascal.org/Lazarus_Faq#When_I_run_a_program_with_threads_I_get_runtime_error_232

2. GlFileX.pas ---> GLFileX.pas

Linux file system is case sensitive. Please change the name to the correct one.

Location:
GLScene\Packages\GLScene_RunTime.lpk
Please remove the GlFileX.pas and add the correct one GLFileX.pas.

3. {$I ../../resources/GLSceneObjects.lrs}

Location:
GLScene\Source\Basis\GLObjectManager.pas   line #496

What is wrong:
{$I ../../resources/GLSceneObjects.lrs}
It points to a wrong location, also case sensitivity issue.

It should be:
{$I ../Resources/GLSceneObjects.lrs}

4. {$I ../../resources/GLScene.lrs}

Location:
GLScene\Source\DesignTime\GLSceneRegister.pas   line #1495

What is wrong:
{$I ../../resources/GLScene.lrs}
Again. It points to a wrong location and case sensitivity issue.

It should be:
{$I ../Resources/GLScene.lrs}

5. GlFileX ---> GLFileX

Location:
GLScene\Source\DesignTime\GLSceneRegister.pas   line #163
Please change the unit name GlFileX to the correct one GLFileX.

6. GlFileX ---> GLFileX

Location:
GLScene\Source\FileFormats\GLFileX.pas   line #31
Again, please change the unit name GlFileX to the correct one GLFileX.

7. FGuiSkinEditor ---> FGUISkinEditor

Location:
GLScene\Source\DesignTime\FGUISkinEditor.pas   line #7
Please change the unit name FGuiSkinEditor to the correct one FGUISkinEditor.

8. Remove Windows

Location:
GLScene\Source\DesignTime\FGUISkinEditor.pas   line #15
Please remove the Windows unit, it is useless and makes it fails to compile on Linux.
« Last Edit: June 21, 2017, 06:04:10 pm by Handoko »

Thaddy

  • Hero Member
  • *****
  • Posts: 14157
  • Probably until I exterminate Putin.
Re: [ANN] GLScene for Lazarus 1.6.2 and up
« Reply #6 on: June 21, 2017, 05:49:35 pm »
After deep investigation, I managed to install GLScene in my Lazarus 1.6.4 64-bit Ubuntu 16.10 machine. Here I want to report what I found, hope it can be useful for others.

1. Error 232
User manual,maybe? Appendix D?
232 Threads not supported

Means you have to set IsMultitheaded to true and - apart from windows - use cthreads.
And indeed it IS a threads related issue. GLScene relies heavily on threads.
« Last Edit: June 21, 2017, 05:51:27 pm by Thaddy »
Specialize a type, not a var.

Handoko

  • Hero Member
  • *****
  • Posts: 5122
  • My goal: build my own game engine using Lazarus
Re: [ANN] GLScene for Lazarus 1.6.2 and up
« Reply #7 on: June 21, 2017, 05:57:16 pm »
I don't know. The message only said "Project PickObject raised exception class 'RunError(232)'. It didn't mentioned anything about threads. See can see the image on the previous post.

Thanks Thaddy for the information about error 232. I quote your text again, hope the developer can see it:
232 Threads not supported

Means you have to set IsMultitheaded to true and - apart from windows - use cthreads.
And indeed it IS a threads related issue. GLScene relies heavily on threads.

GLScene, along with BGRABitmap and Castle Game Engine are awesome projects related with graphics. Hope GLScene can fix those issues soon and make it able to use on Linux.
« Last Edit: June 21, 2017, 06:09:53 pm by Handoko »

Handoko

  • Hero Member
  • *****
  • Posts: 5122
  • My goal: build my own game engine using Lazarus
Re: [ANN] GLScene for Lazarus 1.6.2 and up
« Reply #8 on: June 21, 2017, 07:46:46 pm »
It works now. Just as Thaddy said, that really was thread issue.

I found, they hardcoded the directory separator in the examples. But no problem, I can fix it. Now I can have fun with GLScene. :D

But the examples didn't look correctly. Still have minor bugs I guess.
« Last Edit: June 21, 2017, 07:48:32 pm by Handoko »

BeanzMaster

  • Sr. Member
  • ****
  • Posts: 268
Re: [ANN] GLScene for Lazarus 1.6.2 and up
« Reply #9 on: July 16, 2017, 07:44:31 pm »
Hi, Handoko and many thanks for your report. I'm apoligize to not answered before. I'm just see yours posts

Quote
1. Error 232

What error 232 is, I don't know. After I installed GLScene, I tried to open some examples that come from the GLScene. None of them worked. Some of them require Windows unit, the remain showed error 232. Please see the attached image.

Not much info can be found on the web. Googling the Internet, I found only thread related 232 error:
http://wiki.freepascal.org/Lazarus_Faq#When_I_run_a_program_with_threads_I_get_runtime_error_232

Quote
232 Threads not supported

Means you have to set IsMultitheaded to true and - apart from windows - use cthreads.
And indeed it IS a threads related issue. GLScene relies heavily on threads.


I'll investigate. I beleive i say approximatively where is the problem.

Quote
2. Linux file system is case sensitive. Please change the name to the correct one.
3. {$I ../../resources/GLSceneObjects.lrs}
4. {$I ../../resources/GLScene.lrs}

I'll rename all files in lowercase.

Quote
5. GlFileX ---> GLFileX

Location:
GLScene\Source\DesignTime\GLSceneRegister.pas   line #163
Please change the unit name GlFileX to the correct one GLFileX.

6. GlFileX ---> GLFileX

Location:
GLScene\Source\FileFormats\GLFileX.pas   line #31
Again, please change the unit name GlFileX to the correct one GLFileX.

7. FGuiSkinEditor ---> FGUISkinEditor

Location:
GLScene\Source\DesignTime\FGUISkinEditor.pas   line #7
Please change the unit name FGuiSkinEditor to the correct one FGUISkinEditor.

8. Remove Windows

Location:
GLScene\Source\DesignTime\FGUISkinEditor.pas   line #15
Please remove the Windows unit, it is useless and makes it fails to compile on Linux.

Ok, for all theses reports. I' ll do the changes, and a major update when Lazarus 1.8 will be out.

Thanks again

Best regards


[EDIT] :
Quote
But the examples didn't look correctly. Still have minor bugs I guess.

Yes some problems with bitmap, a part, is due to conversion with Delphi  and the othersTBitmap in Lazarus have many bugs and not working properly Best soluton actually is to work with TFPCustomImage's classes.
At this time i'm writing a complete and totally indepenant very fast bitmap management solution(not based on TFPCustomImage or TLazIntfImage) . In a near future it will completely replace TBitmap and all Graphics32 references.









« Last Edit: July 16, 2017, 07:57:45 pm by BeanzMaster »

dicepd

  • Full Member
  • ***
  • Posts: 163
Re: [ANN] GLScene for Lazarus 1.6.2 and up
« Reply #10 on: August 16, 2017, 09:24:17 am »
Hi,

Wanting to upgrade my GLScene and lazarus versions I have dived in at the deep end with 1.8rc4 and fpc3.0.4rc1 on Linux 64 bit. I previously had to use windows and 32 bit to get my program working. I will try to report any other issues I encounter that have not been mentioned here.

Will update this post as I go along.

Issue 1.

GLCrossPlatform requires the LazUTF8 unit to be added to the uses clause.

Issue 2.
FGuiSkinEditor has Windows in uses section. Commenting out enables GLSceneDesignTime to compile.

Issue 3.
FGuiSkinEditor unit name does not match FGUISkinEditor.pas filename leading to ppu not found when trying to install DesignTime.


Mostly everything worked after this.

However most of the samples are flawed if they use the MediaPath global in GLUtils as this lowercases the path and thus media files are never found.

For sample projects in the Examples directory most of these are missing
Code: Pascal  [Select][+][-]
  1.   {$IFDEF UNIX}{$IFDEF UseCThreads}
  2.   cthreads,
  3.   {$ENDIF}{$ENDIF}    
  4.  
 
in the program file (.lpr).   


Peter
« Last Edit: August 17, 2017, 09:16:38 pm by dicepd »
Lazarus 1.8rc5 Win64 / Linux gtk2 64 / FreeBSD qt4

dicepd

  • Full Member
  • ***
  • Posts: 163
Re: [ANN] GLScene for Lazarus 1.6.2 and up
« Reply #11 on: August 17, 2017, 08:46:03 pm »
Fix for the media dir bug in GLUtils

In
Function SetGLSceneMediaDir:string;

change
Code: Pascal  [Select][+][-]
  1.    path := lowercase(ExtractFilePath(ParamStr(0)));
  2.    p := Pos('samples', path);
  3.  

to

Code: Pascal  [Select][+][-]
  1.    path := ExtractFilePath(ParamStr(0));
  2.    p := Pos('samples', lowercase(path));
  3.  

Tested in Win7 64 bit and Linux 64 bit


Peter
« Last Edit: August 17, 2017, 08:50:55 pm by dicepd »
Lazarus 1.8rc5 Win64 / Linux gtk2 64 / FreeBSD qt4

BeanzMaster

  • Sr. Member
  • ****
  • Posts: 268
Re: [ANN] GLScene for Lazarus 1.6.2 and up
« Reply #12 on: August 17, 2017, 11:54:46 pm »
Hi, Peter

Hi,

Wanting to upgrade my GLScene and lazarus versions I have dived in at the deep end with 1.8rc4 and fpc3.0.4rc1 on Linux 64 bit. I previously had to use windows and 32 bit to get my program working. I will try to report any other issues I encounter that have not been mentioned here.

Will update this post as I go along.

Issue 1.

GLCrossPlatform requires the LazUTF8 unit to be added to the uses clause.

Fixed

Issue 2.
FGuiSkinEditor has Windows in uses section. Commenting out enables GLSceneDesignTime to compile.

Issue 3.
FGuiSkinEditor unit name does not match FGUISkinEditor.pas filename leading to ppu not found when trying to install DesignTime.

Yes, but anyway GuiSkinEditor is heavy bugged. Bugs provide from the conversion between the Delphi's TBitmap and the Lazarus's TBitimap. I currently working on a fast bitmap management for replacing TBitmap.

Mostly everything worked after this.

However most of the samples are flawed if they use the MediaPath global in GLUtils as this lowercases the path and thus media files are never found.

For sample projects in the Examples directory most of these are missing
Code: Pascal  [Select][+][-]
  1.   {$IFDEF UNIX}{$IFDEF UseCThreads}
  2.   cthreads,
  3.   {$ENDIF}{$ENDIF}    
  4.  
 
in the program file (.lpr).   
Peter
I'll check. Have tou the name of the demos ? I'll can do the changes more quickly  8)

Fix for the media dir bug in GLUtils

In
Function SetGLSceneMediaDir:string;

change
Code: Pascal  [Select][+][-]
  1.    path := lowercase(ExtractFilePath(ParamStr(0)));
  2.    p := Pos('samples', path);
  3.  

to

Code: Pascal  [Select][+][-]
  1.    path := ExtractFilePath(ParamStr(0));
  2.    p := Pos('samples', lowercase(path));
  3.  

Tested in Win7 64 bit and Linux 64 bit

Peter
I don't understand why not work ? The only difference is the position of the " lowercase function". But i trust you. Is fixed  8-)

Thanks for your report Peter.

I'll update repo when Lazarus 1.8 will out.

Best regards

dicepd

  • Full Member
  • ***
  • Posts: 163
Re: [ANN] GLScene for Lazarus 1.6.2 and up
« Reply #13 on: August 18, 2017, 12:19:02 am »

I don't understand why not work ? The only difference is the position of the " lowercase function". But i trust you. Is fixed  8-)


In the original code the path variable which is eventually assigned to MediaPath is lowercased. In the modified code a lowercased copy of the path is searched and path retains its case.

Peter
« Last Edit: August 18, 2017, 12:25:19 am by dicepd »
Lazarus 1.8rc5 Win64 / Linux gtk2 64 / FreeBSD qt4

BeanzMaster

  • Sr. Member
  • ****
  • Posts: 268
Re: [ANN] GLScene for Lazarus 1.6.2 and up
« Reply #14 on: August 18, 2017, 02:17:12 am »

In the original code the path variable which is eventually assigned to MediaPath is lowercased. In the modified code a lowercased copy of the path is searched and path retains its case.

Peter

Ouch, ok i understand, i don't take care of that. Due of i never changed the folder name.

Thanks

 

TinyPortal © 2005-2018