Skip to main content
changed inline to code block. Inline removed underscores.
Source Link
Casey
  • 2.1k
  • 2
  • 18
  • 27

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:

  1. You are using the old version of textprintf use 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);

  2. You are not calling acquire_screen() before you draw to the screen and release_screen() after you are done drawing.

  3. Most importantly, you are not having main return 0 at the end of the function.

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:

  1. You are using the old version of textprintf use the new version like so: textprintf_ex(screen, font, 0, 0, Text_Color_Red, -1, "Screen Resolution is: %dx%d -- Press ESC to quit !", SCREEN_W, SCREEN_H);

  2. You are not calling acquire_screen() before you draw to the screen and release_screen() after you are done drawing.

  3. Most importantly, you are not having main return 0 at the end of the function.

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:

  1. You are using the old version of textprintf use the new version like so:

    textprintf_ex(screen, font, 0, 0, Text_Color_Red, -1, "Screen Resolution is: %dx%d -- Press ESC to quit !", SCREEN_W, SCREEN_H);

  2. You are not calling acquire_screen() before you draw to the screen and release_screen() after you are done drawing.

  3. Most importantly, you are not having main return 0 at the end of the function.

Source Link
Casey
  • 2.1k
  • 2
  • 18
  • 27

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:

  1. You are using the old version of textprintf use the new version like so: textprintf_ex(screen, font, 0, 0, Text_Color_Red, -1, "Screen Resolution is: %dx%d -- Press ESC to quit !", SCREEN_W, SCREEN_H);

  2. You are not calling acquire_screen() before you draw to the screen and release_screen() after you are done drawing.

  3. Most importantly, you are not having main return 0 at the end of the function.