raylib/ports/shapes/shapes_logo_raylib

Licence This example has its own licence, rather than Odin's: raylib/ports/LICENSE
These are ported Raylib examples, and as such, they are subject to Raylib's license. Copyright (c) 2013-2024 Ramon Santamaria (@raysan5)
The rest of the licence
This software is provided "as-is", without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution.
A screenshot of shapes_logo_raylib

Code

shapes_logo_raylib.odin ¶
61 linesSource

1/*******************************************************************************************
2*
3*   raylib [shapes] example - logo raylib
4*
5*   Example complexity rating: [★☆☆☆] 1/4
6*
7*   Example originally created with raylib 1.0, last time updated with raylib 1.0
8*
9*   Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
10*   BSD-like license that allows static linking with closed source software
11*
12*   Copyright (c) 2014-2025 Ramon Santamaria (@raysan5)
13*
14********************************************************************************************/
15
16package raylib_examples
17
18import rl "vendor:raylib"
19
20//------------------------------------------------------------------------------------
21// Program main entry point
22//------------------------------------------------------------------------------------
23main :: proc() {
24	// Initialization
25	//--------------------------------------------------------------------------------------
26	SCREEN_WIDTH :: 800
27	SCREEN_HEIGHT :: 450
28
29	rl.InitWindow(SCREEN_WIDTH, SCREEN_HEIGHT, "raylib [shapes] example - logo raylib")
30
31	rl.SetTargetFPS(60)               // Set our game to run at 60 frames-per-second
32	//--------------------------------------------------------------------------------------
33
34	// Main game loop
35	for !rl.WindowShouldClose() {    // Detect window close button or ESC key
36		// Update
37		//----------------------------------------------------------------------------------
38		// TODO: Update your variables here
39		//----------------------------------------------------------------------------------
40
41		// Draw
42		//----------------------------------------------------------------------------------
43		rl.BeginDrawing()
44
45			rl.ClearBackground(rl.RAYWHITE)
46
47			rl.DrawRectangle(rl.GetScreenWidth()/2 - 128, rl.GetScreenHeight()/2 - 128, 256, 256, rl.BLACK)
48			rl.DrawRectangle(rl.GetScreenWidth()/2 - 112, rl.GetScreenHeight()/2 - 112, 224, 224, rl.RAYWHITE)
49			rl.DrawText("raylib", rl.GetScreenWidth()/2 - 44, rl.GetScreenHeight()/2 + 48, 50, rl.BLACK)
50
51			rl.DrawText("this is NOT a texture!", 350, 370, 10, rl.GRAY)
52
53		rl.EndDrawing()
54		//----------------------------------------------------------------------------------
55	}
56
57	// De-Initialization
58	//--------------------------------------------------------------------------------------
59	rl.CloseWindow()        // Close window and OpenGL context
60	//--------------------------------------------------------------------------------------
61}

Declarations Used 14