Update examples

This commit is contained in:
Ray
2019-07-03 01:29:18 +02:00
parent a33d53cd75
commit 511c2254c9
2 changed files with 13 additions and 9 deletions

View File

@ -22,7 +22,7 @@
#include <string.h> // Required for: strcpy()
#include <stdlib.h> // Required for: atoi()
#include <math.h> // Required for: round()
//------------------------------------------------------------------------------------
// Program main entry point
@ -168,14 +168,14 @@ int main()
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(GetColor(style[DEFAULT_BACKGROUND_COLOR]));
ClearBackground(GetColor(GuiGetStyle(DEFAULT, BACKGROUND_COLOR)));
if (texture.id != 0)
{
DrawTextureEx(texture, (Vector2){ screenWidth/2 - texture.width*imageScale/2, screenHeight/2 - texture.height*imageScale/2 }, 0, imageScale, WHITE);
DrawText(FormatText("SCALE x%.0f", imageScale), 20, screenHeight - 40, 20, GetColor(style[DEFAULT_LINES_COLOR]));
DrawText(FormatText("SCALE x%.0f", imageScale), 20, screenHeight - 40, 20, GetColor(GuiGetStyle(DEFAULT, LINE_COLOR)));
}
else DrawText("drag & drop RAW image file", 320, 180, 10, GetColor(style[DEFAULT_LINES_COLOR]));
else DrawText("drag & drop RAW image file", 320, 180, 10, GetColor(GuiGetStyle(DEFAULT, LINE_COLOR)));
// raygui: controls drawing
//----------------------------------------------------------------------------------
@ -195,14 +195,14 @@ int main()
if (GuiValueBox((Rectangle){ windowOffset.x + 60, windowOffset.y + 130, 80, 25 }, &heightValue, 0, 8192, heightEditMode)) heightEditMode = !heightEditMode;
GuiLabel((Rectangle){ windowOffset.x + 145, windowOffset.y + 130, 30, 25 }, "pixels");
GuiGroupBox((Rectangle){ windowOffset.x + 10, windowOffset.y + 180, 180, 160 }, "Pixel Format");
pixelFormatActive = GuiComboBox((Rectangle){ windowOffset.x + 20, windowOffset.y + 195, 160, 25 }, pixelFormatTextList, 8, pixelFormatActive);
GuiLine((Rectangle){ windowOffset.x + 20, windowOffset.y + 220, 160, 20 }, 1);
pixelFormatActive = GuiComboBox((Rectangle){ windowOffset.x + 20, windowOffset.y + 195, 160, 25 }, TextJoin(pixelFormatTextList, 8, ";"), pixelFormatActive);
GuiLine((Rectangle){ windowOffset.x + 20, windowOffset.y + 220, 160, 20 }, NULL);
if (pixelFormatActive != 0) GuiDisable();
GuiLabel((Rectangle){ windowOffset.x + 20, windowOffset.y + 235, 50, 20 }, "Channels:");
channelsActive = GuiToggleGroup((Rectangle){ windowOffset.x + 20, windowOffset.y + 255, 159, 25 }, channelsTextList, 4, channelsActive);
channelsActive = GuiToggleGroup((Rectangle){ windowOffset.x + 20, windowOffset.y + 255, 156/4, 25 }, TextJoin(channelsTextList, 4, ";"), channelsActive);
GuiLabel((Rectangle){ windowOffset.x + 20, windowOffset.y + 285, 50, 20 }, "Bit Depth:");
bitDepthActive = GuiToggleGroup((Rectangle){ windowOffset.x + 20, windowOffset.y + 305, 159, 25 }, bitDepthTextList, 3, bitDepthActive);
bitDepthActive = GuiToggleGroup((Rectangle){ windowOffset.x + 20, windowOffset.y + 305, 160/3, 25 }, TextJoin(bitDepthTextList, 3, ";"), bitDepthActive);
GuiEnable();
GuiGroupBox((Rectangle){ windowOffset.x + 10, windowOffset.y + 355, 180, 50 }, "Header");