I haven't asked If I wasn't really confused :)
OK, so I am just beginning SDL programming in C, and I was running fine, until I tried getting a pixel colour.
Basically, I am trying to run the code from this page:
http://www.libsdl.org/cgi/docwiki.cgi/Pixel_20Access
This is the cut down version of my code:
Expand|Select|Wrap|Line Numbers
- snip
- SDL_Color GetPixel ( SDL_Surface* Screen , int x , int y ) ; //define struct
- snip
- int main( int argc, char* argv[] )
- {
- SDL_Init( SDL_INIT_VIDEO );
- SDL_Surface* Screen = SDL_SetVideoMode( width, height , 32, DL_HWSURFACE | SDL_DOUBLEBUF ) ; //use Screen as surface
- snip
- curr_col = GetPixel(Screen, ant[1], ant[2]); //DOESN'T WORK! this is line 36
- snip
- boxRGBA(Screen,
- ant[1], ant[2],
- ant[3], ant[4],
- ant[5], ant[6], ant[7], ant[8]); //DOES WORK
- snip
Expand|Select|Wrap|Line Numbers
- test.c: In function ‘main’:
- test.c:36: error: incompatible types in assignment
- test.c:38: error: expected expression before ‘{’ token
Any help would be much appreciated :)
Thank you.