How to force a size to a surface/texture?

I’ve created an empty surface, then blitted some other surfaces to is. When I convert it to SDL_Texture, the empty space is discarded, so it appeares scaled when rendered. How can I fix this, how could I render the empty space as well?------------------------
Runic Girls - a hexa match3 game with girls created using SDL 2.0:
http://www.facebook.com/RunicGirls

Gameplay trailer:

I’m not sure that’s what you mean, but you could use:

SDL_Surface *surf;
… create …
SDL_FillRect(surf, NULL, SDL_MapRGB(surf->format, 0,0,0));
… blitting …

That is, filling the surface with a blank color before blitting
I chose a black color (0 ,0 ,0), but you could replace it with that of your choice.

Also, make sure that the sizes are indeed the same (I don’t see the code, I just guess).------------------------
C is the God’s Programming Language

I think he means SDL is making the texture smaller than it should
(trimming out the blank space).

2013/5/21, neoaggelos :> I’m not sure that’s what you mean, but you could use:

SDL_Surface *surf;
… create …
SDL_FillRect(surf, NULL, SDL_MapRGB(surf->format, 0,0,0));
… blitting …

That is, filling the surface with a blank color before blitting
I chose a black color (0 ,0 ,0), but you could replace it with that of your
choice.

Also, make sure that the sizes are indeed the same (I don’t see the code, I
just guess).


C is the God’s Programming Language

Does that mean removing all space that has no color / data ?
If so, I merely suggested filling the surface with a color beforehand, so that after blitting, all empty space will have a color, and it will not be ‘skipped over’.

Sik wrote:> I think he means SDL is making the texture smaller than it should

(trimming out the blank space).

2013/5/21, neoaggelos <@Aggelos_Kolaitis>:

I’m not sure that’s what you mean, but you could use:

SDL_Surface *surf;
… create …
SDL_FillRect(surf, NULL, SDL_MapRGB(surf->format, 0,0,0));
… blitting …

That is, filling the surface with a blank color before blitting
I chose a black color (0 ,0 ,0), but you could replace it with that of your
choice.

Also, make sure that the sizes are indeed the same (I don’t see the code, I
just guess).


C is the God’s Programming Language


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


C is the God’s Programming Language