Testing out SDL for the first time
So I testing SDL for the first time using lazy foo Tutorials. Compared to any lua engines/api's, SDL is overwhelming. look at this code this is just to post up a image on a screen.
#include <SDL/SDL.h> using namespace std; int main(int argc, char*args[]) { //the image SDL_Surface*hello = NULL; SDL_Surface*screen = NULL; //start sdl SDL_Init(SDL_INIT_EVERYTHING); //SETUP SCREEN screen = SDL_SetVideoMode(640, 480, 32, SDL_SWSURFACE); //LOAD IMAGE hello = SDL_LoadBMP("hello.bmp"); //Apply image to screen SDL_BlitSurface(hello, NULL, screen, NULL); //update sreen SDL_Flip(screen); // int i = i + 1 ; //pause // SDL_Delay(i ); SDL_Delay(9000 );
//Free the loaded image SDL_FreeSurface( hello ); //Quit SDL SDL_Quit(); return 0; }
Maybe it will get easier overtime and I'm not complying I'm just a little shock too see the amount of effort you have to put in just to post a image up.










