Sdl surface dimensions

Hi

Is there any way by which I can change the dimensions of an sdl surface which is
put on some other bigger sdl surface?Can I get the properties of an sdl surface
like bgcolor,foreground color,size of font.

Hi

Is there any way by which I can change the dimensions of an sdl surface which is
put on some other bigger sdl surface?

You can blit a portion of your source surface onto your destination
surface. Not sure if that’s what you were asking, though.
(Do you simply want to resize a surface? I’m not 100% sure, but I think
that involves creating a new surface, and copying the pixels from the original;
then you can just free the original, and make the variable that pointed to
it point to the new one.)

Can I get the properties of an sdl surface
like bgcolor,foreground color,size of font.

There’s no ‘foreground color’ or ‘font’ related to SDL surfaces.
I don’t believe there’s even a ‘background color’. Alpha, yes, but colors…On Thu, May 21, 2009 at 06:16:06AM +0000, jyoti wrote:


-bill!
Sent from my computer

Can I get the properties of an sdl surface
like bgcolor,foreground color,size of font.

There’s no ‘foreground color’ or ‘font’ related to SDL surfaces.
I don’t believe there’s even a ‘background color’. Alpha, yes, but colors…

If you’re using sprites with color keys, that would probably count
as a background color. Look at the colorkey APIs.>----- Original Message ----

From: Bill Kendrick
Subject: Re: [SDL] sdl surface dimensions

Good point.

In other APIs (e.g., BREW on mobile phones, using the IGraphics stuff)
there are actually background and foreground colors set. So then when you
go to paint a line, it uses those colors (you don’t send them as args to
the painting functions).

SDL doesn’t work like that. It’s much more raw. It’d be easy enough to
make a layer that wraps around parts of SDL to implement this, if it
floats one’s boat.

(e.g., “MY_Cool_Surface” is a struct that contains an SDL_Color or two,
an SDL_Surface, maybe some info about a bitmap or TTF font, etc.)On Fri, May 22, 2009 at 09:17:43AM -0700, Mason Wheeler wrote:

There’s no ‘foreground color’ or ‘font’ related to SDL surfaces.
I don’t believe there’s even a ‘background color’. Alpha, yes, but colors…

If you’re using sprites with color keys, that would probably count
as a background color. Look at the colorkey APIs.


-bill!
Sent from my computer

Hello :slight_smile:

I would like to use GetVideoInfo to set my game resolution. It will give me the current desktop resolution or the best one?
What about the “vfmt->BitsPerPixel”? It is the current resolution or the best one?

When I see the information of GetVideoInfo, I see that here the hw_available is 0, but I actually have a graphic card!
In the video set mode I put it to use SDL_HWSURFACE, and it works:
SDL_SetVideoMode(SCREEN_WIDTH,SCREEN_HEIGHT,COLOR_DEPTH,SDL_HWSURFACE|SDL_DOUBLEBUF|SDL_FULLSCREEN);

There is any function that returns the display refresh rate?
I am using 50 fps in my game, it will make any difference on a 60 Hz monitor?

Thank you._________________________________________________________________
Emoticons e Winks super diferentes para o Messenger. Baixe agora, ? gr?tis!
http://specials.br.msn.com/ilovemessenger/pacotes.aspx

When I see the information of GetVideoInfo, I see that here the hw_available
is 0, but I actually have a graphic card!

You’re on X11, right? SDL can’t use hardware acceleration on X11,
everything is always done in software. There’s very few SDL backends
that support hardware acceleration, the DirectX one on Windows was
one, but it’s not the default anymore (the GDI is the default on
Windows now, which is similar to X11).

In the video set mode I put it to use SDL_HWSURFACE, and it works:

Try checking the flags on the surface that you get from
SDL_SetVideoMode. I’m pretty sure that SDL_HWSURFACE is a request, and
that when hw_available is 0, it’s always ignored…On Fri, May 22, 2009 at 12:56 PM, Bruno Adami <a_j_bruno at hotmail.com> wrote:


http://pphaneuf.livejournal.com/