Avirell
25-05-2003, 14:04
Tach
Ich hab folgendes Programm (erfolgreich) komplliert, als ichs dann aber ausführen wollte kam dieser Fehler!
#include <stdlib.h>
#include "SDL.h"
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
SDL_Surface *display;
SDL_Surface *image;
SDL_Event event;
SDL_Rect dst;
if (SDL_Init(SDL_INIT_VIDEO) < 0)
{
cout << "Konnte SDL nicht einrichten: " << SDL_GetError() << "\n" << endl;
exit(1);
}
SDL_FillRect(display,NULL, SDL_MapRGB(display->format,0,0,255));
display = SDL_SetVideoMode(640,480,16, SDL_HWSURFACE | SDL_DOUBLEBUF);
if (display == NULL)
{
cout << "Konnte Display nicht einrichten: " << SDL_GetError() << "\n" << endl;
exit(1);
}
image = SDL_LoadBMP("tux.bmp");
if (image == NULL)
{
cout << "Konnte Bitmap nicht laden: " << SDL_GetError() << "\n" << endl;
exit(1);
}
dst.x = 200;
dst.y = 200;
dst.w = image->w;
dst.h = image->h;
SDL_SetColorKey(image,SDL_SRCCOLORKEY, SDL_MapRGB(image->format,255,0,255));
SDL_BlitSurface(image, NULL, display, &dst);
SDL_Flip(display);
atexit(SDL_Quit);
while(SDL_WaitEvent(&event) >= 0)
{
switch(event.type)
{
case SDL_QUIT:
SDL_FreeSurface(image);
exit(1);
break;
}
}
return 0;
}
Ich hab folgendes Programm (erfolgreich) komplliert, als ichs dann aber ausführen wollte kam dieser Fehler!
#include <stdlib.h>
#include "SDL.h"
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
SDL_Surface *display;
SDL_Surface *image;
SDL_Event event;
SDL_Rect dst;
if (SDL_Init(SDL_INIT_VIDEO) < 0)
{
cout << "Konnte SDL nicht einrichten: " << SDL_GetError() << "\n" << endl;
exit(1);
}
SDL_FillRect(display,NULL, SDL_MapRGB(display->format,0,0,255));
display = SDL_SetVideoMode(640,480,16, SDL_HWSURFACE | SDL_DOUBLEBUF);
if (display == NULL)
{
cout << "Konnte Display nicht einrichten: " << SDL_GetError() << "\n" << endl;
exit(1);
}
image = SDL_LoadBMP("tux.bmp");
if (image == NULL)
{
cout << "Konnte Bitmap nicht laden: " << SDL_GetError() << "\n" << endl;
exit(1);
}
dst.x = 200;
dst.y = 200;
dst.w = image->w;
dst.h = image->h;
SDL_SetColorKey(image,SDL_SRCCOLORKEY, SDL_MapRGB(image->format,255,0,255));
SDL_BlitSurface(image, NULL, display, &dst);
SDL_Flip(display);
atexit(SDL_Quit);
while(SDL_WaitEvent(&event) >= 0)
{
switch(event.type)
{
case SDL_QUIT:
SDL_FreeSurface(image);
exit(1);
break;
}
}
return 0;
}