Testing dark style loading

This commit is contained in:
raysan5
2017-12-25 17:23:40 +01:00
parent 92e44f7f89
commit a316d4e031
2 changed files with 11 additions and 13 deletions

View File

@ -46,19 +46,20 @@ int main(int argc, char *argv[0])
bool showImportPanel = false;
bool imageLoaded = false;
float imageScale = 1.0f;
InitWindow(SCREEN_WIDTH, SCREEN_HEIGHT, "raw image importer");
Texture2D texture = { 0 };
// Raw image import values
int width = 0;
int height = 0;
int format = UNCOMPRESSED_R8G8B8A8;
int headerSize = 0;
LoadGuiStyleImage("rguistyle_default_dark.png");
InitWindow(SCREEN_WIDTH, SCREEN_HEIGHT, "raw image importer");
Texture2D texture = { 0 };
SetTargetFPS(60);
//--------------------------------------------------------------------------------------
@ -142,28 +143,25 @@ int main(int argc, char *argv[0])
}
}
if (imageLoaded)
{
// Image scale control
imageScale += (float)GetMouseWheelMove();
}
if (imageLoaded) imageScale += (float)GetMouseWheelMove(); // Image scale control
//----------------------------------------------------------------------------------
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(RAYWHITE);
ClearBackground(GuiBackgroundColor());
DrawRectangleLines(10, 10, SCREEN_WIDTH - 20, SCREEN_HEIGHT - 20, GuiLinesColor());
if (texture.id != 0)
{
DrawTextureEx(texture, (Vector2){ SCREEN_WIDTH/2 - texture.width*imageScale/2, SCREEN_HEIGHT/2 - texture.height*imageScale/2 }, 0, imageScale, WHITE);
DrawText(FormatText("SCALE x%.0f", imageScale), 20, SCREEN_HEIGHT - 40, 20, LIGHTGRAY);
DrawText(FormatText("SCALE x%.0f", imageScale), 20, SCREEN_HEIGHT - 40, 20, GuiTextColor());
}
else DrawText("drag & drop RAW image file", 320, 180, 10, GRAY);
else DrawText("drag & drop RAW image file", 320, 180, 10, GuiTextColor());
if (showImportPanel)
{

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB