Beginners_-_Print_DebugConsole.c 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #include "raylib.h"
  2. // You need these 2 includes for printing debug info to the console...
  3. #include <stdio.h>
  4. #include <unistd.h>
  5. int main(void)
  6. {
  7. // Initialization
  8. //--------------------------------------------------------------------------------------
  9. const int screenWidth = 800;
  10. const int screenHeight = 450;
  11. InitWindow(screenWidth, screenHeight, "raylib example.");
  12. SetTargetFPS(60); // Set our game to run at 60 frames-per-second
  13. //--------------------------------------------------------------------------------------
  14. int test1=100;
  15. int test2=500;
  16. // Here we print to the console.
  17. fprintf(stderr, "testing.\n"); // '\n' is line feed
  18. fprintf(stderr, "this value here :%i\n",test1);
  19. fprintf(stderr, "this value here :%i and that value there :%i\n",test1,test2);
  20. // Main game loop
  21. while (!WindowShouldClose()) // Detect window close button or ESC key
  22. {
  23. // Update
  24. //----------------------------------------------------------------------------------
  25. //----------------------------------------------------------------------------------
  26. // Draw
  27. //----------------------------------------------------------------------------------
  28. BeginDrawing();
  29. ClearBackground(RAYWHITE);
  30. EndDrawing();
  31. //----------------------------------------------------------------------------------
  32. }
  33. // De-Initialization
  34. //--------------------------------------------------------------------------------------
  35. CloseWindow(); // Close window and OpenGL context
  36. //--------------------------------------------------------------------------------------
  37. return 0;
  38. }