Skip to content

Instantly share code, notes, and snippets.

View lars-tiede's full-sized avatar

Lars Tiede lars-tiede

  • Lånekassen
  • Tromsø, Norway
View GitHub Profile
@binarycrusader
binarycrusader / textured_tri.py
Last active May 26, 2023 05:33
pysdl2 pyopengl "modern" opengl textured triangle example
#!/usr/bin/python2.7
"""Quick hack of 'modern' OpenGL example using pysdl2 and pyopengl
that shows a textured triangle; assumes there is a 'hazard.png' image
file in working directory.
Based on:
pysdl2 OpenGL example
http://www.tomdalling.com/blog/modern-opengl/02-textures/
http://www.arcsynthesis.org/gltut/Basics/Tut02%20Vertex%20Attributes.html
from IPython.core.magic import Magics, magics_class, line_magic
import asyncio
@magics_class
class AsyncMagics(Magics):
@line_magic
def await(self, line):
return asyncio.get_event_loop().run_until_complete(eval(line, self.shell.user_global_ns, self.shell.user_ns))