Running the debugger pointed to the textprintf line being the culprit. You have an extra parameter 10 in there that should not be there. Fixing that solved the problem.
HOWEVER, there are other problems with the code:
You are using the old version of
textprintfuse the new version like so:textprintf_ex(screen, font, 0, 0, Text_Color_Red,
textprintf_ex(screen, font, 0, 0, Text_Color_Red, -1, "Screen Resolution is: %dx%d -- Press ESC to quit !", SCREEN_W, SCREEN_H);-1, "Screen Resolution is: %dx%d -- Press ESC to quit !", SCREEN_W, SCREEN_H);You are not calling
acquire_screen()before you draw to the screen andrelease_screen()after you are done drawing.Most importantly, you are not having
mainreturn 0at the end of the function.