From ef088e91f28b725c1824daf87df1b56bf47c5c2c Mon Sep 17 00:00:00 2001 From: richard Date: Fri, 23 Sep 2022 19:44:37 +0100 Subject: [PATCH] add test for jpg support https://github.com/electronstudio/raylib-python-cffi/issues/89 --- tests/test_jpg_support.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 tests/test_jpg_support.py diff --git a/tests/test_jpg_support.py b/tests/test_jpg_support.py new file mode 100644 index 0000000..3538558 --- /dev/null +++ b/tests/test_jpg_support.py @@ -0,0 +1,31 @@ +from raylib import * + +screenWidth = 800 +screenHeight = 450 + +InitWindow(screenWidth, screenHeight, b"raylib [textures] example - image loading") + + + +image = LoadImage(b"examples/textures/resources/raylib_logo.jpg") +texture = LoadTextureFromImage(image) + +UnloadImage(image) + +while not WindowShouldClose(): + + BeginDrawing() + + ClearBackground(RAYWHITE) + + DrawTexture(texture, int(screenWidth/2 - texture.width/2), int(screenHeight/2 - texture.height/2), WHITE) + + DrawText(b"this IS a texture loaded from an image!", 300, 370, 10, GRAY) + + EndDrawing() + + + + +UnloadTexture(texture) +CloseWindow()