Outputting straight to the framebuffer

Hi Everyone,

I’m trying to output an image straight to the framebuffer. The only example
I can find to do that manipulates the surface->pixels and calls lock and
unlock surface to do that. Does this only manipulate one pixel at a time?
Can I blit straight to the framebuffer or do I have to manipulate each pixel
at a time? Any help would be great!

Thanks,
Julie.

Julie Russell escribi?:

Hi Everyone,

Hi

I’m trying to output an image straight to the framebuffer. The only example
I can find to do that manipulates the surface->pixels and calls lock and
unlock surface to do that. Does this only manipulate one pixel at a time?
Can I blit straight to the framebuffer or do I have to manipulate each pixel
at a time? Any help would be great!

//I soppouse you have init SDL before this

SDL_Surface* framebuffer;
SDL_Surface* temp, image;

//We get a pointer to the frame
framebuffer = SDL_GetVideoSurface();

//Load the image
temp = SDL_LoadBMP(“my_image.bmp”);

//Convert image to framebuffer pixel format It creates a new surface
image = SDL_DisplayFormat (temp);

//Free temp image
SDL_FreeSurface(temp);

//blit
SDL_BlitSurface (image, NULL, framebuffer, NULL);

Regards–

  Ricardo Amores Hern?ndez
ICQ: 19463735
MSN: zheo_ (at) hotmail (dot) es

Hi Julie,

You can do memset()'s or other such memory fills to write a horizontal line
of pixels at a time to the frame buffer.

Other than that your option is probably a surface to surface blit
function…not sure what any of em are offhand, check the docs!

http://sdldoc.csn.ul.ie/> ----- Original Message -----

From: julie.russell@throughput.com.au (Julie Russell)
To:
Sent: Monday, September 22, 2003 12:47 AM
Subject: [SDL] Outputting straight to the framebuffer

Hi Everyone,

I’m trying to output an image straight to the framebuffer. The only
example
I can find to do that manipulates the surface->pixels and calls lock and
unlock surface to do that. Does this only manipulate one pixel at a time?
Can I blit straight to the framebuffer or do I have to manipulate each
pixel
at a time? Any help would be great!

Thanks,
Julie.


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl