No project description provided
Project description
glnext
Example
import glnext
from glnext_compiler import glsl
from PIL import Image
instance = glnext.instance()
framebuffer = instance.framebuffer((512, 512))
pipeline = framebuffer.render(
vertex_shader=glsl('''
#version 450
#pragma shader_stage(vertex)
layout (location = 0) in vec2 in_vert;
layout (location = 1) in vec3 in_color;
layout (location = 0) out vec3 out_color;
void main() {
gl_Position = vec4(in_vert, 0.0, 1.0);
out_color = in_color;
}
'''),
fragment_shader=glsl('''
#version 450
#pragma shader_stage(fragment)
layout (location = 0) in vec3 in_color;
layout (location = 0) out vec4 out_color;
void main() {
out_color = vec4(in_color, 1.0);
}
'''),
vertex_format='2f 3f',
vertex_count=3,
)
pipeline['vertex_buffer'].write(glnext.pack([
-0.5, -0.5, 0.0, 0.0, 1.0,
0.5, -0.5, 0.0, 1.0, 0.0,
0.0, 0.5, 1.0, 0.0, 0.0,
]))
instance.run()
data = framebuffer.output[0].read()
Image.frombuffer('RGBA', (512, 512), data, 'raw', 'RGBA', 0, -1).show()
Install
pip install glnext
Windows
With up2date drivers the vulkan runtime binaries should already be on your system. Install the vulkan-sdk if needed.
Linux
Install the vulkan-sdk.
apt-get install libx11-dev
Without GPU
This project is compatible with swiftshader. The CI also runs on pure CPU. (Dockerfile)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
glnext-0.7.1.tar.gz
(115.1 kB
view hashes)
Built Distributions
Close
Hashes for glnext-0.7.1-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9db1fa5b76d53f2531af3d23d4cb1c5aa2be280fae825d6630c37e114465733c |
|
MD5 | f8fda80cde045a89c1717af3549f58f1 |
|
BLAKE2b-256 | 8bd171ed3a589e7a0416fbe63a0fb5543432f52e710eb41641c2fd03e04e54d1 |
Close
Hashes for glnext-0.7.1-cp39-cp39-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 859f8c098faf4b369a911a352e6acb5a1206ce19b5e0891e5b893f35db874999 |
|
MD5 | de47b61e54d919b465d0f0e8c75707b6 |
|
BLAKE2b-256 | d02a51eecf41e162cc03f4e3dc7182a147331eaf7da5f9f3511d98b1bd8192df |
Close
Hashes for glnext-0.7.1-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d79bf706a98b4821e09578392aae084a7cc6a8c8650ce3aa32f8887301ca7b43 |
|
MD5 | 4281625599751235eb3b0cba3f8b5eea |
|
BLAKE2b-256 | 5f26428fc358b09262502c018d6ecd432f916dedf45bba0ad4ecd26de60c7d9c |
Close
Hashes for glnext-0.7.1-cp38-cp38-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ad660ed3f4751e7d069421074e8f5078992fda759c76b8153fb4be081dbab022 |
|
MD5 | 6dc44529ca6bfdf14767d67f29dafa0b |
|
BLAKE2b-256 | 3cf87dcb4246a23ddfd7a298e85d0d95790927a187cb36427beba1c1d226da02 |
Close
Hashes for glnext-0.7.1-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 746e62eea91c96b576c0e73cba169baceaa0de48ca6b0d3505de1c15e595f103 |
|
MD5 | cc7e396104e53850effd17b7b8ca2755 |
|
BLAKE2b-256 | c8495b05a06a64dea58f4c3a4a59deeaf4cf0b79c3c4110f5d263a24be518306 |
Close
Hashes for glnext-0.7.1-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 839eb1015cd68fa434e2aaf7ce15a66a733ab2459ceccd29ee0e689b72b2314c |
|
MD5 | 0dae006c184ca5dc7e74e6aa906fc779 |
|
BLAKE2b-256 | 0fbf85db2b7c9d03970f680e4f0b0ccf54ab8955d1642ab03fd019a2845db40d |