I am attempting to teach myself C++ and SDL and I am still very green; my first roadblock has come up and I would appreciate some education please.
The objective of the code is to create a window with two images.
Using Microsoft Visual C++ Express, I am running into the error message-
"error C2660: 'SDL_UpperBlit' : function does not take 6 arguments"
#pragma comment(lib, "SDL.lib")
#pragma comment(lib, "SDLmain.lib")
#pragma comment(lib, "SDL_TTF.lib")
#include "SDL.h"
#include "SDL_image.h"
#include <iostream>
#include <stack>
#include <string>
#include "SDL_TTF.h"
#include "Defines.h"
using namespace std;
int main(int argc, char *argv[])
{
const int SCREEN_WIDTH = 644;
const int SCREEN_HEIGHT = 400;
const int SCREEN_BPP = 32;
SDL_Surface *logo = NULL;
SDL_Surface *border = NULL;
SDL_Surface *screen = NULL;
SDL_Init(SDL_INIT_EVERYTHING);
SDL_WM_SetCaption("Name", NULL);
screen = SDL_SetVideoMode( SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_BPP, SDL_SWSURFACE );
border = IMG_Load("Graphics/Title/Border.png");
logo = IMG_Load("Graphics/Title/Logo.png");
SDL_BlitSurface( logo, NULL, border, NULL, screen, NULL );
SDL_Flip(screen);
SDL_Delay(5000);
SDL_FreeSurface(logo);
SDL_FreeSurface(border);
SDL_Quit();
return 0;
}
If the line-
SDL_BlitSurface( logo, NULL, border, NULL, screen, NULL );
is changed to-
SDL_BlitSurface( border, NULL, screen, NULL );
or-
SDL_BlitSurface( logo, NULL, screen, NULL );
it will display one of the images with no problems at all. However I cannot find out how to make it show both images at once and avoid the above error message.
Also please feel free to let me know if I have any code that I do not need.
Thank you for your time.
Best regards,
Dan

New Topic/Question
Reply




MultiQuote




|