Skip to content

Commit 8666f0c

Browse files
test jpeg image loading
1 parent 7b24610 commit 8666f0c

File tree

4 files changed

+33
-2
lines changed

4 files changed

+33
-2
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ jobs:
8484
cd raylib-c
8585
mkdir build
8686
cd build
87-
cmake -DINCLUDE_EVERYTHING=on -DWITH_PIC=on -DCMAKE_BUILD_TYPE=Release ..
87+
cmake -DINCLUDE_EVERYTHING=on -DSUPPORT_FILEFORMAT_JPG -DWITH_PIC=on -DCMAKE_BUILD_TYPE=Release ..
8888
make -j2
8989
sudo make install
9090
- name: Build raylib-python-cffi
@@ -131,7 +131,7 @@ jobs:
131131
cd raylib-c
132132
mkdir build
133133
cd build
134-
cmake -DINCLUDE_EVERYTHING=on -DWITH_PIC=on -DCMAKE_BUILD_TYPE=Release ..
134+
cmake -DINCLUDE_EVERYTHING=on -DSUPPORT_FILEFORMAT_JPG -DWITH_PIC=on -DCMAKE_BUILD_TYPE=Release ..
135135
msbuild raylib.sln /target:raylib /property:Configuration=Release
136136
copy raylib\Release\raylib.lib ..\..
137137
cd ..\..

examples/textures/image_loading.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
from raylib import *
2+
3+
screenWidth = 800
4+
screenHeight = 450
5+
6+
InitWindow(screenWidth, screenHeight, b"raylib [textures] example - image loading")
7+
8+
9+
10+
image = LoadImage(b"resources/raylib_logo.jpg")
11+
texture = LoadTextureFromImage(image)
12+
13+
UnloadImage(image)
14+
15+
while not WindowShouldClose():
16+
17+
BeginDrawing()
18+
19+
ClearBackground(RAYWHITE)
20+
21+
DrawTexture(texture, int(screenWidth/2 - texture.width/2), int(screenHeight/2 - texture.height/2), WHITE)
22+
23+
DrawText(b"this IS a texture loaded from an image!", 300, 370, 10, GRAY)
24+
25+
EndDrawing()
26+
27+
28+
29+
30+
UnloadTexture(texture)
31+
CloseWindow()
3.24 KB
Loading
3.59 KB
Loading

0 commit comments

Comments
 (0)