Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Lazarus and OpenGL - Help a newbie Please!

  1. #1
    theduck
    Guest

    Lazarus and OpenGL - Help a newbie Please!

    Hi, I am a 14 year old programmer, who has programmed in 6 languages.

    I am using the current lazarus win32 build, and the dgl1.5 opengl unit. I need help. Can anybody help me? I am totally lost. I don't need help on
    the commands or anything. I copied and pasted a tutorial's code and saved it with the stuff for OpenGL in the same directory. It wont compile.
    I get errors. Can anybody help me? Please. I need help fast.


    You can get what I have right now here:
    http://www.freewebs.com/duckgames/Games/OPENGL_TEST.zip
    *You may need to copy+paste in address bar*

    Please help me. I have been working 3 days non-stop to get OpenGL to work with Lazarus.

  2. #2

    Lazarus and OpenGL - Help a newbie Please!

    It seems that Lazarus's Windows unit does not containt a definition for "PWGLSwap" which should look something like this..
    [pascal]
    type
    PWGLSwap = ^TWGLSwap;
    _WGLSWAP = packed record
    hdc: HDC;
    uiFlags: UINT;
    end;
    TWGLSwap = _WGLSWAP;
    WGLSWAP = _WGLSWAP;[/pascal]
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

  3. #3
    theduck
    Guest

    Lazarus and OpenGL - Help a newbie Please!

    Thanks! But where to I put it? :roll:

    Sorry to cause any inconvienance, but do you think you can
    edit my file, and put it in a .zip and send it to me?
    My Email = cdrake4@woh.rr.com
    I would really appreciate it if you could. It would help a lot.
    I have really been wanting to start OpenGL. I've been trying to
    get it to work all day for the past 3 days (We had a snow day on Friday! ).

  4. #4

    Lazarus and OpenGL - Help a newbie Please!

    Ok, open your "windows" unit. Near the top, where the type definitions are put that code in at the top, just under type.

    He's doing a good job, I reccommended he come here because I don't know enough! I've been showing him the way at my forums, and got into a few tight spots.

  5. #5
    theduck
    Guest

    Lazarus and OpenGL - Help a newbie Please!

    Ok.... I get the same error....

  6. #6

    Lazarus and OpenGL - Help a newbie Please!

    OK this is probably a silly question, but if you are using FreePascal, why are you using dglOpenGL as your OpenGL interface? dglOpenGL and most demos from Sulaco's site are specifically built for the Delphi compiler. So in order to get it working with FreePascal will take a fair bit of jiggery pokery.

    IIRC, FreePascal has it's own set of OpenGL headers. Replace dglOpenGL in your uses clause with, gl, glu and you also need glext in there as well. This change should take place in both your project file and in the texture.pas file. The project will need a few more tweaks before it works. One main issue is that Textures.pas uses the Delphi Graphics unit. You will need to find out which FreePascal unit is its equivalent before proceeding.

    Actually I just checked and FreePascal comes with a few OpenGL GLUT based Pascal demos.
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

  7. #7
    theduck
    Guest

    Lazarus and OpenGL - Help a newbie Please!

    Ok... I am confused now...
    But I am using Lazarus compiler with the Lazarus IDE.
    No Delphi.

    EDIT:Oops... sorry, didn't mean to triple post. Don't even know how
    I did that!


    DOUBLE EDIT: I understand now! I'll google it and ask the Lazarus developers on what the Laz compatible Graphics Unit is. Thanks a lot for your help

  8. #8

    Lazarus and OpenGL - Help a newbie Please!

    Hi Duck,
    I should have been more explicit, I should have clarified that the Lazarus IDE uses FreePascal as it's backend compiler. I tend to refer to the compiler rather than the IDE.

    Btw, as I am an admin, in these here parts, I decided to delete the the double posts as everything you wanted to say, appeared in the 3rd post.
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

  9. #9
    theduck
    Guest

    Lazarus and OpenGL - Help a newbie Please!

    Thants ok.
    Thanks for deleting my triple post... :roll:

    Thanks a lot for your help. I am looking like crazy for the Laz compatible Graphics unit. I have googled and asked on the Lazarus Forum so far. Hopefully I will find it.

  10. #10

    Lazarus and OpenGL - Help a newbie Please!

    Looks like someone already tried to create a FreePascal friendly verison of dglOpenGL.pas over @ http://www.delphigl.com/forum/download.php?id=548, you may want to try that if you don't want to use the FPC gl &? glu units, but you will still have the Delphi Graphics reference problem in textures.pas.
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

Page 1 of 2 12 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
  •