Re: Image Not Appearing
- Posted by jimcbrown (admin) Dec 21, 2011
- 1903 views
Lone_EverGreen_Ranger said...
mattlewis said...
Lone_EverGreen_Ranger said...
Alright, this is my modified code, still not showing the image.
I don't know anything about SDL, but in order to debug this, you need to find out where the failure is occurring. I'd start by looking to answer a few questions:
- Does the blit code actually get called?
- Are the parameters correct?
- Does the image get loaded properly?
- Is everything initialized correctly inside of SDL
Also, you could simplify setting up the rectangle in memory:
procedure CalcRect(atom rect, integer sx, integer sy, integer tx, integer ty) poke2( rect, { sx, sy, tx, ty } ) end procedure
Hmm good point. Its probably not being blitted correctly. Perhaps someone that has knowledge with SDL and euphoria can help. Usually I use CPlusPlus for SDL stuff, but I figured why not try it with euphoria.
You forgot to call SDL_Flip(surface) in your code. When I add that, it works.
See http://openeuphoria.org/pastey/105.wc