From cb7a574555671379a3ce1093f7eae2936cb7e98a Mon Sep 17 00:00:00 2001 From: richard Date: Thu, 23 Sep 2021 11:15:51 +0100 Subject: [PATCH] change how PyRay detects pointers --- raylib/__init__.py | 2 +- raylib/pyray.py | 2 +- setup.py | 2 +- test_pyray.py | 3 +++ 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/raylib/__init__.py b/raylib/__init__.py index 8c2f7c6..3944a07 100644 --- a/raylib/__init__.py +++ b/raylib/__init__.py @@ -1,4 +1,4 @@ -__version__ = "3.7.0.post4" +__version__ = "3.7.0.post5" # Copyright (c) 2021 Richard Smith and others # diff --git a/raylib/pyray.py b/raylib/pyray.py index 0f4d1cf..da9b6e9 100644 --- a/raylib/pyray.py +++ b/raylib/pyray.py @@ -31,7 +31,7 @@ def makefunc(a): if type(arg) == str: encoded = arg.encode('utf-8') modified_args.append(encoded) - elif c_arg.kind == 'pointer': + elif c_arg.kind == 'pointer' and str(type(arg)) == "": modified_args.append(ffi.addressof(arg)) else: modified_args.append(arg) diff --git a/setup.py b/setup.py index bdf369c..73efbe8 100644 --- a/setup.py +++ b/setup.py @@ -16,7 +16,7 @@ class BinaryDistribution(Distribution): # This call to setup() does all the work setup( name="raylib", - version="3.7.0.post4", + version="3.7.0.post5", description="Python CFFI bindings for Raylib", long_description=README, long_description_content_type="text/markdown", diff --git a/test_pyray.py b/test_pyray.py index d246c19..ba49841 100644 --- a/test_pyray.py +++ b/test_pyray.py @@ -10,6 +10,9 @@ pyray = PyRay() pyray.init_window(800, 450, "Raylib texture test") pyray.set_target_fps(60) +image = pyray.gen_image_color(800, 400, (0,0,0,255) ) +texture = pyray.load_texture_from_image(image) +pyray.update_texture(texture, image.data) camera = pyray.Camera3D([18.0, 16.0, 18.0], [0.0, 0.0, 0.0], [0.0, 1.0, 0.0], 45.0, 0) image = pyray.load_image("examples/models/resources/heightmap.png")