[SDL] N00b questions... (I'm sorry! Stop slapping me with old fish ; ))

James Barrett xucaen at gmail.com
Thu Dec 7 14:43:43 PST 2006


Ochal Christophe wrote:
>
> On a sidenote, can someone tell me why the following doesn't work?
>
> fwrite((screen->format->BitsPerPixel, sizeof(unsigned int),
> (sizeof(unsigned int)/sizeof(unsigned int)), file);
>
> Where screen is a *Surface and file a filepointer, i know it's related
> to the way i passed screen->format->BitsPerPixel, fwrite expects a
> pointer to the value of BitsPerPixel, but for the life of me i can't
> remember how it was done, digged up my C manuals to read up on pointers
> again, but if someone could tell me what my obvious error is i'd
> appreciate it ;)

Wthout digging out my pointer reference, I think it's

&screen->format->BitsPerPixel



Jim




More information about the SDL mailing list