Defre or Fred, as you want.
Maybe SDL_GetVideoSurface, which will return a pointer to the surface if
initialised or nil otherwise, will help you.
Fred
2007/8/2, Ian Munro < ian.munro%40grosvenortechnology.com">ian.munro
grosvenortechnology.com>:
>
> Hi Defre (Fred ?)
>
> Unfortunately I hadn't setup the display with SDL_SetVideoMode as I
> was testing the function in isolation :o( Once I setup the display my
> function worked as expected. Thanks for also pointing out about the
> memory leak scenario. I'll fix that one before it comes back to bite me.
>
> Is there a test to see if the SDL Display has been setup so that I
> could add an Assert or some other test in my code ?
>
> Thanks for your help.
>
> Ian
>
>
> > Did you set up the display with SDL_SetVideoMode ?
> > Anyway, be careful with " Surface := SDL_DisplayFormat (Surface) ;",
> since
> > the old surface won't be automatically freed: this will cause a
> memory leak.
>
> 2007/8/1, Ian Munro < ian.munro%40grosvenortechnology.com">ian.munro
grosvenortechnology.com<ian.munro%40grosvenortechnology.com>
> <mailto:ian.munro%40grosvenortechnology.com> >:
> >
> > Hello,
> >
> > I'm getting a strange problem and I'm hoping that someone can spot
> where
> > I'm going wrong. The following function loads an image file (bmp or
> png)
> > into a surface, sets it up ready to display and stores it in a list.
> >
> > Everything works fine until the "Surface := SDL_DisplayFormat
> (Surface)"
> > call. Before the call "Surface" points to something but after the call
> > it is returned as nil.
>
> .
>
> <http://geo.yahoo.com/serv?s=97359714/grpId=3077490/grpspId=1705006497/m
> sgId=4251/stime=1185996447/nc1=4776369/nc2=4699084/nc3=4025304>
>
>
> This email is intended solely for the person to whom it is addressed and
> may contain confidential or legally privileged information. If you are not
> the intended recipient, be advised that you have received this email in
> error and that any use, dissemination, forwarding, printing or copying of
> this email is strictly prohibited. Please notify the author by replying to
> this email and destroying all copies of the email and attachments. Access to
> this email by anyone else is unauthorised.
>
> Email may be susceptible to data corruption, interception, unauthorised
> amendment, viruses and delays or the consequences thereof. Any views or
> opinions presented are solely those of the author and do not necessarily
> represent those of Grosvenor Technology Ltd.
>
> Grosvenor Technology Ltd. (incorp. Newmark Technology Ltd.) is a company
> registered in England with company number 2412554.
> The Grosvenor Technology Ltd. Registered Office address is Millars Three,
> Southmill Road, Bishop's Stortford, Herts, CM23
>
> [Non-text portions of this message have been removed]
>
>
>
[Non-text portions of this message have been removed]
.