%global _empty_manifest_terminate_build 0 Name: python-glwindow Version: 4.2.0 Release: 1 Summary: A simple window with your own main loop. License: MIT URL: https://github.com/glnext/glwindow/ Source0: https://mirrors.nju.edu.cn/pypi/web/packages/4b/89/eb38cebce6044d8fe4a21786222eb08dd5fae6560b07061acbc48180813a/glwindow-4.2.0.tar.gz %description # glwindow ``` pip install glwindow ``` - [Documentation](https://glwindow.readthedocs.io/) - [glwindow on Github](https://github.com/glnext/glwindow/) - [glwindow on PyPI](https://pypi.org/project/glwindow/) A simple window with **your** own main loop. ## Examples ```py import glwindow window = glwindow.window() while window.visible: glwindow.update() ``` **Multiple Windows** ```py import glwindow windows = [ glwindow.window((640, 480)), glwindow.window((640, 480)), glwindow.window((640, 480)), ] while any(x.visible for x in windows): glwindow.update() ``` **Keyboard Input** ```py import glwindow window = glwindow.window() while window.visible: glwindow.update() if window.key_pressed('escape'): break ``` **Vulkan Surface** ```py import glnext import glwindow from glnext_compiler import glsl instance = glnext.instance(surface=True) task = instance.task() size = (512, 512) framebuffer = task.framebuffer(size) pipeline = framebuffer.render( vertex_shader=glsl(''' #version 450 #pragma shader_stage(vertex) layout (location = 0) out vec4 out_color; vec2 positions[3] = vec2[]( vec2(-0.5, -0.5), vec2(0.5, -0.5), vec2(0.0, 0.5) ); vec4 colors[3] = vec4[]( vec4(1.0, 0.0, 0.0, 1.0), vec4(0.0, 1.0, 0.0, 1.0), vec4(0.0, 0.0, 1.0, 1.0) ); void main() { gl_Position = vec4(positions[gl_VertexIndex], 0.0, 1.0); out_color = colors[gl_VertexIndex]; gl_Position.y *= -1.0; } '''), fragment_shader=glsl(''' #version 450 #pragma shader_stage(fragment) layout (location = 0) in vec4 in_color; layout (location = 0) out vec4 out_color; void main() { out_color = in_color; } '''), vertex_count=3, ) wnd = glwindow.window(size, title='Hello World!') instance.surface(wnd.handle, framebuffer.output[0]) while wnd.visible: glwindow.update() task.run() instance.present() ``` %package -n python3-glwindow Summary: A simple window with your own main loop. Provides: python-glwindow BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-pip BuildRequires: python3-cffi BuildRequires: gcc BuildRequires: gdb %description -n python3-glwindow # glwindow ``` pip install glwindow ``` - [Documentation](https://glwindow.readthedocs.io/) - [glwindow on Github](https://github.com/glnext/glwindow/) - [glwindow on PyPI](https://pypi.org/project/glwindow/) A simple window with **your** own main loop. ## Examples ```py import glwindow window = glwindow.window() while window.visible: glwindow.update() ``` **Multiple Windows** ```py import glwindow windows = [ glwindow.window((640, 480)), glwindow.window((640, 480)), glwindow.window((640, 480)), ] while any(x.visible for x in windows): glwindow.update() ``` **Keyboard Input** ```py import glwindow window = glwindow.window() while window.visible: glwindow.update() if window.key_pressed('escape'): break ``` **Vulkan Surface** ```py import glnext import glwindow from glnext_compiler import glsl instance = glnext.instance(surface=True) task = instance.task() size = (512, 512) framebuffer = task.framebuffer(size) pipeline = framebuffer.render( vertex_shader=glsl(''' #version 450 #pragma shader_stage(vertex) layout (location = 0) out vec4 out_color; vec2 positions[3] = vec2[]( vec2(-0.5, -0.5), vec2(0.5, -0.5), vec2(0.0, 0.5) ); vec4 colors[3] = vec4[]( vec4(1.0, 0.0, 0.0, 1.0), vec4(0.0, 1.0, 0.0, 1.0), vec4(0.0, 0.0, 1.0, 1.0) ); void main() { gl_Position = vec4(positions[gl_VertexIndex], 0.0, 1.0); out_color = colors[gl_VertexIndex]; gl_Position.y *= -1.0; } '''), fragment_shader=glsl(''' #version 450 #pragma shader_stage(fragment) layout (location = 0) in vec4 in_color; layout (location = 0) out vec4 out_color; void main() { out_color = in_color; } '''), vertex_count=3, ) wnd = glwindow.window(size, title='Hello World!') instance.surface(wnd.handle, framebuffer.output[0]) while wnd.visible: glwindow.update() task.run() instance.present() ``` %package help Summary: Development documents and examples for glwindow Provides: python3-glwindow-doc %description help # glwindow ``` pip install glwindow ``` - [Documentation](https://glwindow.readthedocs.io/) - [glwindow on Github](https://github.com/glnext/glwindow/) - [glwindow on PyPI](https://pypi.org/project/glwindow/) A simple window with **your** own main loop. ## Examples ```py import glwindow window = glwindow.window() while window.visible: glwindow.update() ``` **Multiple Windows** ```py import glwindow windows = [ glwindow.window((640, 480)), glwindow.window((640, 480)), glwindow.window((640, 480)), ] while any(x.visible for x in windows): glwindow.update() ``` **Keyboard Input** ```py import glwindow window = glwindow.window() while window.visible: glwindow.update() if window.key_pressed('escape'): break ``` **Vulkan Surface** ```py import glnext import glwindow from glnext_compiler import glsl instance = glnext.instance(surface=True) task = instance.task() size = (512, 512) framebuffer = task.framebuffer(size) pipeline = framebuffer.render( vertex_shader=glsl(''' #version 450 #pragma shader_stage(vertex) layout (location = 0) out vec4 out_color; vec2 positions[3] = vec2[]( vec2(-0.5, -0.5), vec2(0.5, -0.5), vec2(0.0, 0.5) ); vec4 colors[3] = vec4[]( vec4(1.0, 0.0, 0.0, 1.0), vec4(0.0, 1.0, 0.0, 1.0), vec4(0.0, 0.0, 1.0, 1.0) ); void main() { gl_Position = vec4(positions[gl_VertexIndex], 0.0, 1.0); out_color = colors[gl_VertexIndex]; gl_Position.y *= -1.0; } '''), fragment_shader=glsl(''' #version 450 #pragma shader_stage(fragment) layout (location = 0) in vec4 in_color; layout (location = 0) out vec4 out_color; void main() { out_color = in_color; } '''), vertex_count=3, ) wnd = glwindow.window(size, title='Hello World!') instance.surface(wnd.handle, framebuffer.output[0]) while wnd.visible: glwindow.update() task.run() instance.present() ``` %prep %autosetup -n glwindow-4.2.0 %build %py3_build %install %py3_install install -d -m755 %{buildroot}/%{_pkgdocdir} if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi pushd %{buildroot} if [ -d usr/lib ]; then find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/lib64 ]; then find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/bin ]; then find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/sbin ]; then find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst fi touch doclist.lst if [ -d usr/share/man ]; then find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst fi popd mv %{buildroot}/filelist.lst . mv %{buildroot}/doclist.lst . %files -n python3-glwindow -f filelist.lst %dir %{python3_sitearch}/* %files help -f doclist.lst %{_docdir}/* %changelog * Thu May 18 2023 Python_Bot - 4.2.0-1 - Package Spec generated