Page 3 of 4 FirstFirst 1234 LastLast
Results 21 to 30 of 33

Thread: OpenGL command crashing under Lazarus but not Dephi 5

  1. #21

    OpenGL command crashing under Lazarus but not Dephi 5

    Quote Originally Posted by cragwolf
    I have tested the gluUnProject function from both FPC's and JEDI-SDL's glu unit in both Linux and Windows using the latest FPC compiler, and I have not run into any problems. I use the gluUnProject function in the following way:

    [pascal]{**********************************************}
    { Generates a ray based on a window coordinate }
    {**********************************************}
    function GenerateRay(x, y: Integer): TbmRay;
    var
    modelmatrix, projmatrix: T16dArray;
    viewport: TViewPortArray;
    objxn, objyn, objzn, objxf, objyf, objzf: GLDouble;
    begin
    { Get the modelview and projection matrices and the viewport data }
    glGetDoublev(GL_MODELVIEW_MATRIX, @modelMatrix[0]);
    glGetDoublev(GL_PROJECTION_MATRIX, @projMatrix[0]);
    glGetIntegerv(GL_VIEWPORT, @viewport[0]);
    { gluUnProject z=0 for the nearplane; z=1 for the far plane }
    gluUnProject(x, y, 0, modelMatrix, projMatrix, viewport, @objxn, @objyn, @objzn);
    gluUnProject(x, y, 1, modelMatrix, projMatrix, viewport, @objxf, @objyf, @objzf);
    { ray = near + t * (far - near) }
    Result.vStart[0] := objxn; Result.vStart[1] := objyn; Result.vStart[2] := objzn;
    Result.vDel[0] := objxf - objxn; Result.vDel[1] := objyf - objyn; Result.vDel[2] := objzf - objzn;
    end; [/pascal]

    where TbmRay is defined thusly:

    [pascal]TbmVector = array[0..2] of Double;
    TbmRay = record
    vStart: TbmVector;
    vDel: TbmVector;
    end;[/pascal]

    Similarly, I have tested Paul's code with the latest FPC compiler (I used just the glunprojecttest.dpr and sdlapplicationunit.pas files) in both Linux and Windows, and again I have run into no problems.

    So if there is a bug it is either with Lazarus or some aspect of your system.

    Perhaps Michalis can tell us exactly which functions in JEDI-SDL's opengl units are incorrectly declared, so that we can test that and fix them if necessary. This would be a good thing to get right for the 1.0 release.
    When you say you tested it using the latest FPC compiler, does that include the one under Lazarus 0.9.18?

    That is what I am using. I know theoretically it should be the same, but perhaps there are some differences...

    Quote Originally Posted by cragwolf
    (I used just the glunprojecttest.dpr and sdlapplicationunit.pas files)
    EDIT: wait a minute, does this mean you used the GLU and GL files that come with FPC and not the ones that I supplied?

    It so, then those DON'T have any issues what so ever...

    cheers,
    Paul.

  2. #22

    OpenGL command crashing under Lazarus but not Dephi 5

    Quote Originally Posted by paul_nicholls
    When you say you tested it using the latest FPC compiler, does that include the one under Lazarus 0.9.18?
    I don't know what Lazarus 0.9.18 uses, because I don't use Lazarus.

    Quote Originally Posted by paul_nicholls
    Quote Originally Posted by cragwolf
    (I used just the glunprojecttest.dpr and sdlapplicationunit.pas files)
    EDIT: wait a minute, does this mean you used the GLU and GL files that come with FPC and not the ones that I supplied?
    I tested your demo with the GL and GLU files that come with FPCv2.0.4, and I tested it with the GL and GLU files that come with JEDI-SDLv1.0 (beta). Your GL and GLU units seem to come from JEDI-SDL, although I'm not sure which version of JEDI-SDL.
    [size=10px]"In science one tries to tell people, in such a way as to be understood by everyone, something that no one ever knew before. But in poetry, it's the exact opposite." -- Paul Dirac[/size]

  3. #23

    OpenGL command crashing under Lazarus but not Dephi 5

    From my experience, jedi-sdl was never tested enough with FPC. That's why I assumed that making jedi-sdl GL/GLU units compatible with FPC is a waste of time, since FPC distribution already provides these units too. So I was satisfied with GL/GLU units working under Delphi/Kylix, providing compatible layer to FPC GL/GLU units.

    However, I'm glad to know that you want to make jedi-sdl GL/GLU units compatible with FPC. I'll diff GL/GLU jedi-sdl and FPC units and will submit a patch soon with any necessary corrections to jedi-sdl. I will also patch FPC units to include GL 2.0 updates in jedi-sdl glext unit, I wanted to do this since a long time anyway. So FPC and jedi-sdl units will get synched.

    cragwolf: I can't explain why you can't reproduce the problem with Windows and compiling with FPC using jedi-sdl glu unit... I would double-check that you're indeed using the jedi-sdl glu, not the one supplied with FPC (as the one supplied with FPC will work, we know this). As for Lazarus 0.9.18: it includes exactly FPC 2.0.4.

  4. #24

    OpenGL command crashing under Lazarus but not Dephi 5

    I just would like to add that it does not matter if modelMatrix, projMatrix and viewport variables of gluUnProject are declared as var or const. But removing even one of those modifiers causes program to crush on win32 (XP). I tested it on FPC 2.0.2 and 2.0.4 with and without Lasarus (0.9.14).

  5. #25

    OpenGL command crashing under Lazarus but not Dephi 5

    We have been testing under FPC for about 4 years now . I do all the linux tests under Free Pascal as I don't have Kylix. What we need are more examples with which to test stuff (or a comprehensive set of unit tests, but who has the time for that ).

    As for the GL/GLU changes, bear in mind that we get our headers from http://www.delphi3d.net then make them sdl compatable. the last merge was a few months ago to allow us to support the OpenGL 2.0 API (specifially GLSL). which was tested under both Delphi and FPC on Windows and Linux. I don't think the FPC units are as uptodate as that (please correct me if I am wrong), mind you the GL and GLU units haven't changed much in years so it shouldn't be too much of a problem.

    Once you have made your changes let me know and I will test them under windows and linux.
    <A HREF="http://www.myhpf.co.uk/banner.asp?friend=139328">
    <br /><IMG SRC="http://www.myhpf.co.uk/banners/60x468.gif" BORDER="0">
    <br /></A>

  6. #26

    OpenGL command crashing under Lazarus but not Dephi 5

    Quote Originally Posted by michalis
    From my experience, jedi-sdl was never tested enough with FPC. That's why I assumed that making jedi-sdl GL/GLU units compatible with FPC is a waste of time, since FPC distribution already provides these units too. So I was satisfied with GL/GLU units working under Delphi/Kylix, providing compatible layer to FPC GL/GLU units.

    However, I'm glad to know that you want to make jedi-sdl GL/GLU units compatible with FPC. I'll diff GL/GLU jedi-sdl and FPC units and will submit a patch soon with any necessary corrections to jedi-sdl. I will also patch FPC units to include GL 2.0 updates in jedi-sdl glext unit, I wanted to do this since a long time anyway. So FPC and jedi-sdl units will get synched.

    cragwolf: I can't explain why you can't reproduce the problem with Windows and compiling with FPC using jedi-sdl glu unit... I would double-check that you're indeed using the jedi-sdl glu, not the one supplied with FPC (as the one supplied with FPC will work, we know this). As for Lazarus 0.9.18: it includes exactly FPC 2.0.4.
    I did notice that I still need to use the glext file that comes with JEDI-SDL as the FPC version doesn't have various ARB routines that I require for my shader classes...

    Identifier not found "GL_FRAGMENT_SHADER_ARB"
    Identifier not found "GL_OBJECT_COMPILE_STATUS_ARB"
    Identifier not found "GL_OBJECT_INFO_LOG_LENGTH_ARB"
    Identifier not found "GL_OBJECT_]http://abalonegl.eonclash.com/gluunproject_test.zip[/url]

    cheers,
    Paul.

  7. #27

    OpenGL command crashing under Lazarus but not Dephi 5

    Done. The patch to make jedi-sdl GLU unit work with FPC is submitted to sf tracker, see http://sourceforge.net/tracker/index...05&atid=437446. The patch to make FPC glext unit include all latest OpenGL 2.0 extensions was just sent to the fpc-devel mailing list.

    Paul: for now you can just take GLU unit from FPC, and take glext unit from jedi-sdl sources. This will make your program bug-free and all needed OpenGL features will be available. Alternatively, you can wait until the patches will be applied to FPC or jedi-sdl and then use their SVN or CVS versions. Alternatively, you can just apply the patches yourself to your local copy of FPC or jedi-sdl.

  8. #28

    OpenGL command crashing under Lazarus but not Dephi 5

    Quote Originally Posted by michalis
    Done. The patch to make jedi-sdl GLU unit work with FPC is submitted to sf tracker, see http://sourceforge.net/tracker/index...05&atid=437446. The patch to make FPC glext unit include all latest OpenGL 2.0 extensions was just sent to the fpc-devel mailing list.

    Paul: for now you can just take GLU unit from FPC, and take glext unit from jedi-sdl sources. This will make your program bug-free and all needed OpenGL features will be available. Alternatively, you can wait until the patches will be applied to FPC or jedi-sdl and then use their SVN or CVS versions. Alternatively, you can just apply the patches yourself to your local copy of FPC or jedi-sdl.
    Thanks michalis for you hard work, and everyone else here :-)

    I am currently using the FPC GLU and GL units, and the JEDI-SDL GLEXT unit

    cheers,
    Paul.

  9. #29

    OpenGL command crashing under Lazarus but not Dephi 5

    Quote Originally Posted by michalis
    I will also patch FPC units to include GL 2.0 updates in jedi-sdl glext unit, I wanted to do this since a long time anyway.
    I tried to download your patch for FPC from here but the ]cragwolf: I can't explain why you can't reproduce the problem with Windows and compiling with FPC using jedi-sdl glu unit... [/quote]

    I will try it again tomorrow. Probably I am not doing something right.
    [size=10px]&quot;In science one tries to tell people, in such a way as to be understood by everyone, something that no one ever knew before. But in poetry, it&#39;s the exact opposite.&quot; -- Paul Dirac[/size]

  10. #30

    OpenGL command crashing under Lazarus but not Dephi 5

    I sent the patch to cragwolf, but it's also publicly available now at http://www.freepascal.org/mantis/view.php?id=7600.

Page 3 of 4 FirstFirst 1234 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •