Browse Source

Create Beginners_-_Print_DebugConsole.c

Rudy Boudewijn van Etten 5 years ago
parent
commit
f6608c0779
1 changed files with 52 additions and 0 deletions
  1. 52 0
      Beginners_-_Print_DebugConsole.c

+ 52 - 0
Beginners_-_Print_DebugConsole.c

@@ -0,0 +1,52 @@
+
+#include "raylib.h"
+// You need these 2 includes for printing debug info to the console...
+#include <stdio.h>
+#include <unistd.h>
+
+int main(void)
+{
+    // Initialization
+    //--------------------------------------------------------------------------------------
+    const int screenWidth = 800;
+    const int screenHeight = 450;
+
+    InitWindow(screenWidth, screenHeight, "raylib example.");
+ 
+    SetTargetFPS(60);               // Set our game to run at 60 frames-per-second
+    //--------------------------------------------------------------------------------------
+
+    int test1=100;
+    int test2=500;
+    // Here we print to the console.
+    fprintf(stderr, "testing.\n"); // '\n' is line feed
+    fprintf(stderr, "this value here :%i\n",test1);
+    fprintf(stderr, "this value here :%i and that value there :%i\n",test1,test2);
+    // Main game loop
+    while (!WindowShouldClose())    // Detect window close button or ESC key
+    {
+        // Update
+        //----------------------------------------------------------------------------------
+        
+        
+        //----------------------------------------------------------------------------------
+        // Draw
+        //----------------------------------------------------------------------------------
+        BeginDrawing();
+
+            ClearBackground(RAYWHITE);
+                
+
+        EndDrawing();
+        //----------------------------------------------------------------------------------
+    }
+
+    // De-Initialization
+    //--------------------------------------------------------------------------------------
+    CloseWindow();        // Close window and OpenGL context
+    //--------------------------------------------------------------------------------------
+
+    return 0;
+
+
+}