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

Thread: Problem of SDL_FLIP

  1. #1

    Problem of SDL_FLIP

    Declaration
    [pascal]
    _pic_bg : PSDL_Surface;
    backbuffer: PSDL_Surface;
    [/pascal]


    INIT

    [pascal]
    if ( SDL_Init( SDL_INIT_VIDEO ) < 0 ) then
    begin
    Close;
    end;
    backbuffer:= SDL_SetVideoMode(640,480,32,SDL_SWSURFACE);
    [/pascal]

    Load the BMP
    [pascal]_pic_bomb := SDL_LoadBMP('resbmp/bomb1.bmp');[/pascal]


    [pascal] dst.x:=x*25;
    dst.y:=y*25;
    dst.h:= 25;
    dst.w:= 25;
    src.x:=0;
    src.y:=0;
    src.h:=25;
    src.w:=25;
    SDL_BlitSurface(_pic_bg,@src,backbuffer,@dst);
    SDL_flip(backbuffer); // <<< ERROR HERE
    [/pascal]

    I have a problem in the flip =/
    what is the problem ?
    From brazil (:

    Pascal pownz!

  2. #2

    Problem of SDL_FLIP

    Have you checked to see if backbuffer is nil before using it?
    Perhaps SDL_SetVideoMode is failing for some reason?
    cheers
    Paul

  3. #3

    Problem of SDL_FLIP

    Quote Originally Posted by paul_nicholls
    Have you checked to see if backbuffer is nil before using it?
    Perhaps SDL_SetVideoMode is failing for some reason?
    cheers
    Paul
    Please explaim more, im new to SDL ops:
    From brazil (:

    Pascal pownz!

  4. #4

    Problem of SDL_FLIP

    [pascal]backbuffer:= SDL_SetVideoMode(640,480,32,SDL_SWSURFACE or SDL_DOUBLEBUF);
    if backbuffer = nil then
    begin
    //something wrong
    end;[/pascal]

    I added there "or SDL_DOUBLEBUF" lets try it.

  5. #5
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25

    Problem of SDL_FLIP

    A trick I used when I was first using JEDI-SDL --or any new API library-- was to look at working example source and compare it to mine and see what was different. Then just mimic what was done in the example and strip away stuff until you get an error or the specific result you're looking for.

    Unfortunately noone has gone to the lengths of creating a basic functionality of JEDI-SDL tutorial so I have nothing to make reference to.
    Jason McMillen
    Pascal Game Development
    Co-Founder





  6. #6

    Problem of SDL_FLIP

    Quote Originally Posted by WILL
    A trick I used when I was first using JEDI-SDL --or any new API library-- was to look at working example source and compare it to mine and see what was different. Then just mimic what was done in the example and strip away stuff until you get an error or the specific result you're looking for.

    Unfortunately noone has gone to the lengths of creating a basic functionality of JEDI-SDL tutorial so I have nothing to make reference to.
    I read your tutorials and how you can see it appers to be right the code,
    i will test what tsr write.
    From brazil (:

    Pascal pownz!

  7. #7

    Problem of SDL_FLIP

    Quote Originally Posted by tsr
    [pascal]backbuffer:= SDL_SetVideoMode(640,480,32,SDL_SWSURFACE or SDL_DOUBLEBUF);
    if backbuffer = nil then
    begin
    //something wrong
    end;[/pascal]

    I added there "or SDL_DOUBLEBUF" lets try it.
    Its missing the doublebuf =]

    problem solved ;]
    From brazil (:

    Pascal pownz!

  8. #8

    Problem of SDL_FLIP

    How can i write some text to the screen ?

    dont found anything in the demos =/
    From brazil (:

    Pascal pownz!

  9. #9

    Problem of SDL_FLIP

    you need to look in the JEDI-SDL v1.0 for libraries called SFont or SDLMonoFonts. There are demos on how to use these within the SFont/SDLMonoFont directories.
    <A HREF="http://www.myhpf.co.uk/banner.asp?friend=139328">
    <br /><IMG SRC="http://www.myhpf.co.uk/banners/60x468.gif" BORDER="0">
    <br /></A>

  10. #10

    Problem of SDL_FLIP

    Or you can also use SDL_ttf if you would rather use True Type Fonts.
    <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
  •