Review ALL examples

This commit is contained in:
Ray
2019-05-20 16:36:42 +02:00
parent a43a7980a3
commit b525039e0a
96 changed files with 1301 additions and 1317 deletions

View File

@ -16,7 +16,7 @@
#define RAYGUI_IMPLEMENTATION
#include "raygui.h" // Required for GUI controls
int main()
int main(void)
{
// Initialization
//--------------------------------------------------------------------------------------
@ -29,16 +29,16 @@ int main()
float innerRadius = 80.0f;
float outerRadius = 190.0f;
int startAngle = 0;
int endAngle = 360;
int segments = 0;
bool drawRing = true;
bool drawRingLines = false;
bool drawCircleLines = false;
SetTargetFPS(60);
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
//--------------------------------------------------------------------------------------
// Main game loop
@ -48,13 +48,13 @@ int main()
//----------------------------------------------------------------------------------
// NOTE: All variables update happens inside GUI control functions
//----------------------------------------------------------------------------------
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(RAYWHITE);
DrawLine(500, 0, 500, GetScreenHeight(), Fade(LIGHTGRAY, 0.6f));
DrawRectangle(500, 0, GetScreenWidth() - 500, GetScreenHeight(), Fade(LIGHTGRAY, 0.3f));
@ -66,27 +66,27 @@ int main()
//------------------------------------------------------------------------------
startAngle = GuiSliderBar((Rectangle){ 600, 40, 120, 20 }, "StartAngle", startAngle, -450, 450, true);
endAngle = GuiSliderBar((Rectangle){ 600, 70, 120, 20 }, "EndAngle", endAngle, -450, 450, true);
innerRadius = GuiSliderBar((Rectangle){ 600, 140, 120, 20 }, "InnerRadius", innerRadius, 0, 100, true);
outerRadius = GuiSliderBar((Rectangle){ 600, 170, 120, 20 }, "OuterRadius", outerRadius, 0, 200, true);
segments = GuiSliderBar((Rectangle){ 600, 240, 120, 20 }, "Segments", segments, 0, 100, true);
drawRing = GuiCheckBox((Rectangle){ 600, 320, 20, 20 }, "Draw Ring", drawRing);
drawRingLines = GuiCheckBox((Rectangle){ 600, 350, 20, 20 }, "Draw RingLines", drawRingLines);
drawCircleLines = GuiCheckBox((Rectangle){ 600, 380, 20, 20 }, "Draw CircleLines", drawCircleLines);
//------------------------------------------------------------------------------
DrawText(FormatText("MODE: %s", (segments >= 4)? "MANUAL" : "AUTO"), 600, 270, 10, (segments >= 4)? MAROON : DARKGRAY);
DrawFPS(10, 10);
EndDrawing();
//----------------------------------------------------------------------------------
}
// De-Initialization
//--------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------
CloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------