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

Thread: getting my stuff together

  1. #11
    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. #12
    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. #13
    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.

  4. #14
    Quote Originally Posted by sacros View Post
    id love to know what you mean by "there is pixel handling issues in windows", is it like it has problems working with single pixels or is it something with raster based stuff in general?
    The OpenGL raster does work, I mean you can use all "gl..." procedures and it will work, but Allegro.pas 5 "software raster" (i.e. the "al_..." procedures) does fail if you try to draw pixels (al_draw_pixel) or text (al_draw_text, etc.) but it doesn't fail if you draw lines (al_draw_line).

    It isn't a big problem because you can do all graphic drawing using OpenGL but then you can't create textures or modify them on the fly (you can still load them from disk, anyway). On Linux it works without problem.

    Allegro.pas 4 does work both Windows and Linux without problem, but it doesn't allows OpenGL.
    Last edited by Ñuño Martínez; 19-03-2012 at 11:00 PM.
    No signature provided yet.

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
  •