main.c 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*******************************************************************************************
  2. *
  3. * raylib [core] example - Basic window
  4. *
  5. * This example has been created using raylib 3.8 (www.raylib.com)
  6. * raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
  7. *
  8. * Example contributed by <user_name> (@<user_github>) and reviewed by Ramon Santamaria (@raysan5)
  9. *
  10. * Copyright (c) 2021 <user_name> (@<user_github>)
  11. * Adapt for Visual Studio: Vadim Boev (Kronka Dev)
  12. *
  13. ********************************************************************************************/
  14. #include "android_native_app_glue.h"
  15. #include "../../../../src/raylib.h"
  16. int main(void)
  17. {
  18. // Initialization
  19. //--------------------------------------------------------------------------------------
  20. const int screenWidth = 800;
  21. const int screenHeight = 450;
  22. InitWindow(screenWidth, screenHeight, "raylib [core] example - basic window");
  23. // TODO: Load resources / Initialize variables at this point
  24. SetTargetFPS(60);
  25. //--------------------------------------------------------------------------------------
  26. // Main game loop
  27. while (!WindowShouldClose()) // Detect window close button or ESC key
  28. {
  29. // Update
  30. //----------------------------------------------------------------------------------
  31. // TODO: Update variables / Implement example logic at this point
  32. //----------------------------------------------------------------------------------
  33. // Draw
  34. //----------------------------------------------------------------------------------
  35. BeginDrawing();
  36. ClearBackground(RAYWHITE);
  37. // TODO: Draw everything that requires to be drawn at this point:
  38. DrawText("Congrats! You created your first window!", 190, 200, 20, LIGHTGRAY); // Example
  39. EndDrawing();
  40. //----------------------------------------------------------------------------------
  41. }
  42. // De-Initialization
  43. //--------------------------------------------------------------------------------------
  44. // TODO: Unload all loaded resources at this point
  45. CloseWindow(); // Close window and OpenGL context
  46. //--------------------------------------------------------------------------------------
  47. return 0;
  48. }