add test for jpg support https://github.com/electronstudio/raylib-python-cffi/issues/89
This commit is contained in:
parent
32f1d34c82
commit
ef088e91f2
1 changed files with 31 additions and 0 deletions
31
tests/test_jpg_support.py
Normal file
31
tests/test_jpg_support.py
Normal file
|
@ -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()
|
Reference in a new issue