# SDL\_DisplayFormat()

**URL:** <https://discourse.libsdl.org/t/sdl-displayformat/4669>\
**Category:** SDL Development\
**Created:** [July 6, 2001, 3:31pm UTC](https://discourse.libsdl.org/t/sdl-displayformat/4669 "2001-07-06T15:31:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dan1](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/d/82dd89/32.png) [@Dan1](https://discourse.libsdl.org/u/Dan1)\
**Post date:** [July 6, 2001, 3:31pm UTC](https://discourse.libsdl.org/t/sdl-displayformat/4669/1 "2001-07-06T15:31:06Z")

</div>

implicit declaration of function `int SDL_DisplaySurface(...)' assignment to`SDL\_Surface \*’ from `int’ lacks a cast

SDL\_Surface \*gamebackground;

SDL\_Surface \*gametemp;

gametemp = SDL\_LoadBMP(“gameback.bmp”);  
gamebackground=SDL\_DisplaySurface(gametemp); // Here is the problem!  
SDL\_FreeSurface(gametemp);

whats wrong?  
you need more information?

---

<div class="post-metadata">

**Author:** ![Olivier\_Dagenais](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/o/aca169/32.png) [@Olivier\_Dagenais](https://discourse.libsdl.org/u/Olivier_Dagenais)\
**Post date:** [July 6, 2001, 3:53pm UTC](https://discourse.libsdl.org/t/sdl-displayformat/4669/2 "2001-07-06T15:53:02Z")

</div>

SDL\_DisplaySurface returns an “int”, or so the compiler thinks. I  
don’t see any SDL functions by that name, so your compiler is probably  
giving you a warning that it hasn’t seen the declaration for  
SDL\_DisplaySurface, so it will assume it is a one-parameter function  
that returns an “int” and that it will be defined somewhere else…

## I think you want SDL\_DisplayFormat…–

Olivier A. Dagenais - Software Architect and Developer

“Dan” wrote in message  
news:000b01c10630$ae1393c0$54f62ec3 at oemcomputer…

> implicit declaration of function `int SDL_DisplaySurface(...)' assignment to `SDL\_Surface \*’ from `int’ lacks a cast
> 
> SDL\_Surface \*gamebackground;
> 
> SDL\_Surface \*gametemp;
> 
> gametemp = SDL\_LoadBMP(“gameback.bmp”);  
> gamebackground=SDL\_DisplaySurface(gametemp); // Here is the  
> problem!  
> SDL\_FreeSurface(gametemp);
> 
> whats wrong?  
> you need more information?

---

<div class="post-metadata">

**Author:** ![icculus](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/icculus/32/81_2.png) [@icculus](https://discourse.libsdl.org/u/icculus)\
**Post date:** [July 6, 2001, 6:53pm UTC](https://discourse.libsdl.org/t/sdl-displayformat/4669/3 "2001-07-06T18:53:41Z")

</div>

> gamebackground=SDL\_DisplaySurface(gametemp); // Here is the problem!

Did you mean SDL\_DisplayFormat()?

–ryan.
