Need Help Its Pissing me off

Every time i start a new SDL project at college it works fine with linking the include, lib, VC++ etc. But when im home i do everything the same i get some stupid fucking error that i cannot fix.
So here's my problem...im trying to open a SLD windows with some text and when you press enter a new word appears on a different position, however i still havent coded it. Heres the code for the basic idea

#include <SDL.h>
#include <SDL_ttf.h>
using namespace std;

int main (int argc, char** argv)
{
SDL_Surface* screen;
SDL_Event evt;
TTF_Font* fnt;
TTF_Font* fnt2;
SDL_Surface* text;
SDL_Color txtColor;
SDL_Rect Position;
bool isRunning;

SDL_Init(SDL_INIT_EVERYTHING);
screen= SDL_SetVideoMode(640,480,32,SDL_HWSURFACE);
TTF_Init();
isRunning = true;
fnt = TTF_OpenFont("LaNegrita.ttf",32);
txtColor.r = 255; txtColor.g = 120; txtColor.b=69;
text = TTF_RenderText_Solid(fnt,"Hello",txtColor);

while(isRunning)
{
while(SDL_PollEvent(&evt)){
if (evt.type == SDL_QUIT){
isRunning = false;
}
if(evt.type == SDL_KEYUP)
{
if(evt.key.keysym.sym == SDLK_RETURN)
{
txtColor.r = 155; txtColor.b = 120; txtColor.g = 69;
text = TTF_RenderText_Solid(fnt,"Me Gusta", txtColor);
}
}
}

SDL_BlitSurface(text,NULL,screen,NULL);
SDL_BlitSurface(text,NULL,screen,NULL);
SDL_Flip(screen);
}

SDL_FreeSurface(text);
TTF_CloseFont(fnt);
TTF_CloseFont(fnt2);
TTF_Quit();
SDL_Quit();
return 0;

}



Theres nothing wrong that i can see...can someone please spot it??? also excuse me for being kinda new, ive been learning it for since september
What is the error you are getting?
Topic archived. No new replies allowed.