Skip to content

Commit ef088e9

Browse files
add test for jpg support #89
1 parent 32f1d34 commit ef088e9

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

tests/test_jpg_support.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"examples/textures/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()

0 commit comments

Comments
 (0)