Forum > OpenGL

GLScene Bug: SetGLSceneMediaDir

(1/1)

Handoko:
I've been interested to explore more about GLScene, but didn't have time for it. Today, using OPM I installed GLScene but almost all the demos and examples failed to run properly.

Where should I report the bug? Here or on GLScene's forum?

The very first bug and the most important one is the name case issue. This below is the original code of SetGLSceneMediaDir in GLUtils.pas, which is buggy:


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---Function SetGLSceneMediaDir:string;var  path: UTF8String;  p: integer;begin   result:='';    // We need to lower case path because the functions are case sensible//   path := lowercase(ExtractFilePath(ParamStrUTF8(0)));   path := lowercase(ExtractFilePath(ParamStr(0)));   p := Pos('samples', path);   Delete(path, p + 7, Length(path));   path := IncludeTrailingPathDelimiter(IncludeTrailingPathDelimiter(path) + 'media');   SetCurrentDir(path);   // SetCurrentDirUTF8(path) -->  NOT WORKING ON W10 64Bits !     // We need to store the result in a global var "MediaPath"     // The function SetCurrentDirUTF8 return TRUE but we are always in the application's folder     // NB These functions provide from LazFileUtils unit and not from deprecated functions in FileUtils unit.    MediaPath:=Path ;   result:=path; end;
Remove the lowercase function and make the S uppercase in 'samples', will make it works on Linux:


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---function SetGLSceneMediaDir:string;var  path: UTF8String;  p: integer;begin   result:='';    path := ExtractFilePath(ParamStr(0));   p := Pos('Samples', path);   Delete(path, p + 7, Length(path));   path := IncludeTrailingPathDelimiter(IncludeTrailingPathDelimiter(path) + 'media');   SetCurrentDir(path);    MediaPath:=Path;   result:=path; end;
Tested on Lazarus 2.0.4 GTK2 Linux-64. I'm not sure what is the version of GLScene. I've just installed it using OPM, it maybe the latest version.

Below is the screenshot, after the bug fix:

BeanzMaster:
Hi Handoko, for reporting it's better on GLScene forum, because i've received automatically notification on new message.
This bug is my fault  :P Because i always forgot Linux is case sensitive and because i'd like to use Camel Case so... thanks for patch. I'll send the change soon as possible

Best regards

Navigation

[0] Message Index

Go to full version