Files
raylib-cpp/examples/shapes/shapes_logo_raylib.cpp
2020-04-06 18:39:56 -04:00

55 lines
2.1 KiB
C++

/*******************************************************************************************
*
* raylib [shapes] example - Draw raylib logo using basic shapes
*
* 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/raylib.hpp"
int main()
{
// Initialization
//--------------------------------------------------------------------------------------
const int screenWidth = 800;
const int screenHeight = 450;
raylib::Window w(screenWidth, screenHeight, "raylib [shapes] example - raylib logo using shapes");
raylib::Color foreground = raylib::Color(0, 68, 130);
raylib::Color background = raylib::Color::RayWhite;
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
//--------------------------------------------------------------------------------------
// Main game loop
while (!w.ShouldClose()) // Detect window close button or ESC key
{
// Update
//----------------------------------------------------------------------------------
// TODO: Update your variables here
//----------------------------------------------------------------------------------
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
background.ClearBackground();
foreground.DrawRectangle(screenWidth/2 - 128, screenHeight/2 - 128, 256, 256);
background.DrawRectangle(screenWidth/2 - 112, screenHeight/2 - 112, 224, 224);
foreground.DrawText("raylib", screenWidth/2 - 44, screenHeight/2 + 24, 50);
foreground.DrawText("cpp", screenWidth/2 - 74, screenHeight/2 + 54, 50);
DrawText("this is NOT a texture!", 350, 370, 10, GRAY);
EndDrawing();
//----------------------------------------------------------------------------------
}
return 0;
}