Ok, I have tried all that and still nothing! I have no idea why it won't freaking stay up. Anyone else? PLEASE!
EDIT:HERE IS SOME OF MY NEW CODE. THIS IS FROM MY NEW MAIN MENU. IT WON'T STAY UP FOR SOMEREASON.
Draw_Text("(P)lay Game", 24, WINDOW_WIDTH/2, WINDOW_HEIGHT/2, 255, 255, 255, 0, 0, 0); Draw_Text("(E)xit Game", 24, WINDOW_WIDTH/2+20, WINDOW_HEIGHT/2+20, 255, 255, 255, 0, 0, 0); Uint8* KeysHeld= SDL_GetKeyState(0); if(KeysHeld[SDLK_p]) { Init(); KeysHeld[SDLK_p]=0; } if(KeysHeld[SDLK_e]) { SDL_Quit(); KeysHeld[SDLK_e]=0; }
and the Draw_Text function:
void Draw_Text(char* string, int size, int x, int y, int fr, int fg, int fb, int br, int bg, int bb){ TTF_Font* font = TTF_OpenFont("lazy.ttf", size); SDL_Color fgc={fr, fg, fb}; SDL_Color bgc={br, bg, bb}; SDL_Surface* textsurface= TTF_RenderText_Shaded(font, string, fgc, bgc); SDL_Rect textlocation={x, y, 0, 0}; SDL_BlitSurface(textsurface, NULL, SDL_GetVideoSurface(), &textlocation); SDL_FreeSurface(textsurface); TTF_CloseFont(font);}
the Main menu text comes up. I read it, then it goes. Why won't it stay again? I think it should be so simple, but it not! lol.
Chad!
[Edited by - Chad Smith on October 11, 2005 9:03:43 PM]