raylib/examples/shapes/shapes_logo_raylib.c

56 lines
2.2 KiB
C
Raw Normal View History

/*******************************************************************************************
*
* raylib [shapes] example - Draw raylib logo using basic shapes
*
2013-11-23 16:35:14 +04:00
* 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) 2014 Ramon Santamaria (@raysan5)
*
********************************************************************************************/
#include "raylib.h"
2019-05-20 17:36:42 +03:00
int main(void)
{
// Initialization
//--------------------------------------------------------------------------------------
2019-05-20 17:36:42 +03:00
const int screenWidth = 800;
const int screenHeight = 450;
2014-09-30 01:41:05 +04:00
InitWindow(screenWidth, screenHeight, "raylib [shapes] example - raylib logo using shapes");
2019-05-20 17:36:42 +03:00
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
//--------------------------------------------------------------------------------------
2014-09-30 01:41:05 +04:00
// Main game loop
2013-11-23 15:58:16 +04:00
while (!WindowShouldClose()) // Detect window close button or ESC key
{
2013-11-23 15:58:16 +04:00
// Update
//----------------------------------------------------------------------------------
2013-11-23 15:58:16 +04:00
// TODO: Update your variables here
//----------------------------------------------------------------------------------
2014-09-30 01:41:05 +04:00
2013-11-23 15:58:16 +04:00
// Draw
//----------------------------------------------------------------------------------
2013-11-23 15:58:16 +04:00
BeginDrawing();
2014-09-30 01:41:05 +04:00
2013-11-23 15:58:16 +04:00
ClearBackground(RAYWHITE);
2014-09-30 01:41:05 +04:00
2013-11-23 15:58:16 +04:00
DrawRectangle(screenWidth/2 - 128, screenHeight/2 - 128, 256, 256, BLACK);
DrawRectangle(screenWidth/2 - 112, screenHeight/2 - 112, 224, 224, RAYWHITE);
DrawText("raylib", screenWidth/2 - 44, screenHeight/2 + 48, 50, BLACK);
2014-09-30 01:41:05 +04:00
DrawText("this is NOT a texture!", 350, 370, 10, GRAY);
2014-09-30 01:41:05 +04:00
EndDrawing();
//----------------------------------------------------------------------------------
}
2013-11-23 15:58:16 +04:00
// De-Initialization
//--------------------------------------------------------------------------------------
2013-11-23 15:58:16 +04:00
CloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------
2014-09-30 01:41:05 +04:00
return 0;
}