okay in my last post they helped me out and this is what i got
//main.cpp
#include "SDLENGINE.h"
#include <SDL/SDL.h>
using namespace std;
SDL_Surface* screen;
SDL_Surface* background;
int main(int argc,char* args[])
{
if(SDL_Init(SDL_INIT_EVERYTHING) == -1)
{
printf("Unable to INIT SDL");
return 1;
}
screen = SDL_SetVideoMode(SWIDTH,SHEIGHT,BPP,SDL_SWSURFACE);
if(screen == NULL)
{
printf("Unable to set Video Mode!");
return 1;
}
SDL_WM_SetCaption("TESTING SPLIT!",NULL);
background = Load_Image("background.bmp");
if(background == NULL)
{
printf("background turned out null!");
return 1;
}
Apply_Surface(0,0,&background,&screen);
if(SDL_Flip(screen) == -1)
{
printf("Unable to FLIP Screen");
return 1;
}
SDL_Delay(2000);
SDL_FreeSurface(background);
SDL_Quit();
}
//SDLENGINE.h
#ifndef SDLENGINE_H
#define SDLENGINE_H
#define SWIDTH 640
#define SHEIGHT 480
#define BPP 32
#include <SDL/SDL.h>
#include <string>
SDL_Surface* Load_Image(std::string filename);
void Apply_Surface(int x, int y,SDL_Surface *source, SDL_Surface *destination);
#endif
//SDLENGINE.cpp
#include "SDLENGINE.h"
#include <SDL/SDL.h>
#include <string>
using namespace std;
SDL_Surface* Load_Image(string filename)
{
SDL_Surface *temp = NULL;
SDL_Surface *final = NULL;
temp = SDL_LoadBMP(filename.c_str());
if(temp != NULL)
{
final = SDL_DisplayFormat(temp);
SDL_FreeSurface(temp);
}
return final;
)
void Apply_Surface(int x,int y, SDL_Surface* const source, SDL_Surface* const destination)
{
SDL_Rect Offset;
Offset.x = x;
Offset.y = y;
SDL_BlitSurface(source,NULL,destination,&Offset);
}
im getting the error in main that...
1 C:\Documents and Settings\Kevin Stowe\Desktop\SDLShit\Project\main.cpp [Warning] `nul.gcda' is not a gcov data file for the SDLENGINE.h
and
33 C:\Documents and Settings\Kevin Stowe\Desktop\SDLShit\Project\main.cpp cannot convert `SDL_Surface**' to `SDL_Surface*' for argument `3' to `void Apply_Surface(int, int, SDL_Surface*, SDL_Surface*)'
for the applysurface...can someone tell me why?