diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b162258..2232c04 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -84,7 +84,7 @@ jobs: cd raylib-c mkdir build cd build - cmake -DINCLUDE_EVERYTHING=on -DWITH_PIC=on -DCMAKE_BUILD_TYPE=Release .. + cmake -DINCLUDE_EVERYTHING=on -DSUPPORT_FILEFORMAT_JPG -DWITH_PIC=on -DCMAKE_BUILD_TYPE=Release .. make -j2 sudo make install - name: Build raylib-python-cffi @@ -131,7 +131,7 @@ jobs: cd raylib-c mkdir build cd build - cmake -DINCLUDE_EVERYTHING=on -DWITH_PIC=on -DCMAKE_BUILD_TYPE=Release .. + cmake -DINCLUDE_EVERYTHING=on -DSUPPORT_FILEFORMAT_JPG -DWITH_PIC=on -DCMAKE_BUILD_TYPE=Release .. msbuild raylib.sln /target:raylib /property:Configuration=Release copy raylib\Release\raylib.lib ..\.. cd ..\.. diff --git a/examples/textures/image_loading.py b/examples/textures/image_loading.py new file mode 100644 index 0000000..0ff6a52 --- /dev/null +++ b/examples/textures/image_loading.py @@ -0,0 +1,31 @@ +from raylib import * + +screenWidth = 800 +screenHeight = 450 + +InitWindow(screenWidth, screenHeight, b"raylib [textures] example - image loading") + + + +image = LoadImage(b"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() diff --git a/examples/textures/resources/raylib_logo.jpg b/examples/textures/resources/raylib_logo.jpg new file mode 100644 index 0000000..cb4ee4c Binary files /dev/null and b/examples/textures/resources/raylib_logo.jpg differ diff --git a/examples/textures/resources/raylib_logo.png b/examples/textures/resources/raylib_logo.png new file mode 100644 index 0000000..15bbaa2 Binary files /dev/null and b/examples/textures/resources/raylib_logo.png differ