Results 1 to 10 of 14

Thread: getting my stuff together

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    I asume you skiped first two chapters wich explain what is needed to be done to sucsesfully initialize SDL. SO i recomend to read them one by one, becouse only this way you will manage to get things going.
    Probably the cuse of the problem in your case is that your program can't find path to sdl.dll dynamic library wich is requred for SDL to work at all. So make sure that sdl.dll is either inside your projects directory or somwhere on the system path, "C:\Windows\System32" for instance.

  2. #2
    Hah. Since you named the program file SDL.pas, when FPC encountered "uses SDL", it began to look for the SDL unit, and the first thing it saw was... SDL.pas. Which was not a unit, and that's why the compiler shouted about interface and implementation, which are unit parts.

    Also, about the output - first thing, I guess you would want the writeln to be executed only if there actually is a problem and screen is NIL - begin end block? And putting it before halt. As for the SetVideoMode failing - I don't see a reason why would You need 32 bits for a display surface; type in either 24 or 0 (which will create a surface with a depth resembling the one currently used in the user's OS). You can eventually add the SDL_AnyFormat flag.

  3. #3
    Quote Originally Posted by Super Vegeta View Post
    Hah. Since you named the program file SDL.pas, when FPC encountered "uses SDL", it began to look for the SDL unit, and the first thing it saw was... SDL.pas. Which was not a unit, and that's why the compiler shouted about interface and implementation, which are unit parts.

    Also, about the output - first thing, I guess you would want the writeln to be executed only if there actually is a problem and screen is NIL - begin end block? And putting it before halt. As for the SetVideoMode failing - I don't see a reason why would You need 32 bits for a display surface; type in either 24 or 0 (which will create a surface with a depth resembling the one currently used in the user's OS). You can eventually add the SDL_AnyFormat flag.
    whoaaa! and so you´ve solved my problem a second time, what are you, god or something?

    I didnt notice the writeln was outside the if block since it didnt have the begin-end so since the writeln showed then the issue was actually with the loading of the image!

    and then i remembered the image being used was at some point a jpg which i changed to .bmp simply by renaming the extension xD meaning internally was still formatted as a jpg right?

    SO IT WORKS NOW, IT WORKS, OH GOD IT WORKS IT WORKS IT WORKS ama gon build gaems....im just worried about how hard i tend to **** stuff up...i mean, so simple code yet so many stupid mistakes, i wonder if ill ever get somewhere...oh well, theres lots of fail ahead of me - Oh by the way, will the computer that wants to execute the program i make need the SDL library too?

    thank you so much vegeta, i totally owe you two
    Last edited by sacros; 16-03-2012 at 06:41 PM.

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
  •