Page 2 of 2 FirstFirst 12
Results 11 to 19 of 19

Thread: OpenGL.pas?

  1. #11

    OpenGL.pas?

    Ok, I made sure I had all the units from OpenGL up-to-date.
    I have also downloaded one of the tutorials I was having problems with from the site you mentioned; I will try them soon, and give you feedback. Thanks a lot

  2. #12

    OpenGL.pas?

    Hey, Im back!

    I tested the tutorial 7 from the link you gave.
    The issues I had with Glaux are obviously gone, but I still get the same problem as before, at the line
    Code:
    glTexImage2D( GL_TEXTURE_2D, 0, 3, TextureImage.x,
                      TextureImage.h, 0, GL_BGR,
                      GL_UNSIGNED_BYTE, TextureImage.pixels );
    I get the error message
    Code:
    lesson7.pas(136,53) Error: Illegal qualifier
    lesson7.pas(136,53) Hint: may be pointer dereference is missing
    How do I 'derefrence' :evil: :cry:

    Thanks again

  3. #13

    OpenGL.pas?

    Quote Originally Posted by IlovePascal
    How do I 'derefrence' :evil: :cry:
    Thanks again
    @ would be my guess
    Peregrinus, expectavi pedes meos in cymbalis
    Nullus norvegicorum sole urinat

  4. #14

    OpenGL.pas?

    Quote Originally Posted by IlovePascal
    Hey, Im back!

    Code:
    glTexImage2D( GL_TEXTURE_2D, 0, 3, TextureImage.x,
                      TextureImage.h, 0, GL_BGR,
                      GL_UNSIGNED_BYTE, TextureImage.pixels );
    I get the error message
    Code:
    lesson7.pas(136,53) Error: Illegal qualifier
    lesson7.pas(136,53) Hint: may be pointer dereference is missing
    How do I 'derefrence' :evil: :cry:
    How are you compiling these demos? Are you using Delphi compatability mode? Which I believe is -Sd compiler directive.

    Can you post what command line parameters you are using.
    <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 =-

  5. #15

    OpenGL.pas?

    Quote Originally Posted by savage
    How are you compiling these demos? Are you using Delphi compatability mode? Which I believe is -Sd compiler directive.

    Can you post what command line parameters you are using.
    Hey, Im sorry Im not sure where to find the 'command line parameters' that Im using, because I never change those. ops:

    I don't know if this is it, bt I had a look in the 'parsing' section of the 'compiler options' and there was indeed a box saying 'Delphi compatible(-Sd)', i ticked it but I still get an error on the same line.
    The difference is that now it says:
    Code:
    lesson7.pas&#40;136,54&#41; Error&#58; Unknown record field identifier "X"
    Btw, "TextureImage" is defined as
    Code:
    TextureImage&#58; PSDL_Surface;
    and the latter is defined (in sdl.pas) as
    Code:
    PSDL_Surface = ^TSDL_Surface;
    So does that mean there is no such thing as an x variable in the TSDL_Surface record?

    ----
    Quote Originally Posted by JSoftware
    @ would be my guess
    Well, I had tried that before! haha
    But I think @ is used to reference, and the problem Im having is that the variable is already a pointer! And the parameter needs to be a longint! so thats not it...

    Thanks anyways

  6. #16

    OpenGL.pas?

    Quote Originally Posted by IlovePascal
    Hey, Im back!

    I tested the tutorial 7 from the ]glTexImage2D&#40; GL_TEXTURE_2D, 0, 3, TextureImage.x,
    TextureImage.h, 0, GL_BGR,
    GL_UNSIGNED_BYTE, TextureImage.pixels &#41;;[/code]
    I get the error message
    Code:
    lesson7.pas&#40;136,53&#41; Error&#58; Illegal qualifier
    lesson7.pas&#40;136,53&#41; Hint&#58; may be pointer dereference is missing
    How do I 'derefrence' :evil: :cry:

    Thanks again
    Have you tried doing it this way?

    Code:
    glTexImage2D&#40; GL_TEXTURE_2D, 0, 3, TextureImage^.x,
                      TextureImage^.h, 0, GL_BGR,
                      GL_UNSIGNED_BYTE, TextureImage^.pixels &#41;;
    Since TextureImage is a pointer type, I think freepascal requires the '^'.

    cheers,
    Paul.

  7. #17

    OpenGL.pas?

    I've never used Lazarus so I'm not sure how it handles Delphi compatability.

    When I use the command compiler I do the following...

    1. Check that fpc.cfg contains the paths to the JEDI-SDL files ( sdl.pas, jedi-sdl.inc, gl.pas, glu.pas etc ). If the paths are not there, add them into the file.

    2. At a command line type the following...
    Code:
    fpc -Sd tutorial7.pas
    If 1. is set up correctly, 2 should just work and you do not need to dereference anything.

    If you definitely want to dereference it, then try what Paul suggested. The thing is, if you are using Delphi compatibility mode, you do NOT need to dereference, because Delphi supports smart dereferencing.
    <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 =-

  8. #18

    OpenGL.pas?

    Mmmm...
    Ok, ok. Interesting (both above).

    Well, unfortunately, I tried using the '^' as Paul suggested with the 'Delphi Compatible' box ticked, without it ticked, ticked and without the '^', unticked and without the '^'. In other words, all the combinations of those two. In vain.

    What I think, however, is that the problem is actually with the X variable, because the compiler says 'Unknown record field identifier X', so maybe it's not struggling with dereferencing, but with finding the right variable, right? I can't check because I don't know where 'TSDL_Surface' is defined, but couldn't that be the problem? Although it's true it seems to be working for you (Savage) just the way it is... :scratch:

    Maybe if it's really something I have to do with the compiler, maybe Will could help? He seems to know Lazarus very well. How do I ask him to have a look at this thread?

    Well, anyways, thanks so much for the time!

  9. #19

    OpenGL.pas?

    This is the output I get using a v1.9.4 of the compiler...

    Code:
    E&#58;\Development\Borland\Delphi4\Headers\JEDI-SDLv1.0\Demos\3D\NeHe\Tutorial 7>fpc
     -Sd JEDISDLOpenGL7.dpr
    Hint&#58; End of reading config file e&#58;\development\fpc\bin\win32\fpc.cfg
    Free Pascal Compiler version 1.9.4 &#91;2004/05/30&#93; for i386
    Copyright &#40;c&#41; 1993-2004 by Florian Klaempfl
    Target OS&#58; Win32 for i386
    Compiling jedisdlopengl7.dpr
    Compiling e&#58;\development\borland\delphi4\headers\jedi-sdlv1.0\opengl\pas\gl.pas
    Compiling e&#58;\development\borland\delphi4\headers\jedi-sdlv1.0\sdl\pas\moduleload
    er.pas
    moduleloader.pas&#40;58,2&#41; Warning&#58; Illegal compiler directive "$WEAKPACKAGEUNIT"
    Compiling e&#58;\development\borland\delphi4\headers\jedi-sdlv1.0\opengl\pas\glu.pas
    
    glu.pas&#40;140,14&#41; Hint&#58; Type "PPOINTER" redefinition
    Compiling e&#58;\development\borland\delphi4\headers\jedi-sdlv1.0\opengl\pas\glext.p
    as
    glext.pas&#40;3774,27&#41; Hint&#58; Conversion between ordinals and pointers are not portab
    le
    glext.pas&#40;3774,19&#41; Hint&#58; Conversion between ordinals and pointers are not portab
    le
    glext.pas&#40;3775,34&#41; Hint&#58; Conversion between ordinals and pointers are not portab
    le
    glext.pas&#40;3775,28&#41; Hint&#58; Conversion between ordinals and pointers are not portab
    le
    glext.pas&#40;3895,3&#41; Note&#58; Local variable "extstring" is assigned but never used
    glext.pas&#40;63,15&#41; Hint&#58; Unit "MODULELOADER" not used in GLEXT
    jedisdlopengl7.dpr&#40;205,31&#41; Hint&#58; use DIV instead to get an integer result
    Linking jedisdlopengl7.exe
    13619 Lines compiled, 8.0 sec
    And the executable works fine.
    <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 2 of 2 FirstFirst 12

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
  •