我已經開始用SDL在C++中製作遊戲。我的代碼是:C++和SDL中的遊戲程序。 'SLD_Flip'錯誤
的main.cpp
#include "SDL/SDL.h"
#include "gameSystem.h"
int main(int argc, char *args[])
{
gameSystem systemHandler;
SDL_Surface *buffer;
SDL_Event event;
while(event.type != SDL_QUIT)
{
SDL_PollEvent(&event);
SLD_Flip(buffer);
}
}
gameSystem.cpp
#include "SDL/SDL.h"
#include "gameSystem.h"
gameSystem::gameSystem()
{
SDL_Init(SDL_INIT_EVERYTHING);
SDL_WM_SetCaption("GameName", NULL);
SDL_Surface *buffer;
bool fullscreen = false;
if (fullscreen == true)
{buffer = SDL_SetVideoMode(640, 480, 32, SDL_SWSURFACE | SDL_FULLSCREEN);}
else
{buffer = SDL_SetVideoMode(640, 480, 32, SDL_SWSURFACE);}
}
gameSystem::~gameSystem()
{
SDL_Quit();
}
gameSystem.h
class gameSystem
{
public:
gameSystem();
~gameSystem();
private:
SDL_Surface *buffer;
};
我的連接選項包括:-lmingw32 -lSDLmain -lSDL - lwinmm -sdl_Mixer
I出現以下錯誤:「error:'SLD_Flip'未在此範圍內聲明」main.cpp的第12行。
所有其他的SDL函數似乎沒問題。
有誰知道如何解決這個問題?
SDL,SDL,SDL,SDL ... SLD ?! – arul 2012-07-06 02:08:08