diff options
| author | Ahmad Fatoum <[email protected]> | 2018-07-29 18:23:23 +0200 |
|---|---|---|
| committer | Ahmad Fatoum <[email protected]> | 2018-07-29 18:27:59 +0200 |
| commit | e82505b873370b8f3a914a079062c21e64353210 (patch) | |
| tree | 92e16ff3e7dfb4b4e7696fa58cb67781a0fea5ff /projects/CMake/core_basic_window.c | |
| parent | 548dbeb1ca1e62a4893bb7041228915a97cd5b0e (diff) | |
| download | raylib-e82505b873370b8f3a914a079062c21e64353210.tar.gz raylib-e82505b873370b8f3a914a079062c21e64353210.zip | |
Add projects/CMake example
The CMakeLists.txt checks for an installed raylib and downloads and
installs one if none is found. Afterwards, it builds core_basic_window.c
Diffstat (limited to 'projects/CMake/core_basic_window.c')
| -rw-r--r-- | projects/CMake/core_basic_window.c | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/projects/CMake/core_basic_window.c b/projects/CMake/core_basic_window.c new file mode 100644 index 00000000..176f46c9 --- /dev/null +++ b/projects/CMake/core_basic_window.c @@ -0,0 +1,62 @@ +/******************************************************************************************* +* +* raylib [core] example - Basic window +* +* Welcome to raylib! +* +* To test examples, just press F6 and execute raylib_compile_execute script +* Note that compiled executable is placed in the same folder as .c file +* +* You can find all basic examples on C:\raylib\raylib\examples folder or +* raylib official webpage: www.raylib.com +* +* Enjoy using raylib. :) +* +* This example has been created using raylib 1.0 (www.raylib.com) +* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) +* +* Copyright (c) 2013-2016 Ramon Santamaria (@raysan5) +* +********************************************************************************************/ + +#include "raylib.h" + +int main() +{ + // Initialization + //-------------------------------------------------------------------------------------- + int screenWidth = 800; + int screenHeight = 450; + + InitWindow(screenWidth, screenHeight, "raylib [core] example - basic window"); + + SetTargetFPS(60); + //-------------------------------------------------------------------------------------- + + // Main game loop + while (!WindowShouldClose()) // Detect window close button or ESC key + { + // Update + //---------------------------------------------------------------------------------- + // TODO: Update your variables here + //---------------------------------------------------------------------------------- + + // Draw + //---------------------------------------------------------------------------------- + BeginDrawing(); + + ClearBackground(RAYWHITE); + + DrawText("Congrats! You created your first window!", 190, 200, 20, LIGHTGRAY); + + EndDrawing(); + //---------------------------------------------------------------------------------- + } + + // De-Initialization + //-------------------------------------------------------------------------------------- + CloseWindow(); // Close window and OpenGL context + //-------------------------------------------------------------------------------------- + + return 0; +} |
