raylib/examples/core_basic_window.c

62 lines
2.2 KiB
C
Raw Normal View History

/*******************************************************************************************
*
* raylib [core] example - Basic window
*
2015-01-02 22:58:06 +03:00
* 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)
*
2015-08-27 17:13:31 +03:00
* Copyright (c) 2014 Ramon Santamaria (@raysan5)
*
********************************************************************************************/
#include "raylib.h"
int main()
{
// Initialization
//--------------------------------------------------------------------------------------
int screenWidth = 800;
int screenHeight = 450;
2014-09-30 01:41:05 +04:00
InitWindow(screenWidth, screenHeight, "raylib [core] example - basic window");
2016-01-16 14:52:55 +03:00
SetTargetFPS(60);
//--------------------------------------------------------------------------------------
2014-09-30 01:41:05 +04:00
// Main game loop
while (!WindowShouldClose()) // Detect window close button or ESC key
{
// Update
//----------------------------------------------------------------------------------
// TODO: Update your variables here
//----------------------------------------------------------------------------------
2014-09-30 01:41:05 +04:00
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
2014-09-30 01:41:05 +04:00
ClearBackground(RAYWHITE);
2014-09-30 01:41:05 +04:00
DrawText("Congrats! You created your first window!", 190, 200, 20, LIGHTGRAY);
2014-09-30 01:41:05 +04:00
EndDrawing();
//----------------------------------------------------------------------------------
}
// De-Initialization
2015-08-27 17:13:31 +03:00
//--------------------------------------------------------------------------------------
CloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------
2014-09-30 01:41:05 +04:00
return 0;
}