소스 검색

Create Beginners_-_GetScreenWidthHeight.c

Rudy Boudewijn van Etten 5 년 전
부모
커밋
4e53f929a4
1개의 변경된 파일46개의 추가작업 그리고 0개의 파일을 삭제
  1. 46 0
      Beginners_-_GetScreenWidthHeight.c

+ 46 - 0
Beginners_-_GetScreenWidthHeight.c

@@ -0,0 +1,46 @@
+
+#include "raylib.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
+    //--------------------------------------------------------------------------------------
+
+    // Main game loop
+    while (!WindowShouldClose())    // Detect window close button or ESC key
+    {
+        // Update
+        //----------------------------------------------------------------------------------
+        
+        
+        //----------------------------------------------------------------------------------
+        // Draw
+        //----------------------------------------------------------------------------------
+        BeginDrawing();
+
+            ClearBackground(RAYWHITE);
+
+            DrawText(FormatText("GetScreenWidth() : %i",GetScreenWidth()),100,100,20,GRAY);
+            DrawText(FormatText("GetScreenHeight() : %i",GetScreenHeight()),100,120,20,GRAY);
+
+        EndDrawing();
+        //----------------------------------------------------------------------------------
+    }
+
+    // De-Initialization
+    //--------------------------------------------------------------------------------------
+    CloseWindow();        // Close window and OpenGL context
+    //--------------------------------------------------------------------------------------
+
+    return 0;
+
+
+}