ex01_basic_window.c 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*******************************************************************************************
  2. *
  3. * raylib example 01 - Basic Window
  4. *
  5. * This example has been created using raylib 1.0 (www.raylib.com)
  6. * raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
  7. *
  8. * Copyright (c) 2013 Ramon Santamaria (Ray San - [email protected])
  9. *
  10. ********************************************************************************************/
  11. #include "raylib.h"
  12. int main()
  13. {
  14. int screenWidth = 800;
  15. int screenHeight = 450;
  16. // Initialization
  17. //---------------------------------------------------------
  18. InitWindow(screenWidth, screenHeight, "raylib example 01a - basic window"); // Window and context initialization
  19. //----------------------------------------------------------
  20. // Main game loop
  21. while (!WindowShouldClose()) // Detect window close button or ESC key
  22. {
  23. // Update
  24. //-----------------------------------------------------
  25. // TODO: Update your variables here
  26. //-----------------------------------------------------
  27. // Draw
  28. //-----------------------------------------------------
  29. BeginDrawing();
  30. ClearBackground(RAYWHITE);
  31. DrawText("Congrats! You created your first window!", 190, 200, 20, 1, LIGHTGRAY);
  32. EndDrawing();
  33. //-----------------------------------------------------
  34. }
  35. // De-Initialization
  36. //---------------------------------------------------------
  37. CloseWindow(); // Close window and OpenGL context
  38. //----------------------------------------------------------
  39. return 0;
  40. }