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
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
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
I get the error messageCode:glTexImage2D( GL_TEXTURE_2D, 0, 3, TextureImage.x, TextureImage.h, 0, GL_BGR, GL_UNSIGNED_BYTE, TextureImage.pixels );
How do I 'derefrence' :evil: :cry:Code:lesson7.pas(136,53) Error: Illegal qualifier lesson7.pas(136,53) Hint: may be pointer dereference is missing
Thanks again
@ would be my guessOriginally Posted by IlovePascal
Peregrinus, expectavi pedes meos in cymbalis
Nullus norvegicorum sole urinat
How are you compiling these demos? Are you using Delphi compatability mode? Which I believe is -Sd compiler directive.Originally Posted by IlovePascal
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:Originally Posted by savage
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:
Btw, "TextureImage" is defined asCode:lesson7.pas(136,54) Error: Unknown record field identifier "X"
and the latter is defined (in sdl.pas) asCode:TextureImage: PSDL_Surface;
So does that mean there is no such thing as an x variable in the TSDL_Surface record?Code:PSDL_Surface = ^TSDL_Surface;
----
Well, I had tried that before! hahaOriginally Posted by JSoftware
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
Have you tried doing it this way?Originally Posted by IlovePascal
Since TextureImage is a pointer type, I think freepascal requires the '^'.Code:glTexImage2D( GL_TEXTURE_2D, 0, 3, TextureImage^.x, TextureImage^.h, 0, GL_BGR, GL_UNSIGNED_BYTE, TextureImage^.pixels );
cheers,
Paul.
Games:
Seafox
Pages:
Syntax Error Software
itch.io page
Online Chess
http://gameknot.com/#paul_nicholls
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...
If 1. is set up correctly, 2 should just work and you do not need to dereference anything.Code:fpc -Sd tutorial7.pas
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.
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!
This is the output I get using a v1.9.4 of the compiler...
And the executable works fine.Code:E:\Development\Borland\Delphi4\Headers\JEDI-SDLv1.0\Demos\3D\NeHe\Tutorial 7>fpc -Sd JEDISDLOpenGL7.dpr Hint: End of reading config file e:\development\fpc\bin\win32\fpc.cfg Free Pascal Compiler version 1.9.4 [2004/05/30] for i386 Copyright (c) 1993-2004 by Florian Klaempfl Target OS: Win32 for i386 Compiling jedisdlopengl7.dpr Compiling e:\development\borland\delphi4\headers\jedi-sdlv1.0\opengl\pas\gl.pas Compiling e:\development\borland\delphi4\headers\jedi-sdlv1.0\sdl\pas\moduleload er.pas moduleloader.pas(58,2) Warning: Illegal compiler directive "$WEAKPACKAGEUNIT" Compiling e:\development\borland\delphi4\headers\jedi-sdlv1.0\opengl\pas\glu.pas glu.pas(140,14) Hint: Type "PPOINTER" redefinition Compiling e:\development\borland\delphi4\headers\jedi-sdlv1.0\opengl\pas\glext.p as glext.pas(3774,27) Hint: Conversion between ordinals and pointers are not portab le glext.pas(3774,19) Hint: Conversion between ordinals and pointers are not portab le glext.pas(3775,34) Hint: Conversion between ordinals and pointers are not portab le glext.pas(3775,28) Hint: Conversion between ordinals and pointers are not portab le glext.pas(3895,3) Note: Local variable "extstring" is assigned but never used glext.pas(63,15) Hint: Unit "MODULELOADER" not used in GLEXT jedisdlopengl7.dpr(205,31) Hint: use DIV instead to get an integer result Linking jedisdlopengl7.exe 13619 Lines compiled, 8.0 sec
Bookmarks