Skip to main content

gamelib: A library for creating 3d applications in python.

Project description

Tests

gamelib

This is a library I've been working on for writing 3d applications in python. You'll need to know at least a little bit about writing shaders in glsl to be effective with this library, though I do plan to include default implementations in the future.

Prerequisites

This package requires support for OpenGL 3.3 or later, depends on gcc and currently supports python >= 3.8

Installation

Optionally create a virtual environment:

python3 -m venv venv
. venv/bin/activate

Install with pip:

pip install gamelib

Usage

Detailed usage documentation can be found in the modules themselves, to get started you should import gamelib and init must be called before doing anything involving the window or OpenGL context, so it's recommended to call at the entry point to your application.

import gamelib

gamelib.init()

Update should be called on a loop to not hang the application.

while gamelib.is_running():
    gamelib.update()

To avoid hanging the main loop while executing a long running task, you can use the internal schedules.

def my_long_running_function():
    time.sleep(1)

gamelib.threaded_schedule.once(my_long_running_function, -1)

As mentioned above, see the modules for further documentation, or refer to example applications linked below.

Running the test suite

To run the tests you'll first need to get the source and install both the requirements and requirements-dev dependencies.

git clone https://github.com/peffjepin/gamelib.git
cd gamelib
pip install -r requirements.txt
pip install -r requirements-dev.txt

Then to run the tests simply:

pytest

For testing against different python versions you can run tox. The tox environment is set up to skip tests that require an opengl context.

tox

For a coverage report:

pytest --cov=gamelib --cov-report=html

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gamelib-0.0.2.tar.gz (72.7 kB view details)

Uploaded Source

Built Distributions

gamelib-0.0.2-py3.10.egg (172.0 kB view details)

Uploaded Source

gamelib-0.0.2-py3-none-any.whl (81.6 kB view details)

Uploaded Python 3

File details

Details for the file gamelib-0.0.2.tar.gz.

File metadata

  • Download URL: gamelib-0.0.2.tar.gz
  • Upload date:
  • Size: 72.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for gamelib-0.0.2.tar.gz
Algorithm Hash digest
SHA256 ee48ee2f25acd685be03f0ddeece6cfe49cd5a8813099fb71bbf0c6ce843cb14
MD5 9748d2c7541d5d7c7a9ce7c975eb79a4
BLAKE2b-256 a9c40e67c96c7a8ce75fad749289c3680c28e0e8b583fd4eb3f1f60a8af3de2c

See more details on using hashes here.

File details

Details for the file gamelib-0.0.2-py3.10.egg.

File metadata

  • Download URL: gamelib-0.0.2-py3.10.egg
  • Upload date:
  • Size: 172.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for gamelib-0.0.2-py3.10.egg
Algorithm Hash digest
SHA256 2455df7120a771b2954f724adafd29a4fe01bb6c0b1cc456aa4b6cd28fbaf642
MD5 c65f81ca33fe8540fdd46f2fa3e1d2c8
BLAKE2b-256 875dbfba735b0670040f18372846d5eb1f803dcee2a59291b5bec105cf2ba932

See more details on using hashes here.

File details

Details for the file gamelib-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: gamelib-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 81.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for gamelib-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1688cf5f050b7276c54083c024c9cc64240e262cef6935ed63fcd68ba1ba9147
MD5 04c1c3f1dcc7b2fd8c39de6f3c3cb3ed
BLAKE2b-256 930d562cf68187b6e2097fa2e9ba5c40146a7b04b711d44baf34fef5033c84a7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page