   Loading and Displaying images... errors
  I am going throught these cone3d tutorials to brush up on my SDL skills, and got several compilation errors with the code from lesson 2.I downloaded the source and the program runs nicely, but the code still won't compile. I am using Dev-C++ 5 beta.What's wrong? I noticed several people had their code working nicely at cone3d.errors/warnings:28 C:\My Documents\prog\SDL\main.cconflicting types for `DrawIMG'20 C:\My Documents\prog\SDL\main.cprevious declaration of `DrawIMG'C:\My Documents\prog\SDL\main.c[Warning] In function `DrawBG':42 C:\My Documents\prog\SDL\main.ctoo few arguments to function `DrawIMG'C:\My Documents\prog\SDL\main.c[Warning] In function `DrawScene':48 C:\My Documents\prog\SDL\main.ctoo few arguments to function `DrawIMG'and the code, which came from the site:   #include <stdio.h>#include <stdlib.h>#include <SDL/SDL.h>SDL_Surface *back;SDL_Surface *image;SDL_Surface *screen;int xpos=0,ypos=0;int InitImages(){  back = SDL_LoadBMP("bg.bmp");  image = SDL_LoadBMP("image.bmp");  return 0;}void DrawIMG(SDL_Surface *img, int x, int y){  SDL_Rect dest;  dest.x = x;  dest.y = y;  SDL_BlitSurface(img, NULL, screen, &dest);}void DrawIMG(SDL_Surface *img, int x, int y, int w, int h, int x2, int y2){  SDL_Rect dest;  dest.x = x;  dest.y = y;  SDL_Rect dest2;  dest2.x = x2;  dest2.y = y2;  dest2.w = w;  dest2.h = h;  SDL_BlitSurface(img, &dest2, screen, &dest);}void DrawBG(){  DrawIMG(back, 0, 0);}void DrawScene(){  DrawIMG(back, xpos-2, ypos-2, 132, 132, xpos-2, ypos-2);  DrawIMG(image, xpos, ypos);  SDL_Flip(screen);}int main(int argc, char *argv[]){  Uint8* keys;  if ( SDL_Init(SDL_INIT_AUDIO|SDL_INIT_VIDEO) < 0 )  {    printf("Unable to init SDL: %s\n", SDL_GetError());    exit(1);  }  atexit(SDL_Quit);  screen=SDL_SetVideoMode(640,480,32,SDL_HWSURFACE|SDL_DOUBLEBUF);  if ( screen == NULL )  {    printf("Unable to set 640x480 video: %s\n", SDL_GetError());    exit(1);  }  InitImages();  DrawBG();  int done=0;  while(done == 0)  {    SDL_Event event;    while ( SDL_PollEvent(&event) )    { if ( event.type == SDL_QUIT )  {  done = 1;  } if ( event.type == SDL_KEYDOWN ) {   if ( event.key.keysym.sym == SDLK_ESCAPE ) { done = 1; } }    }    keys = SDL_GetKeyState(NULL);    if ( keys[SDLK_UP] ) { ypos -= 1; }    if ( keys[SDLK_DOWN] ) { ypos += 1; }    if ( keys[SDLK_LEFT] ) { xpos -= 1; }    if ( keys[SDLK_RIGHT] ) { xpos += 1; }    DrawScene();  }  return 0;} [edited by - jmg5 on August 4, 2003 5:41:36 PM]
  I don''t use dev c but it looks like its having trouble with function overloading. 