code
stringlengths
1
1.49M
vector
listlengths
0
7.38k
snippet
listlengths
0
7.38k
#!/usr/bin/python # $Id:$ # Play an audio file with DirectShow. Tested ok with MP3, WMA, MID, WAV, AU. # Caveats: # - Requires a filename (not from memory or stream yet). Looks like we need # to manually implement a filter which provides an output IPin. Lot of # work. # - Theoretically can traverse the graph to...
[ [ 1, 0, 0.2712, 0.0169, 0, 0.66, 0, 182, 0, 1, 0, 0, 182, 0, 0 ], [ 1, 0, 0.2881, 0.0169, 0, 0.66, 0.0625, 61, 0, 1, 0, 0, 61, 0, 0 ], [ 1, 0, 0.3051, 0.0169, 0, 0....
[ "import ctypes", "from comtypes import client", "import sys", "import time", "filename = sys.argv[1]", "qedit = client.GetModule('qedit.dll') # DexterLib", "quartz = client.GetModule('quartz.dll') #", "CLSID_FilterGraph = '{e436ebb3-524f-11ce-9f53-0020af0ba770}'", "filter_graph = client.CreateObject...
#!/usr/bin/env python # Play an audio file with QuickTime. Tested ok with MP3, WAV. # Notes # - Easy enough to read from a stream instead of filename, use DataRef # interface # - Not sure about playing same sound multiple times without reloading. # - No direct support for OpenAL, could be tricky/impossible ...
[ [ 14, 0, 0.1803, 0.0164, 0, 0.66, 0, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.1967, 0.0164, 0, 0.66, 0.04, 162, 1, 0, 0, 0, 0, 3, 0 ], [ 1, 0, 0.2295, 0.0164, 0, 0.66...
[ "__docformat__ = 'restructuredtext'", "__version__ = '$Id: $'", "import ctypes", "import sys", "import time", "from pyglet.window.carbon import _create_cfstring, _oscheck", "from pyglet.window.carbon import carbon", "from pyglet.window.carbon import quicktime", "quicktime.EnterMovies()", "filename...
#!/usr/bin/env python ''' Ref: http://www.inb.uni-luebeck.de/~boehme/using_libavcodec.html ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' import ctypes from ctypes import util import os import time def get_library(name): path = util.find_library(name) if not path: # HACK libavformat/li...
[ [ 8, 0, 0.0234, 0.0208, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.0417, 0.0052, 0, 0.66, 0.0455, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.0469, 0.0052, 0, 0.66...
[ "'''\nRef: http://www.inb.uni-luebeck.de/~boehme/using_libavcodec.html\n\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id$'", "import ctypes", "from ctypes import util", "import os", "import time", "def get_library(name):\n path = util.find_library(name)\n if not path:\n #...
from ctypes import * from pyglet.gl import * class GLSLException(Exception): pass def glsl_log(handle): if handle == 0: return '' log_len = c_int(0) glGetObjectParameterivARB(handle, GL_OBJECT_INFO_LOG_LENGTH_ARB, byref(log_len)) if log_len.value == 0: return '' log = ...
[ [ 1, 0, 0.0039, 0.0039, 0, 0.66, 0, 182, 0, 1, 0, 0, 182, 0, 0 ], [ 1, 0, 0.0118, 0.0039, 0, 0.66, 0.125, 531, 0, 1, 0, 0, 531, 0, 0 ], [ 3, 0, 0.0197, 0.0039, 0, 0...
[ "from ctypes import *", "from pyglet.gl import *", "class GLSLException(Exception): pass", "def glsl_log(handle):\n if handle == 0:\n return ''\n log_len = c_int(0)\n\n glGetObjectParameterivARB(handle, GL_OBJECT_INFO_LOG_LENGTH_ARB,\n byref(log_len))\n if log_len.value == 0:", " ...
#!/usr/bin/python # $Id:$ import random import sys from pyglet.gl import * from pyglet import clock from pyglet import font from pyglet import graphics from pyglet import window MAX_STREAMERS = 1000 if len(sys.argv) > 1: MAX_STREAMERS = int(sys.argv[1]) MAX_ADD_STREAMERS = MAX_STREAMERS // 10 MIN_STREAMER_LENGTH...
[ [ 1, 0, 0.0342, 0.0085, 0, 0.66, 0, 715, 0, 1, 0, 0, 715, 0, 0 ], [ 1, 0, 0.0427, 0.0085, 0, 0.66, 0.04, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 1, 0, 0.0598, 0.0085, 0, 0....
[ "import random", "import sys", "from pyglet.gl import *", "from pyglet import clock", "from pyglet import font", "from pyglet import graphics", "from pyglet import window", "MAX_STREAMERS = 1000", "if len(sys.argv) > 1:\n MAX_STREAMERS = int(sys.argv[1])", " MAX_STREAMERS = int(sys.argv[1])"...
#!/usr/bin/python # $Id:$ import os import sys import time sys.path.insert(0, os.path.dirname(__file__)) from pyglet.gl import * from pyglet import clock from pyglet import font from pyglet import resource from pyglet import window from pyglet.window import key, mouse from pyglet import graphics from pyglet.text im...
[ [ 1, 0, 0.027, 0.0068, 0, 0.66, 0, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.0338, 0.0068, 0, 0.66, 0.0526, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 1, 0, 0.0405, 0.0068, 0, 0...
[ "import os", "import sys", "import time", "sys.path.insert(0, os.path.dirname(__file__))", "from pyglet.gl import *", "from pyglet import clock", "from pyglet import font", "from pyglet import resource", "from pyglet import window", "from pyglet.window import key, mouse", "from pyglet import gra...
#!/usr/bin/env python from math import pi, sin, cos import sys from pyglet.gl import * from pyglet import clock from pyglet.graphics import vertexdomain from pyglet import window try: # Try and create a window with multisampling (antialiasing) config = Config(sample_buffers=1, samples=4, ...
[ [ 1, 0, 0.0194, 0.0065, 0, 0.66, 0, 526, 0, 3, 0, 0, 526, 0, 0 ], [ 1, 0, 0.0258, 0.0065, 0, 0.66, 0.0909, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 1, 0, 0.0387, 0.0065, 0, ...
[ "from math import pi, sin, cos", "import sys", "from pyglet.gl import *", "from pyglet import clock", "from pyglet.graphics import vertexdomain", "from pyglet import window", "try:\n # Try and create a window with multisampling (antialiasing)\n config = Config(sample_buffers=1, samples=4, \n ...
#!/usr/bin/python # $Id:$ import random import sys from pyglet.gl import * from pyglet import clock from pyglet import font from pyglet import graphics from pyglet import window BARS = 100 if len(sys.argv) > 1: BARS = int(sys.argv[1]) MIN_BAR_LENGTH = 4 MAX_BAR_LENGTH = 100 BAR_SEGMENT_HEIGHT = 10 UPDATE_PERIOD...
[ [ 1, 0, 0.0367, 0.0092, 0, 0.66, 0, 715, 0, 1, 0, 0, 715, 0, 0 ], [ 1, 0, 0.0459, 0.0092, 0, 0.66, 0.04, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 1, 0, 0.0642, 0.0092, 0, 0....
[ "import random", "import sys", "from pyglet.gl import *", "from pyglet import clock", "from pyglet import font", "from pyglet import graphics", "from pyglet import window", "BARS = 100", "if len(sys.argv) > 1:\n BARS = int(sys.argv[1])", " BARS = int(sys.argv[1])", "MIN_BAR_LENGTH = 4", ...
#!/usr/bin/python # $Id:$ import random import sys from pyglet.gl import * from pyglet import clock from pyglet import image from pyglet import window from pyglet.graphics import vertexdomain if len(sys.argv) > 1: SPRITES = int(sys.argv[1]) else: SPRITES = 2000 SPRITE_IMAGE = 'examples/noisy/ball.png' # Ho...
[ [ 1, 0, 0.0348, 0.0087, 0, 0.66, 0, 715, 0, 1, 0, 0, 715, 0, 0 ], [ 1, 0, 0.0435, 0.0087, 0, 0.66, 0.0769, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 1, 0, 0.0609, 0.0087, 0, ...
[ "import random", "import sys", "from pyglet.gl import *", "from pyglet import clock", "from pyglet import image", "from pyglet import window", "from pyglet.graphics import vertexdomain", "if len(sys.argv) > 1:\n SPRITES = int(sys.argv[1])\nelse:\n SPRITES = 2000", " SPRITES = int(sys.argv[1...
#!/usr/bin/python # $Id:$ import random import sys from pyglet.gl import * from pyglet import clock from pyglet import font from pyglet import graphics from pyglet import window MAX_PARTICLES = 1000 if len(sys.argv) > 1: MAX_PARTICLES = int(sys.argv[1]) MAX_ADD_PARTICLES = 100 GRAVITY = -100 win = window.Windo...
[ [ 1, 0, 0.0541, 0.0135, 0, 0.66, 0, 715, 0, 1, 0, 0, 715, 0, 0 ], [ 1, 0, 0.0676, 0.0135, 0, 0.66, 0.05, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 1, 0, 0.0946, 0.0135, 0, 0....
[ "import random", "import sys", "from pyglet.gl import *", "from pyglet import clock", "from pyglet import font", "from pyglet import graphics", "from pyglet import window", "MAX_PARTICLES = 1000", "if len(sys.argv) > 1:\n MAX_PARTICLES = int(sys.argv[1])", " MAX_PARTICLES = int(sys.argv[1])"...
# ---------------------------------------------------------------------------- # Copyright (c) 2008 Andrew D. Straw and Alex Holkner # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redist...
[ [ 1, 0, 0.1498, 0.004, 0, 0.66, 0, 182, 0, 1, 0, 0, 182, 0, 0 ], [ 1, 0, 0.1579, 0.004, 0, 0.66, 0.0769, 182, 0, 1, 0, 0, 182, 0, 0 ], [ 1, 0, 0.1619, 0.004, 0, 0.6...
[ "import ctypes", "import pyglet", "from pyglet.window.xlib import xlib", "import lib_xinput as xi", "class XInputDevice(object):\n def __init__(self, display, device_info):\n self._x_display = display._display\n self._device_id = device_info.id\n self.name = device_info.name\n\n ...
#!/usr/bin/env python ''' ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' import ctypes import pyglet from pyglet.window.carbon import CarbonEventHandler, carbon, _oscheck from pyglet.window.carbon.constants import * from pyglet.window.carbon.constants import _name kEventTabletPoint = 1 kEventTabletP...
[ [ 8, 0, 0.0229, 0.0131, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.0392, 0.0065, 0, 0.66, 0.0588, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.0458, 0.0065, 0, 0.66...
[ "'''\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id: $'", "import ctypes", "import pyglet", "from pyglet.window.carbon import CarbonEventHandler, carbon, _oscheck", "from pyglet.window.carbon.constants import *", "from pyglet.window.carbon.constants import _name", "kEventTabletPoin...
#!/usr/bin/python # $Id:$ import ctypes import pyglet from pyglet import com from pyglet.window.win32 import _kernel32 lib = ctypes.oledll.dinput8 LPVOID = ctypes.c_void_p WORD = ctypes.c_uint16 DWORD = ctypes.c_uint32 LPDWORD = ctypes.POINTER(DWORD) BOOL = ctypes.c_int WCHAR = ctypes.c_wchar UINT ...
[ [ 1, 0, 0.0075, 0.0019, 0, 0.66, 0, 182, 0, 1, 0, 0, 182, 0, 0 ], [ 1, 0, 0.0113, 0.0019, 0, 0.66, 0.005, 182, 0, 1, 0, 0, 182, 0, 0 ], [ 1, 0, 0.0132, 0.0019, 0, 0...
[ "import ctypes", "import pyglet", "from pyglet import com", "from pyglet.window.win32 import _kernel32", "lib = ctypes.oledll.dinput8", "LPVOID = ctypes.c_void_p", "WORD = ctypes.c_uint16", "DWORD = ctypes.c_uint32", "LPDWORD = ctypes.POINTER(DWORD)", "BOOL = ctypes.c_int", "WCHAR = ctypes.c_wch...
#!/usr/bin/env python ''' ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' import input # (usage_page, usage): Device class ''' device_usage_map = { (0x01, 0x01): input.PointerDevice, (0x01, 0x01): input.MouseDevice, (0x01, 0x04): input.JoystickDevice, (0x01, 0x05): input.GamePadDevice,...
[ [ 8, 0, 0.0636, 0.0364, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.1091, 0.0182, 0, 0.66, 0.1429, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.1273, 0.0182, 0, 0.66...
[ "'''\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id: $'", "import input", "'''\ndevice_usage_map = {\n (0x01, 0x01): input.PointerDevice,\n (0x01, 0x01): input.MouseDevice,\n (0x01, 0x04): input.JoystickDevice,\n (0x01, 0x05): input.GamePadDevice,\n (0x01, 0x06): input.Keybo...
#!/usr/bin/env python '''Event constants from /usr/include/linux/input.h ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' EV_SYN = 0x00 EV_KEY = 0x01 EV_REL = 0x02 EV_ABS = 0x03 EV_MSC = 0x04 EV_LED = 0x11 EV_SND = 0x12 EV_REP = 0x14 EV_FF = 0x15 EV_PWR = 0x16 EV_FF_STATUS = 0x17 EV_MAX = 0x1f # Synchro...
[ [ 8, 0, 0.0066, 0.0038, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.0113, 0.0019, 0, 0.66, 0.0021, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.0132, 0.0019, 0, 0.66...
[ "'''Event constants from /usr/include/linux/input.h\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id$'", "EV_SYN = 0x00", "EV_KEY = 0x01", "EV_REL = 0x02", "EV_ABS = 0x03", "EV_MSC = 0x04", "EV_LED = 0x11", "EV_SND = 0x12", "EV_REP = 0x14", "EV_FF = 0x15", "EV_PWR = 0x16", ...
#!/usr/bin/env python ''' ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' import ctypes import pyglet from pyglet.libs.darwin import carbon, _oscheck, create_cfstring from pyglet.libs.darwin.constants import * import input import usage # non-broken c_void_p void_p = ctypes.POINTER(ctypes.c_int) cla...
[ [ 8, 0, 0.0087, 0.005, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.0149, 0.0025, 0, 0.66, 0.0172, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.0173, 0.0025, 0, 0.66,...
[ "'''\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id: $'", "import ctypes", "import pyglet", "from pyglet.libs.darwin import carbon, _oscheck, create_cfstring", "from pyglet.libs.darwin.constants import *", "import input", "import usage", "void_p = ctypes.POINTER(ctypes.c_int)", ...
'''Wrapper for Xi Generated with: tools/genwrappers.py xinput Do not modify this file. ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' import ctypes from ctypes import * import pyglet.lib _lib = pyglet.lib.load_library('Xi') _int_types = (c_int16, c_int32) if hasattr(ctypes, 'c_int64'): # Some b...
[ [ 8, 0, 0.0024, 0.0042, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.0055, 0.0006, 0, 0.66, 0.002, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.0061, 0.0006, 0, 0.66,...
[ "'''Wrapper for Xi\n\nGenerated with:\ntools/genwrappers.py xinput\n\nDo not modify this file.\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id$'", "import ctypes", "from ctypes import *", "import pyglet.lib", "_lib = pyglet.lib.load_library('Xi')", "_int_types = (c_int16, c_int32)", ...
#!/usr/bin/env python ''' ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' import pyglet import input devices = input.get_devices() show_all = True window = pyglet.window.Window(1024, 768) batch = pyglet.graphics.Batch() class TrackedElement(object): def __init__(self, element): self.elem...
[ [ 8, 0, 0.0522, 0.0299, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.0896, 0.0149, 0, 0.66, 0.0588, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.1045, 0.0149, 0, 0.66...
[ "'''\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id: $'", "import pyglet", "import input", "devices = input.get_devices()", "show_all = True", "window = pyglet.window.Window(1024, 768)", "batch = pyglet.graphics.Batch()", "class TrackedElement(object):\n def __init__(self, ele...
#!/usr/bin/env python ''' ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' import sys class InputException(Exception): pass class InputDeviceExclusiveException(InputException): pass if sys.platform == 'darwin': import osx get_devices = osx.get_devices elif sys.platform == 'linux2': ...
[ [ 8, 0, 0.14, 0.08, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.24, 0.04, 0, 0.66, 0.1667, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.28, 0.04, 0, 0.66, 0.3333...
[ "'''\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id: $'", "import sys", "class InputException(Exception):\n pass", "class InputDeviceExclusiveException(InputException):\n pass", "if sys.platform == 'darwin':\n import osx\n get_devices = osx.get_devices\nelif sys.platform ==...
#!/usr/bin/env python ''' ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' from fcntl import ioctl import array import ctypes import errno import os import struct import sys import pyglet from linux_const import * c = ctypes.cdll.LoadLibrary('libc.so.6') _IOC_NRBITS = 8 _IOC_TYPEBITS = 8 _IOC_SIZEBITS...
[ [ 8, 0, 0.0136, 0.0078, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.0233, 0.0039, 0, 0.66, 0.0196, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.0271, 0.0039, 0, 0.66...
[ "'''\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id$'", "from fcntl import ioctl", "import array", "import ctypes", "import errno", "import os", "import struct", "import sys", "import pyglet", "from linux_const import *", "c = ctypes.cdll.LoadLibrary('libc.so.6')", "_IOC_...
'''Wrapper for avcodec Generated with: ../tools/wraptypes/wrap.py /usr/include/ffmpeg/avcodec.h -o lib_avcodec.py -lavcodec .. Then hacked. DO NOT REGENERATE. ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' import ctypes from ctypes import * from avcodec import get_library _lib = get_library('avcodec...
[ [ 8, 0, 0.0028, 0.005, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.0064, 0.0007, 0, 0.66, 0.0019, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.0071, 0.0007, 0, 0.66,...
[ "'''Wrapper for avcodec\n\nGenerated with:\n../tools/wraptypes/wrap.py /usr/include/ffmpeg/avcodec.h -o lib_avcodec.py -lavcodec\n\n.. Then hacked. DO NOT REGENERATE.\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id$'", "import ctypes", "from ctypes import *", "from avcodec import get_li...
#!/usr/bin/env python ''' ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' from timeit import Timer NUMBER=100000 setup=''' from pyglet.gl.VERSION_1_1 import glBindTexture, glEnable, GL_TEXTURE_2D from pyglet.gl.VERSION_1_1 import glBegin, glEnd, glVertex2f, GL_LINES from pyglet.window import Window fro...
[ [ 1, 0, 0.1667, 0.1667, 0, 0.66, 0, 200, 0, 1, 0, 0, 200, 0, 0 ], [ 1, 0, 0.5, 0.1667, 0, 0.66, 0.25, 639, 0, 3, 0, 0, 639, 0, 0 ], [ 1, 0, 0.6667, 0.1667, 0, 0.66,...
[ "from timeit import Timer", "from pyglet.gl.VERSION_1_1 import glBindTexture, glEnable, GL_TEXTURE_2D", "from pyglet.gl.VERSION_1_1 import glBegin, glEnd, glVertex2f, GL_LINES", "from pyglet.window import Window", "from pyglet.image import Texture" ]
#!/usr/bin/python # $Id:$ from docutils.core import publish_doctree from docutils import nodes import pyglet from pyglet.text.formats import structured class Stylesheet(object): default = dict( font_name='Times New Roman', font_size=12, margin_bottom=12) emphasis = dict( ital...
[ [ 1, 0, 0.0272, 0.0068, 0, 0.66, 0, 219, 0, 1, 0, 0, 219, 0, 0 ], [ 1, 0, 0.034, 0.0068, 0, 0.66, 0.1429, 976, 0, 1, 0, 0, 976, 0, 0 ], [ 1, 0, 0.0476, 0.0068, 0, 0...
[ "from docutils.core import publish_doctree", "from docutils import nodes", "import pyglet", "from pyglet.text.formats import structured", "class Stylesheet(object):\n default = dict(\n font_name='Times New Roman',\n font_size=12,\n margin_bottom=12)\n\n emphasis = dict(\n i...
#!/usr/bin/python # $Id:$ import ctypes import math import optparse import pyglet root2 = math.sqrt(2) def gen_dist_field(img, width, height, spread, bidirectional=True): sample_width = img.width // width sample_height = img.height // height max_dist = spread * root2 dist_scale = 127. / max_dist ...
[ [ 1, 0, 0.0392, 0.0098, 0, 0.66, 0, 182, 0, 1, 0, 0, 182, 0, 0 ], [ 1, 0, 0.049, 0.0098, 0, 0.66, 0.1667, 526, 0, 1, 0, 0, 526, 0, 0 ], [ 1, 0, 0.0588, 0.0098, 0, 0...
[ "import ctypes", "import math", "import optparse", "import pyglet", "root2 = math.sqrt(2)", "def gen_dist_field(img, width, height, spread, bidirectional=True):\n sample_width = img.width // width\n sample_height = img.height // height\n max_dist = spread * root2\n dist_scale = 127. / max_dist...
#!/usr/bin/env python ''' ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' import code import sys import traceback import pyglet.event import pyglet.text from pyglet.window import key from pyglet.gl import * class Console(object): def __init__(self, width, height, globals=None, locals=None): ...
[ [ 8, 0, 0.0248, 0.0142, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.0426, 0.0071, 0, 0.66, 0.0909, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.0496, 0.0071, 0, 0.66...
[ "'''\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id$'", "import code", "import sys", "import traceback", "import pyglet.event", "import pyglet.text", "from pyglet.window import key", "from pyglet.gl import *", "class Console(object):\n def __init__(self, width, height, globa...
#!/usr/bin/env python ''' ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' from math import * from ctypes import * from pyglet.gl import * from euclid import * def FloatArray(*args): t = (c_float * len(args)) return t(*args) def IndexArray(*args): t = (c_uint * len(args)) return t(*args...
[ [ 8, 0, 0.0246, 0.0141, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.0423, 0.007, 0, 0.66, 0.0833, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.0493, 0.007, 0, 0.66, ...
[ "'''\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id$'", "from math import *", "from ctypes import *", "from pyglet.gl import *", "from euclid import *", "def FloatArray(*args):\n t = (c_float * len(args))\n return t(*args)", " t = (c_float * len(args))", " return t(*a...
#!/usr/bin/python # $Id:$ from pyglet.gl import * from pyglet import window class MoveWindow(object): def __init__(self, window, x, y): self.offset = x, y self.window = window def on_mouse_drag(self, x, y, dx, dy, buttons, modifiers): sx, sy = self.window.get_location() ox, oy...
[ [ 1, 0, 0.0541, 0.0135, 0, 0.66, 0, 531, 0, 1, 0, 0, 531, 0, 0 ], [ 1, 0, 0.0676, 0.0135, 0, 0.66, 0.2, 182, 0, 1, 0, 0, 182, 0, 0 ], [ 3, 0, 0.1689, 0.1622, 0, 0.6...
[ "from pyglet.gl import *", "from pyglet import window", "class MoveWindow(object):\n def __init__(self, window, x, y):\n self.offset = x, y\n self.window = window\n\n def on_mouse_drag(self, x, y, dx, dy, buttons, modifiers):\n sx, sy = self.window.get_location()\n ox, oy = sel...
'''Wrapper for avformat Generated with: ../tools/wraptypes/wrap.py /usr/include/ffmpeg/avformat.h -o lib_avformat.py .. Then hacked. DON'T REGENERATE. ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' import ctypes from ctypes import * from avcodec import get_library _lib = get_library('avformat') _in...
[ [ 8, 0, 0.0028, 0.0049, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.0063, 0.0007, 0, 0.66, 0.003, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.007, 0.0007, 0, 0.66, ...
[ "'''Wrapper for avformat\n\nGenerated with:\n../tools/wraptypes/wrap.py /usr/include/ffmpeg/avformat.h -o lib_avformat.py\n\n.. Then hacked. DON'T REGENERATE.\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id$'", "import ctypes", "from ctypes import *", "from avcodec import get_library", ...
#!/usr/bin/python # $Id:$ import ctypes import pyglet from pyglet.window.xlib import xlib from pyglet.gl import * from pyglet.gl.glx import * def reshape(width, height): h = height / float(width) glViewport(0, 0, width, height) glMatrixMode(GL_PROJECTION) glLoadIdentity() glFrustum(-1.0, 1.0, -h, h, 5...
[ [ 1, 0, 0.0377, 0.0094, 0, 0.66, 0, 182, 0, 1, 0, 0, 182, 0, 0 ], [ 1, 0, 0.0566, 0.0094, 0, 0.66, 0.0909, 182, 0, 1, 0, 0, 182, 0, 0 ], [ 1, 0, 0.066, 0.0094, 0, 0...
[ "import ctypes", "import pyglet", "from pyglet.window.xlib import xlib", "from pyglet.gl import *", "from pyglet.gl.glx import *", "def reshape(width, height):\n h = height / float(width)\n glViewport(0, 0, width, height)\n glMatrixMode(GL_PROJECTION)\n glLoadIdentity()\n glFrustum(-1.0, 1.0, -h...
# Number MacBook # 500 59.1715965271 # 1000 29.5857982635 # 2000 19.8412704468 import os import sys import random import pygame import pygame.time from pygame.locals import * pygame.init() win = pygame.display.set_mode((600, 600)) ww, wh = win.get_size() img = pygame.image.load('examples/nois...
[ [ 1, 0, 0.1452, 0.0161, 0, 0.66, 0, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.1613, 0.0161, 0, 0.66, 0.0556, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 1, 0, 0.1774, 0.0161, 0, ...
[ "import os", "import sys", "import random", "import pygame", "import pygame.time", "from pygame.locals import *", "pygame.init()", "win = pygame.display.set_mode((600, 600))", "ww, wh = win.get_size()", "img = pygame.image.load('examples/noisy/ball.png')", "class BouncySprite(pygame.sprite.Sprit...
import sys import time from ctypes import * from exceptions import * import random # disable error checking (python -O) to make this code work :) from pyglet import options import pyglet.window from pyglet import clock from pyglet.shader import * from pyglet.ext.model.geometric import * from pyglet.gl import * from ...
[ [ 1, 0, 0.0011, 0.0011, 0, 0.66, 0, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 1, 0, 0.0022, 0.0011, 0, 0.66, 0.0312, 654, 0, 1, 0, 0, 654, 0, 0 ], [ 1, 0, 0.0034, 0.0011, 0, ...
[ "import sys", "import time", "from ctypes import *", "from exceptions import *", "import random", "from pyglet import options", "import pyglet.window", "from pyglet import clock", "from pyglet.shader import *", "from pyglet.ext.model.geometric import *", "from pyglet.gl import *", "from pyglet...
# ---------------------------------------------------------------------------- # pyglet # Copyright (c) 2006-2008 Alex Holkner # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistribu...
[ [ 8, 0, 0.1473, 0.0083, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.1577, 0.0041, 0, 0.66, 0.05, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.1618, 0.0041, 0, 0.66, ...
[ "'''\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id: $'", "import ctypes", "import Queue", "import pyglet", "from pyglet.app import windows, BaseEventLoop", "from pyglet.window.carbon import carbon, types, constants, _oscheck", "EventHandlerProcPtr = ctypes.CFUNCTYPE(ctypes.c_int, ...
# ---------------------------------------------------------------------------- # pyglet # Copyright (c) 2006-2008 Alex Holkner # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistribu...
[ [ 8, 0, 0.049, 0.0324, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.0666, 0.0009, 0, 0.66, 0.0244, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.0675, 0.0009, 0, 0.66,...
[ "'''Audio and video playback.\n\npyglet can play WAV files, and if AVbin is installed, many other audio and\nvideo formats.\n\nPlayback is handled by the `Player` class, which reads raw data from `Source`\nobjects and provides methods for pausing, seeking, adjusting the volume, and\nso on. The `Player` class imple...
#!/usr/bin/python # $Id:$ import ctypes import Queue import pyglet from pyglet.window.win32 import _kernel32, _user32, constants, types class MTWin32EventLoop(pyglet.app.win32.Win32EventLoop): def __init__(self, *args, **kwargs): super(MTWin32EventLoop, self).__init__(*args, **kwargs) ...
[ [ 1, 0, 0.0533, 0.0133, 0, 0.66, 0, 182, 0, 1, 0, 0, 182, 0, 0 ], [ 1, 0, 0.0667, 0.0133, 0, 0.66, 0.2, 952, 0, 1, 0, 0, 952, 0, 0 ], [ 1, 0, 0.0933, 0.0133, 0, 0.6...
[ "import ctypes", "import Queue", "import pyglet", "from pyglet.window.win32 import _kernel32, _user32, constants, types", "class MTWin32EventLoop(pyglet.app.win32.Win32EventLoop):\n def __init__(self, *args, **kwargs):\n super(MTWin32EventLoop, self).__init__(*args, **kwargs)\n\n # Force im...
#!/usr/bin/env python # ---------------------------------------------------------------------------- # pyglet # Copyright (c) 2006-2008 Alex Holkner # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are ...
[ [ 8, 0, 0.1086, 0.006, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.1161, 0.003, 0, 0.66, 0.0526, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.119, 0.003, 0, 0.66, ...
[ "'''Audio and video player with simple GUI controls.\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id: $'", "import setup_path", "import mt_media", "import sys", "from pyglet.gl import *", "import pyglet", "from pyglet.window import key", "def draw_rect(x, y, width, height):\n g...
#!/usr/bin/env python ''' ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' import setup_path import sys import pyglet import mt_media import mt_procedural as procedural player = mt_media.Player() player.queue(procedural.Sine(0.5, 300)) player.queue(procedural.Sine(0.5, 330)) player.queue(procedural.S...
[ [ 8, 0, 0.125, 0.0714, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.2143, 0.0357, 0, 0.66, 0.0556, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.25, 0.0357, 0, 0.66, ...
[ "'''\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id: $'", "import setup_path", "import sys", "import pyglet", "import mt_media", "import mt_procedural as procedural", "player = mt_media.Player()", "player.queue(procedural.Sine(0.5, 300))", "player.queue(procedural.Sine(0.5, 330...
#!/usr/bin/env python ''' ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' import setup_path import pyglet import mt_media import sys source = mt_media.load(sys.argv[1]) player = mt_media.Player() player.queue(source) player.play() player.on_eos = lambda: pyglet.app.exit() pyglet.app.run()
[ [ 8, 0, 0.1591, 0.0909, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.2727, 0.0455, 0, 0.66, 0.0833, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.3182, 0.0455, 0, 0.66...
[ "'''\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id: $'", "import setup_path", "import pyglet", "import mt_media", "import sys", "source = mt_media.load(sys.argv[1])", "player = mt_media.Player()", "player.queue(source)", "player.play()", "player.on_eos = lambda: pyglet.app.e...
#!/usr/bin/env python ''' ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' import threading import time import mt_media import pyglet _debug = pyglet.options['debug_media'] class SilentAudioPlayer(mt_media.AbstractAudioPlayer): # When playing video, length of audio (in secs) to buffer ahead. ...
[ [ 8, 0, 0.0217, 0.0124, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.0373, 0.0062, 0, 0.66, 0.1, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.0435, 0.0062, 0, 0.66, ...
[ "'''\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id: $'", "import threading", "import time", "import mt_media", "import pyglet", "_debug = pyglet.options['debug_media']", "class SilentAudioPlayer(mt_media.AbstractAudioPlayer):\n # When playing video, length of audio (in secs) to...
# ---------------------------------------------------------------------------- # pyglet # Copyright (c) 2006-2008 Alex Holkner # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistribu...
[ [ 1, 0, 0.0882, 0.0025, 0, 0.66, 0, 182, 0, 1, 0, 0, 182, 0, 0 ], [ 1, 0, 0.0907, 0.0025, 0, 0.66, 0.0083, 182, 0, 1, 0, 0, 182, 0, 0 ], [ 14, 0, 0.0956, 0.0025, 0, ...
[ "import ctypes", "from pyglet import com", "lib = ctypes.oledll.dsound", "DWORD = ctypes.c_uint32", "LPDWORD = ctypes.POINTER(DWORD)", "LONG = ctypes.c_long", "LPLONG = ctypes.POINTER(LONG)", "WORD = ctypes.c_uint16", "HWND = DWORD", "LPUNKNOWN = ctypes.c_void_p", "D3DVALUE = ctypes.c_float", ...
#!/usr/bin/python # $Id:$ import ctypes import math import sys import threading import time import pyglet _debug = pyglet.options['debug_media'] import mt_media import lib_dsound as lib from pyglet.window.win32 import _user32, _kernel32 class DirectSoundException(mt_media.MediaException): pas...
[ [ 1, 0, 0.0074, 0.0019, 0, 0.66, 0, 182, 0, 1, 0, 0, 182, 0, 0 ], [ 1, 0, 0.0093, 0.0019, 0, 0.66, 0.0625, 526, 0, 1, 0, 0, 526, 0, 0 ], [ 1, 0, 0.0112, 0.0019, 0, ...
[ "import ctypes", "import math", "import sys", "import threading", "import time", "import pyglet", "_debug = pyglet.options['debug_media']", "import mt_media", "import lib_dsound as lib", "from pyglet.window.win32 import _user32, _kernel32", "class DirectSoundException(mt_media.MediaException):\n...
'''Wrapper for pulse Generated with: tools/genwrappers.py pulseaudio Do not modify this file. ''' __docformat__ = 'restructuredtext' __version__ = '$Id: wrap.py 1694 2008-01-30 23:12:00Z Alex.Holkner $' import ctypes from ctypes import * import pyglet.lib _lib = pyglet.lib.load_library('pulse') _int_types = (c_...
[ [ 8, 0, 0.0019, 0.0034, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.0044, 0.0005, 0, 0.66, 0.001, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.0048, 0.0005, 0, 0.66,...
[ "'''Wrapper for pulse\n\nGenerated with:\ntools/genwrappers.py pulseaudio\n\nDo not modify this file.\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id: wrap.py 1694 2008-01-30 23:12:00Z Alex.Holkner $'", "import ctypes", "from ctypes import *", "import pyglet.lib", "_lib = pyglet.lib.lo...
# ---------------------------------------------------------------------------- # pyglet # Copyright (c) 2006-2008 Alex Holkner # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistribu...
[ [ 8, 0, 0.0576, 0.0123, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.0661, 0.0015, 0, 0.66, 0.0026, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.0676, 0.0015, 0, 0.66...
[ "'''Wrapper for openal\n\nGenerated with:\n../tools/wraptypes/wrap.py /usr/include/AL/al.h -lopenal -olib_openal.py\n\n.. Hacked to remove non-existant library functions. TODO add alGetError\ncheck.\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id: lib_openal.py 1579 2008-01-15 14:47:19Z Alex....
# ---------------------------------------------------------------------------- # pyglet # Copyright (c) 2006-2008 Alex Holkner # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistribu...
[ [ 8, 0, 0.1294, 0.0245, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.1469, 0.0035, 0, 0.66, 0.007, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.1503, 0.0035, 0, 0.66,...
[ "'''Wrapper for openal\n\nGenerated with:\n../tools/wraptypes/wrap.py /usr/include/AL/alc.h -lopenal -olib_alc.py\n\n.. Hacked to fix ALCvoid argtypes.\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id: lib_alc.py 1579 2008-01-15 14:47:19Z Alex.Holkner $'", "import ctypes", "from ctypes impo...
# ---------------------------------------------------------------------------- # pyglet # Copyright (c) 2006-2008 Alex Holkner # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistribu...
[ [ 1, 0, 0.0682, 0.0019, 0, 0.66, 0, 182, 0, 1, 0, 0, 182, 0, 0 ], [ 1, 0, 0.0701, 0.0019, 0, 0.66, 0.05, 251, 0, 1, 0, 0, 251, 0, 0 ], [ 1, 0, 0.072, 0.0019, 0, 0.6...
[ "import ctypes", "import heapq", "import sys", "import threading", "import time", "import Queue", "import pyglet", "_debug = pyglet.options['debug_media']", "import mt_media", "import lib_openal as al", "import lib_alc as alc", "class OpenALException(mt_media.MediaException):\n pass", "de...
#!/usr/bin/python # $Id: setup_path.py 1580 2008-01-15 15:08:39Z Alex.Holkner $ import os.path import sys script_dir = os.path.dirname(__file__) sys.path.insert(0, os.path.join(script_dir, '..', '..')) sys.path.insert(0, script_dir)
[ [ 1, 0, 0.4444, 0.1111, 0, 0.66, 0, 79, 0, 1, 0, 0, 79, 0, 0 ], [ 1, 0, 0.5556, 0.1111, 0, 0.66, 0.25, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 14, 0, 0.7778, 0.1111, 0, 0.6...
[ "import os.path", "import sys", "script_dir = os.path.dirname(__file__)", "sys.path.insert(0, os.path.join(script_dir, '..', '..'))", "sys.path.insert(0, script_dir)" ]
# ---------------------------------------------------------------------------- # pyglet # Copyright (c) 2006-2008 Alex Holkner # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistribu...
[ [ 1, 0, 0.1989, 0.0055, 0, 0.66, 0, 308, 0, 3, 0, 0, 308, 0, 0 ], [ 1, 0, 0.2099, 0.0055, 0, 0.66, 0.1111, 182, 0, 1, 0, 0, 182, 0, 0 ], [ 1, 0, 0.2155, 0.0055, 0, ...
[ "from mt_media import Source, AudioFormat, AudioData", "import ctypes", "import os", "import math", "class ProceduralSource(Source):\n def __init__(self, duration, sample_rate=44800, sample_size=16):\n self._duration = float(duration)\n self.audio_format = AudioFormat(\n channels...
#!/usr/bin/env python ''' Hack synchronisation into pyglet event loop. ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' import select import threading import pyglet class XlibEventDispatcher(object): def fileno(self): raise NotImplementedError('abstract') def dispatch_events(self): ...
[ [ 8, 0, 0.0323, 0.0242, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.0565, 0.0081, 0, 0.66, 0.0667, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.0645, 0.0081, 0, 0.66...
[ "'''\nHack synchronisation into pyglet event loop.\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id: $'", "import select", "import threading", "import pyglet", "class XlibEventDispatcher(object):\n def fileno(self):\n raise NotImplementedError('abstract')\n\n def dispatch_ev...
#!/usr/bin/env python ''' ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' import time from pyglet.ext.layout import * from pyglet.window import * window = Window(visible=False) def print_time(start, msg): dt = time.time() - start print '%f\t%s' % (dt, msg) def profile(xhtml, widths=[800,600,4...
[ [ 8, 0, 0.0186, 0.0106, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.0319, 0.0053, 0, 0.66, 0.1, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.0372, 0.0053, 0, 0.66, ...
[ "'''\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id$'", "import time", "from pyglet.ext.layout import *", "from pyglet.window import *", "window = Window(visible=False)", "def print_time(start, msg):\n dt = time.time() - start\n print('%f\\t%s' % (dt, msg))", " dt = time.t...
'''Wrapper for pulse Generated with: tools/genwrappers.py pulseaudio Do not modify this file. ''' __docformat__ = 'restructuredtext' __version__ = '$Id: wrap.py 1694 2008-01-30 23:12:00Z Alex.Holkner $' import ctypes from ctypes import * import pyglet.lib _lib = pyglet.lib.load_library('pulse') _int_types = (c_...
[ [ 8, 0, 0.0019, 0.0034, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.0044, 0.0005, 0, 0.66, 0.001, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.0048, 0.0005, 0, 0.66,...
[ "'''Wrapper for pulse\n\nGenerated with:\ntools/genwrappers.py pulseaudio\n\nDo not modify this file.\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id: wrap.py 1694 2008-01-30 23:12:00Z Alex.Holkner $'", "import ctypes", "from ctypes import *", "import pyglet.lib", "_lib = pyglet.lib.lo...
#!/usr/bin/env python ''' ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' import sys from pyglet import clock from pyglet import image from pyglet import window w = window.Window() class AnimationPlayer(object): expected_delay = 0 def __init__(self, animation): self.animation = animat...
[ [ 8, 0, 0.0648, 0.037, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.1111, 0.0185, 0, 0.66, 0.0833, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.1296, 0.0185, 0, 0.66,...
[ "'''\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id$'", "import sys", "from pyglet import clock", "from pyglet import image", "from pyglet import window", "w = window.Window()", "class AnimationPlayer(object):\n expected_delay = 0\n\n def __init__(self, animation):\n s...
#!/usr/bin/env python '''Press R,G,B,S keys to alter target color and saturation. ''' print __doc__ __docformat__ = 'restructuredtext' __version__ = '$Id: $' from ctypes import * from pyglet.gl import * from pyglet import clock from pyglet.image import * from pyglet.window import * from pyglet.window.event import ...
[ [ 8, 0, 0.0422, 0.0241, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 8, 0, 0.0723, 0.012, 0, 0.66, 0.0385, 535, 3, 1, 0, 0, 0, 0, 1 ], [ 14, 0, 0.0964, 0.012, 0, 0.66, ...
[ "'''Press R,G,B,S keys to alter target color and saturation.\n'''", "print(__doc__)", "__docformat__ = 'restructuredtext'", "__version__ = '$Id: $'", "from ctypes import *", "from pyglet.gl import *", "from pyglet import clock", "from pyglet.image import *", "from pyglet.window import *", "from py...
#!/usr/bin/env python import sys from pyglet.gl import * from pyglet import window, image import shader w = window.Window(512, 512) kitten = image.load('../examples/programming_guide/kitten.jpg') pinch_f = ''' uniform sampler2D tex; uniform vec2 size; uniform vec2 mouse; uniform float strength; void main() { v...
[ [ 1, 0, 0.0357, 0.0179, 0, 0.66, 0, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 1, 0, 0.0714, 0.0179, 0, 0.66, 0.0667, 531, 0, 1, 0, 0, 531, 0, 0 ], [ 1, 0, 0.0893, 0.0179, 0, ...
[ "import sys", "from pyglet.gl import *", "from pyglet import window, image", "import shader", "w = window.Window(512, 512)", "kitten = image.load('../examples/programming_guide/kitten.jpg')", "pinch_f = '''\nuniform sampler2D tex;\nuniform vec2 size;\nuniform vec2 mouse;\nuniform float strength;\n\nvoid...
#!/usr/bin/env python # -*- coding: latin-1 -*- ''' ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' import math import random import re import os.path import pyglet from pyglet.gl import * import xml.dom import xml.dom.minidom class SmoothLineGroup(pyglet.graphics.Group): def set_state(self): ...
[ [ 8, 0, 0.0128, 0.0057, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.0199, 0.0028, 0, 0.66, 0.0526, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.0227, 0.0028, 0, 0.66...
[ "'''\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id$'", "import math", "import random", "import re", "import os.path", "import pyglet", "from pyglet.gl import *", "import xml.dom", "import xml.dom.minidom", "class SmoothLineGroup(pyglet.graphics.Group):\n def set_state(sel...
#!/usr/bin/python # $Id:$ # wxPython + pyglet integration, by subclassing wx.Window. # Win32 works fine, though flickery resize. # GDK sort of works, but keeps getting overdrawn by the window background # (resize to see). import wx import pyglet from pyglet.gl import * import sys if sys.platform == ...
[ [ 1, 0, 0.0464, 0.0052, 0, 0.66, 0, 666, 0, 1, 0, 0, 666, 0, 0 ], [ 1, 0, 0.0515, 0.0052, 0, 0.66, 0.0667, 182, 0, 1, 0, 0, 182, 0, 0 ], [ 1, 0, 0.0567, 0.0052, 0, ...
[ "import wx", "import pyglet", "from pyglet.gl import *", "import sys", "if sys.platform == 'win32':\n from pyglet.window.win32 import _user32\n from pyglet.gl import wgl\nelif sys.platform == 'linux2':\n from pyglet.image.codecs.gdkpixbuf2 import gdk\n from pyglet.gl import glx", " from pyg...
# Copyright 2009 Joe Wreschnig and others. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following di...
[ [ 8, 0, 0.0821, 0.0336, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.1045, 0.0037, 0, 0.66, 0.2, 272, 0, 0, 0, 0, 0, 5, 0 ], [ 1, 0, 0.1119, 0.0037, 0, 0.66, ...
[ "\"\"\"Draw a NinePatch image.\n\nNinePatch is a format for storing how to cut up a 9-part resizable\nrectangular image within the image pixel data directly.\n\nFor more information on the NinePatch format, see\nhttp://developer.android.com/guide/topics/graphics/2d-graphics.html#nine-patch.", "__all__ = [\"NinePa...
'''Wrapper for Xxf86vm Generated with: tools/genwrappers.py Do not modify this file. ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' import ctypes from ctypes import * import pyglet.lib _lib = pyglet.lib.load_library('Xxf86vm') _int_types = (c_int16, c_int32) if hasattr(ctypes, 'c_int64'): # Som...
[ [ 8, 0, 0.0114, 0.02, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.0257, 0.0029, 0, 0.66, 0.0074, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.0286, 0.0029, 0, 0.66, ...
[ "'''Wrapper for Xxf86vm\n\nGenerated with:\ntools/genwrappers.py\n\nDo not modify this file.\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id$'", "import ctypes", "from ctypes import *", "import pyglet.lib", "_lib = pyglet.lib.load_library('Xxf86vm')", "_int_types = (c_int16, c_int32)...
'''Wrapper for Xrandr Generated with: tools/genwrappers.py xrandr Do not modify this file. ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' import ctypes from ctypes import * import pyglet.lib _lib = pyglet.lib.load_library('Xrandr') _int_types = (c_int16, c_int32) if hasattr(ctypes, 'c_int64'): ...
[ [ 8, 0, 0.0054, 0.0094, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.0121, 0.0013, 0, 0.66, 0.0036, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.0134, 0.0013, 0, 0.66...
[ "'''Wrapper for Xrandr\n\nGenerated with:\ntools/genwrappers.py xrandr\n\nDo not modify this file.\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id$'", "import ctypes", "from ctypes import *", "import pyglet.lib", "_lib = pyglet.lib.load_library('Xrandr')", "_int_types = (c_int16, c_i...
#!/usr/bin/env python ''' ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' import ctypes import pyglet from pyglet.window.xlib import xlib import lib_xrandr as xrandr def _check_extension(display): major_opcode = ctypes.c_int() first_event = ctypes.c_int() first_error = ctypes.c_int() x...
[ [ 8, 0, 0.053, 0.0303, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.0909, 0.0152, 0, 0.66, 0.0556, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.1061, 0.0152, 0, 0.66,...
[ "'''\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id$'", "import ctypes", "import pyglet", "from pyglet.window.xlib import xlib", "import lib_xrandr as xrandr", "def _check_extension(display):\n major_opcode = ctypes.c_int()\n first_event = ctypes.c_int()\n first_error = ctyp...
#!/usr/bin/env python ''' ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' import ctypes import os import fcntl import mutex import time import select import struct import signal import sys import threading from pyglet.window.xlib import xlib import lib_xf86vmode as xf86vmode class ModeList(object): ...
[ [ 8, 0, 0.0156, 0.0089, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.0268, 0.0045, 0, 0.66, 0.037, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.0312, 0.0045, 0, 0.66,...
[ "'''\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id$'", "import ctypes", "import os", "import fcntl", "import mutex", "import time", "import select", "import struct", "import signal", "import sys", "import threading", "from pyglet.window.xlib import xlib", "import lib_x...
#!/usr/bin/env python ''' ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' # Patch for window/carbon/__init__.py:: # (in _create) # # fs_width = c_short(width) # fs_height = c_short(width) # # ... that's it :-)
[ [ 8, 0, 0.2333, 0.1333, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.4, 0.0667, 0, 0.66, 0.5, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.4667, 0.0667, 0, 0.66, ...
[ "'''\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id: $'" ]
#!/usr/bin/env python ''' ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' import pyglet from pyglet.gl import * window = pyglet.window.Window(fullscreen=True) @window.event def on_draw(): glClearColor(.5, .5, .5, 1) glClear(GL_COLOR_BUFFER_BIT) glPolygonMode(GL_FRONT_AND_BACK, GL_LINE) ...
[ [ 8, 0, 0.1458, 0.0833, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.25, 0.0417, 0, 0.66, 0.1429, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.2917, 0.0417, 0, 0.66, ...
[ "'''\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id: $'", "import pyglet", "from pyglet.gl import *", "window = pyglet.window.Window(fullscreen=True)", "def on_draw():\n glClearColor(.5, .5, .5, 1)\n glClear(GL_COLOR_BUFFER_BIT)\n glPolygonMode(GL_FRONT_AND_BACK, GL_LINE)\n ...
#!/usr/bin/python # $Id:$ import ctypes import pyglet from pyglet.window.win32 import _user32 from pyglet.window.win32.constants import * from pyglet.window.win32.types import * WCHAR = ctypes.c_wchar BCHAR = ctypes.c_wchar class MONITORINFOEX(ctypes.Structure): _fields_ = ( ('cbSize', DW...
[ [ 1, 0, 0.0312, 0.0078, 0, 0.66, 0, 182, 0, 1, 0, 0, 182, 0, 0 ], [ 1, 0, 0.0469, 0.0078, 0, 0.66, 0.0667, 182, 0, 1, 0, 0, 182, 0, 0 ], [ 1, 0, 0.0547, 0.0078, 0, ...
[ "import ctypes", "import pyglet", "from pyglet.window.win32 import _user32", "from pyglet.window.win32.constants import *", "from pyglet.window.win32.types import *", "WCHAR = ctypes.c_wchar", "BCHAR = ctypes.c_wchar", "class MONITORINFOEX(ctypes.Structure):\n _fields_ = (\n ('cbSize', DWORD...
#!/usr/bin/python # $Id:$ import os.path import sys script_dir = os.path.dirname(__file__) sys.path.insert(0, os.path.join(script_dir, '..', '..')) sys.path.insert(0, script_dir)
[ [ 1, 0, 0.4444, 0.1111, 0, 0.66, 0, 79, 0, 1, 0, 0, 79, 0, 0 ], [ 1, 0, 0.5556, 0.1111, 0, 0.66, 0.25, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 14, 0, 0.7778, 0.1111, 0, 0.6...
[ "import os.path", "import sys", "script_dir = os.path.dirname(__file__)", "sys.path.insert(0, os.path.join(script_dir, '..', '..'))", "sys.path.insert(0, script_dir)" ]
#!/usr/bin/python # $Id:$ import os import sys import unittest from pyglet.gl import * from pyglet import image from pyglet import resource from pyglet import window __noninteractive = True # Test image is laid out # M R # B G # In this test the image is sampled at four points from top-right cloc...
[ [ 1, 0, 0.0476, 0.0119, 0, 0.66, 0, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.0595, 0.0119, 0, 0.66, 0.1111, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 1, 0, 0.0714, 0.0119, 0, ...
[ "import os", "import sys", "import unittest", "from pyglet.gl import *", "from pyglet import image", "from pyglet import resource", "from pyglet import window", "__noninteractive = True", "class TestCase(unittest.TestCase):\n def setUp(self):\n self.w = window.Window(width=10, height=10)\n...
#!/usr/bin/env python ''' ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' __noninteractive = True ''' Layout: . (script home) file.txt F1 dir1/ file.txt F2 dir1/ file.txt F3 res.zip/...
[ [ 8, 0, 0.0217, 0.0124, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.0373, 0.0062, 0, 0.66, 0.0909, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.0435, 0.0062, 0, 0.66...
[ "'''\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id: $'", "__noninteractive = True", "'''\nLayout:\n\n. (script home)\n file.txt F1\n dir1/\n file.txt F2\n dir1/", "import os", "import sys", "import u...
#!/usr/bin/env python '''Test that rendering of bullet glyphs works. You should see 5 bullet glyphs rendered in the bottom-left of the window. ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' import unittest from pyglet import font import base_text class TEST_HALIGN(base_text.TextTestBase): font...
[ [ 8, 0, 0.1957, 0.1739, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.3478, 0.0435, 0, 0.66, 0.1429, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.3913, 0.0435, 0, 0.66...
[ "'''Test that rendering of bullet glyphs works.\n\nYou should see 5 bullet glyphs rendered in the bottom-left of the window.\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id: $'", "import unittest", "from pyglet import font", "import base_text", "class TEST_HALIGN(base_text.TextTestBase)...
#!/usr/bin/env python '''Test that a font likely to be installed on the computer can be loaded and displayed correctly. One window will open, it should show "Quickly brown fox" at 24pt using: * "Helvetica" on Mac OS X * "Arial" on Windows ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' import un...
[ [ 8, 0, 0.2188, 0.2812, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.4062, 0.0312, 0, 0.66, 0.125, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.4375, 0.0312, 0, 0.66,...
[ "'''Test that a font likely to be installed on the computer can be\nloaded and displayed correctly.\n\nOne window will open, it should show \"Quickly brown fox\" at 24pt using:\n\n * \"Helvetica\" on Mac OS X\n * \"Arial\" on Windows", "__docformat__ = 'restructuredtext'", "__version__ = '$Id: $'", "import ...
#!/usr/bin/env python '''Base class for text tests. ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' import unittest import sys from pyglet.gl import * from pyglet import font from pyglet.window import * from pyglet.window.event import * from tests.regression import ImageRegressionTestCase class Text...
[ [ 8, 0, 0.0636, 0.0364, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.1091, 0.0182, 0, 0.66, 0.0909, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.1273, 0.0182, 0, 0.66...
[ "'''Base class for text tests.\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id: $'", "import unittest", "import sys", "from pyglet.gl import *", "from pyglet import font", "from pyglet.window import *", "from pyglet.window.event import *", "from tests.regression import ImageRegres...
#!/usr/bin/env python '''Test that font.Text alignment works with multiple lines. Three labels will be rendered at the top-left, center and bottom-right of the window. Resize the window to ensure the alignment is as specified. ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' import unittest from pygl...
[ [ 8, 0, 0.0926, 0.0926, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.1667, 0.0185, 0, 0.66, 0.1429, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.1852, 0.0185, 0, 0.66...
[ "'''Test that font.Text alignment works with multiple lines.\n\nThree labels will be rendered at the top-left, center and bottom-right of the\nwindow. Resize the window to ensure the alignment is as specified.\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id: $'", "import unittest", "from p...
#!/usr/bin/env python '''Test that text will not wrap when its width is set to its calculated width. You should be able to clearly see "TEST TEST" on a single line (not two) and "SPAM SPAM SPAM" over two lines, not three. ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' import unittest import base_text...
[ [ 8, 0, 0.1667, 0.1818, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.303, 0.0303, 0, 0.66, 0.1429, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.3333, 0.0303, 0, 0.66,...
[ "'''Test that text will not wrap when its width is set to its calculated\nwidth.\n\nYou should be able to clearly see \"TEST TEST\" on a single line (not two)\nand \"SPAM SPAM SPAM\" over two lines, not three.\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id: $'", "import unittest", "import ...
#!/usr/bin/env python '''Test that the horizontal font metrics are calculated correctly. Some text in various fonts will be displayed. Green vertical lines mark the left edge of the text. Blue vertical lines mark the right edge of the text. Press ESC to end the test. ''' __docformat__ = 'restructuredtext' __versi...
[ [ 8, 0, 0.1032, 0.127, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.1905, 0.0159, 0, 0.66, 0.1, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.2063, 0.0159, 0, 0.66, ...
[ "'''Test that the horizontal font metrics are calculated correctly.\n\nSome text in various fonts will be displayed. Green vertical lines mark\nthe left edge of the text. Blue vertical lines mark the right edge of the\ntext.\n\nPress ESC to end the test.\n'''", "__docformat__ = 'restructuredtext'", "__version...
#!/usr/bin/env python '''Test that font colour is applied correctly. Default font should appear blue. ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' import unittest import base_text from pyglet import font class TEST_COLOR(base_text.TextTestBase): def render(self): fnt = font.load(self.f...
[ [ 8, 0, 0.1905, 0.1429, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.3333, 0.0476, 0, 0.66, 0.1429, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.381, 0.0476, 0, 0.66,...
[ "'''Test that font colour is applied correctly. Default font should\nappear blue.\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id$'", "import unittest", "import base_text", "from pyglet import font", "class TEST_COLOR(base_text.TextTestBase):\n def render(self):\n fnt = font...
#!/usr/bin/env python '''Test that a font with no name given still renders using some sort of default system font. ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' import unittest import base_text class TEST_DEFAULT(base_text.TextTestBase): font_name = '' if __name__ == '__main__': unittest.ma...
[ [ 8, 0, 0.2353, 0.1765, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.4118, 0.0588, 0, 0.66, 0.1667, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.4706, 0.0588, 0, 0.66...
[ "'''Test that a font with no name given still renders using some sort\nof default system font.\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id: $'", "import unittest", "import base_text", "class TEST_DEFAULT(base_text.TextTestBase):\n font_name = ''", " font_name = ''", "if __na...
#!/usr/bin/env python '''Test that font.Text vertical alignment works. Four labels will be aligned top, center, baseline and bottom. ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' import unittest from pyglet import gl from pyglet import font import base_text class TEST_VALIGN(base_text.TextTestBas...
[ [ 8, 0, 0.0978, 0.087, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.1739, 0.0217, 0, 0.66, 0.125, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.1957, 0.0217, 0, 0.66, ...
[ "'''Test that font.Text vertical alignment works.\n\nFour labels will be aligned top, center, baseline and bottom.\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id: $'", "import unittest", "from pyglet import gl", "from pyglet import font", "import base_text", "class TEST_VALIGN(base_t...
#!/usr/bin/env python '''Test that a specific DPI can be set to render the text with. Some text in Action Man font will be displayed. A green box should exactly bound the top and bottom of the text. Press ESC to end the test. ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' import os import unittest ...
[ [ 8, 0, 0.1091, 0.1273, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.2, 0.0182, 0, 0.66, 0.1, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.2182, 0.0182, 0, 0.66, ...
[ "'''Test that a specific DPI can be set to render the text with.\n\nSome text in Action Man font will be displayed. A green box should exactly\nbound the top and bottom of the text.\n\nPress ESC to end the test.\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id: $'", "import os", "import uni...
#!/usr/bin/env python '''Test that font colour is applied correctly. Default font should appear at 0.1 opacity (faint white) ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' import unittest import base_text from pyglet import font class TEST_COLOR_BLEND(base_text.TextTestBase): def render(self): ...
[ [ 8, 0, 0.1905, 0.1429, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.3333, 0.0476, 0, 0.66, 0.1429, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.381, 0.0476, 0, 0.66,...
[ "'''Test that font colour is applied correctly. Default font should\nappear at 0.1 opacity (faint white)\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id$'", "import unittest", "import base_text", "from pyglet import font", "class TEST_COLOR_BLEND(base_text.TextTestBase):\n def rend...
#!/usr/bin/env python '''Test that font.Text horizontal alignment works. Three labels will be rendered aligned left, center and right. ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' import unittest from pyglet import font import base_text class TEST_HALIGN(base_text.TextTestBase): font_name = ...
[ [ 8, 0, 0.1098, 0.0976, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.1951, 0.0244, 0, 0.66, 0.1429, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.2195, 0.0244, 0, 0.66...
[ "'''Test that font.Text horizontal alignment works.\n\nThree labels will be rendered aligned left, center and right.\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id: $'", "import unittest", "from pyglet import font", "import base_text", "class TEST_HALIGN(base_text.TextTestBase):\n f...
#!/usr/bin/env python '''Test that a font distributed with the application can be displayed. Four lines of text should be displayed, each in a different variant (bold/italic/regular) of Action Man at 24pt. The Action Man fonts are included in the test directory (tests/font) as action_man*.ttf. Press ESC to end the ...
[ [ 8, 0, 0.125, 0.1538, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.2308, 0.0192, 0, 0.66, 0.1111, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.25, 0.0192, 0, 0.66, ...
[ "'''Test that a font distributed with the application can be displayed.\n\nFour lines of text should be displayed, each in a different variant\n(bold/italic/regular) of Action Man at 24pt. The Action Man fonts are\nincluded in the test directory (tests/font) as action_man*.ttf.\n\nPress ESC to end the test.\n'''",...
#!/usr/bin/env python ''' ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' import unittest from pyglet.image import get_buffer_manager class ImageRegressionTestCase(unittest.TestCase): _enable_regression_image = False _enable_interactive = True _captured_image = None def capture_regress...
[ [ 8, 0, 0.1458, 0.0833, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.25, 0.0417, 0, 0.66, 0.2, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.2917, 0.0417, 0, 0.66, ...
[ "'''\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id$'", "import unittest", "from pyglet.image import get_buffer_manager", "class ImageRegressionTestCase(unittest.TestCase):\n _enable_regression_image = False\n _enable_interactive = True\n _captured_image = None\n\n def captur...
#!/usr/bin/env python '''Test that audio playback works. You should hear a tone at 440Hz (A above middle C) for 1.0 seconds. The test will exit immediately after. You may want to turn down the volume of your speakers. ''' import unittest from pyglet import media from pyglet.media import procedural ...
[ [ 8, 0, 0.2069, 0.2414, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.3793, 0.0345, 0, 0.66, 0.2, 88, 0, 1, 0, 0, 88, 0, 0 ], [ 1, 0, 0.4483, 0.0345, 0, 0.66, ...
[ "'''Test that audio playback works.\n\nYou should hear a tone at 440Hz (A above middle C) for 1.0 seconds. The test\nwill exit immediately after. \n\nYou may want to turn down the volume of your speakers.\n'''", "import unittest", "from pyglet import media", "from pyglet.media import procedural", "class T...
#!/usr/bin/env python '''Test that audio playback works. You should hear white noise (static) for 0.5 seconds. The test will exit immediately after. You may want to turn down the volume of your speakers. ''' import unittest from pyglet import media from pyglet.media import procedural class TEST_...
[ [ 8, 0, 0.2143, 0.25, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.3929, 0.0357, 0, 0.66, 0.2, 88, 0, 1, 0, 0, 88, 0, 0 ], [ 1, 0, 0.4643, 0.0357, 0, 0.66, 0...
[ "'''Test that audio playback works.\n\nYou should hear white noise (static) for 0.5 seconds. The test will exit\nimmediately after. \n\nYou may want to turn down the volume of your speakers.\n'''", "import unittest", "from pyglet import media", "from pyglet.media import procedural", "class TEST_CASE(unitt...
#!/usr/bin/env python '''Test that audio playback works. You should hear white noise (static) for 0.5 seconds. The test will exit immediately after. You may want to turn down the volume of your speakers. ''' import unittest from pyglet import media from pyglet.media import procedural class TEST_...
[ [ 8, 0, 0.2222, 0.2593, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.4074, 0.037, 0, 0.66, 0.2, 88, 0, 1, 0, 0, 88, 0, 0 ], [ 1, 0, 0.4815, 0.037, 0, 0.66, 0...
[ "'''Test that audio playback works.\n\nYou should hear white noise (static) for 0.5 seconds. The test will exit\nimmediately after. \n\nYou may want to turn down the volume of your speakers.\n'''", "import unittest", "from pyglet import media", "from pyglet.media import procedural", "class TEST_CASE(unitt...
#!/usr/bin/env python '''Test that audio playback works. You should hear white noise (static) for 0.5 seconds. The test will exit immediately after. You may want to turn down the volume of your speakers. ''' import unittest from pyglet import media from pyglet.media import procedural class TEST_...
[ [ 8, 0, 0.2222, 0.2593, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.4074, 0.037, 0, 0.66, 0.2, 88, 0, 1, 0, 0, 88, 0, 0 ], [ 1, 0, 0.4815, 0.037, 0, 0.66, 0...
[ "'''Test that audio playback works.\n\nYou should hear white noise (static) for 0.5 seconds. The test will exit\nimmediately after. \n\nYou may want to turn down the volume of your speakers.\n'''", "import unittest", "from pyglet import media", "from pyglet.media import procedural", "class TEST_CASE(unitt...
#!/usr/bin/env python '''Test that audio playback works. You should hear white noise (static) for 0.5 seconds. The test will exit immediately after. You may want to turn down the volume of your speakers. ''' import unittest from pyglet import media from pyglet.media import procedural class TEST_...
[ [ 8, 0, 0.2069, 0.2414, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.3793, 0.0345, 0, 0.66, 0.2, 88, 0, 1, 0, 0, 88, 0, 0 ], [ 1, 0, 0.4483, 0.0345, 0, 0.66, ...
[ "'''Test that audio playback works.\n\nYou should hear white noise (static) for 0.5 seconds. The test will exit\nimmediately after. \n\nYou may want to turn down the volume of your speakers.\n'''", "import unittest", "from pyglet import media", "from pyglet.media import procedural", "class TEST_CASE(unitt...
#!/usr/bin/env python '''Test that audio playback works. You should hear white noise (static) for 0.25 seconds, then a 0.5 second pause then another 0.25 seconds of noise. The test will exit immediately after. You may want to turn down the volume of your speakers. ''' import unittest import time ...
[ [ 8, 0, 0.1622, 0.1892, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.2973, 0.027, 0, 0.66, 0.1667, 88, 0, 1, 0, 0, 88, 0, 0 ], [ 1, 0, 0.3514, 0.027, 0, 0.66, ...
[ "'''Test that audio playback works.\n\nYou should hear white noise (static) for 0.25 seconds, then a 0.5 second pause\nthen another 0.25 seconds of noise. The test will exit immediately after. \n\nYou may want to turn down the volume of your speakers.\n'''", "import unittest", "import time", "from pyglet im...
#!/usr/bin/env python '''Test that window size can be set. Expected behaviour: One window will be opened. The window's dimensions will be printed to the terminal. - press "x" to increase the width - press "X" to decrease the width - press "y" to increase the height - press "Y" to decre...
[ [ 8, 0, 0.1923, 0.2885, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.3654, 0.0192, 0, 0.66, 0.125, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.3846, 0.0192, 0, 0.66,...
[ "'''Test that window size can be set.\n\nExpected behaviour:\n One window will be opened. The window's dimensions will be printed\n to the terminal. \n\n - press \"x\" to increase the width\n - press \"X\" to decrease the width", "__docformat__ = 'restructuredtext'", "__version__ = '$Id: $'", ...
#!/usr/bin/env python '''Test that exclusive mouse mode can be set. Expected behaviour: One window will be opened. Press 'e' to enable exclusive mode and 'E' to disable exclusive mode. In exclusive mode: - the mouse cursor should be invisible - moving the mouse should generate events with bogu...
[ [ 8, 0, 0.2292, 0.3542, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.4375, 0.0208, 0, 0.66, 0.1429, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.4583, 0.0208, 0, 0.66...
[ "'''Test that exclusive mouse mode can be set.\n\nExpected behaviour:\n One window will be opened. Press 'e' to enable exclusive mode and 'E'\n to disable exclusive mode.\n\n In exclusive mode:\n - the mouse cursor should be invisible", "__docformat__ = 'restructuredtext'", "__version__ = '$Id: $'...
#!/usr/bin/env python '''Test that window style can be dialog. Expected behaviour: One dialog-styled window will be opened. Close the window or press ESC to end the test. ''' __docformat__ = 'restructuredtext' __version__ = '$Id: WINDOW_SET_MOUSE_CURSOR.py 717 2007-03-03 07:04:10Z Alex.Holkner $' import un...
[ [ 8, 0, 0.1818, 0.2121, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.3333, 0.0303, 0, 0.66, 0.125, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.3636, 0.0303, 0, 0.66,...
[ "'''Test that window style can be dialog.\n\nExpected behaviour:\n One dialog-styled window will be opened.\n\n Close the window or press ESC to end the test.\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id: WINDOW_SET_MOUSE_CURSOR.py 717 2007-03-03 07:04:10Z Alex.Holkner $'", "import u...
#!/usr/bin/python # $Id:$ import unittest from pyglet import window import base_event_sequence __noninteractive = True class TEST_CLASS(base_event_sequence.BaseEventSequence): last_sequence = 3 def on_resize(self, width, height): self.check_sequence(1, 'on_resize') def on_show(self): ...
[ [ 1, 0, 0.1081, 0.027, 0, 0.66, 0, 88, 0, 1, 0, 0, 88, 0, 0 ], [ 1, 0, 0.1622, 0.027, 0, 0.66, 0.2, 182, 0, 1, 0, 0, 182, 0, 0 ], [ 1, 0, 0.2162, 0.027, 0, 0.66, ...
[ "import unittest", "from pyglet import window", "import base_event_sequence", "__noninteractive = True", "class TEST_CLASS(base_event_sequence.BaseEventSequence):\n last_sequence = 3\n\n def on_resize(self, width, height):\n self.check_sequence(1, 'on_resize')\n\n def on_show(self):\n ...
#!/usr/bin/env python '''Test that screens can be selected for fullscreen. Expected behaviour: One window will be created fullscreen on the primary screen. When you close this window, another will open on the next screen, and so on until all screens have been tested. Each screen will be filled ...
[ [ 8, 0, 0.1607, 0.2679, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.3214, 0.0179, 0, 0.66, 0.125, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.3393, 0.0179, 0, 0.66,...
[ "'''Test that screens can be selected for fullscreen.\n\nExpected behaviour: \n One window will be created fullscreen on the primary screen. When you\n close this window, another will open on the next screen, and so \n on until all screens have been tested.\n\n Each screen will be filled with a dif...
#!/usr/bin/env python '''Test that minimum and maximum window size can be set. Expected behaviour: One window will be opened. The window's dimensions will be printed to the terminal. Initially the window has no minimum or maximum size (besides any OS-enforced limit). - press "n" to set the minimum...
[ [ 8, 0, 0.1827, 0.2692, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.3462, 0.0192, 0, 0.66, 0.125, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.3654, 0.0192, 0, 0.66,...
[ "'''Test that minimum and maximum window size can be set.\n\nExpected behaviour:\n One window will be opened. The window's dimensions will be printed\n to the terminal. Initially the window has no minimum or maximum\n size (besides any OS-enforced limit).\n\n - press \"n\" to set the minimum size to ...
#!/usr/bin/env python # $Id: $ import unittest from pyglet import window import base_event_sequence __noninteractive = True class TEST_CLASS(base_event_sequence.BaseEventSequence): last_sequence = 2 def on_resize(self, width, height): self.check_sequence(1, 'on_resize') def on_expose(self): ...
[ [ 1, 0, 0.1176, 0.0294, 0, 0.66, 0, 88, 0, 1, 0, 0, 88, 0, 0 ], [ 1, 0, 0.1765, 0.0294, 0, 0.66, 0.2, 182, 0, 1, 0, 0, 182, 0, 0 ], [ 1, 0, 0.2353, 0.0294, 0, 0.66,...
[ "import unittest", "from pyglet import window", "import base_event_sequence", "__noninteractive = True", "class TEST_CLASS(base_event_sequence.BaseEventSequence):\n last_sequence = 2\n\n def on_resize(self, width, height):\n self.check_sequence(1, 'on_resize')\n\n def on_expose(self):\n ...
#!/usr/bin/env python '''Test that window icon can be set for multiple sizes. Expected behaviour: One window will be opened. The window's icon depends on the icon size: 16x16 icon is a yellow "1" 32x32 icon is a purple "2" 48x48 icon is a cyan "3" 72x72 icon is a red "4" 128x12...
[ [ 8, 0, 0.1983, 0.3103, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.3793, 0.0172, 0, 0.66, 0.0625, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.3966, 0.0172, 0, 0.66...
[ "'''Test that window icon can be set for multiple sizes.\n\nExpected behaviour:\n One window will be opened. The window's icon depends on the icon\n size:\n\n 16x16 icon is a yellow \"1\"\n 32x32 icon is a purple \"2\"", "__docformat__ = 'restructuredtext'", "__version__ = '$Id: WINDOW_SET_MOUS...
#!/usr/bin/env python # $Id: $ import unittest from pyglet import window import base_event_sequence __noninteractive = True class TEST_CLASS(base_event_sequence.BaseEventSequence): last_sequence = 3 def on_resize(self, width, height): self.check_sequence(1, 'on_resize') def on_show(self): ...
[ [ 1, 0, 0.1212, 0.0303, 0, 0.66, 0, 88, 0, 1, 0, 0, 88, 0, 0 ], [ 1, 0, 0.1818, 0.0303, 0, 0.66, 0.2, 182, 0, 1, 0, 0, 182, 0, 0 ], [ 1, 0, 0.2424, 0.0303, 0, 0.66,...
[ "import unittest", "from pyglet import window", "import base_event_sequence", "__noninteractive = True", "class TEST_CLASS(base_event_sequence.BaseEventSequence):\n last_sequence = 3\n\n def on_resize(self, width, height):\n self.check_sequence(1, 'on_resize')\n\n def on_show(self):\n ...
#!/usr/bin/env python '''Test that mouse drag event works correctly. Expected behaviour: One window will be opened. Click and drag with the mouse and ensure that buttons, coordinates and modifiers are reported correctly. Events should be generated even when the drag leaves the window. Close the win...
[ [ 8, 0, 0.2333, 0.3, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.4333, 0.0333, 0, 0.66, 0.1429, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.4667, 0.0333, 0, 0.66, ...
[ "'''Test that mouse drag event works correctly.\n\nExpected behaviour:\n One window will be opened. Click and drag with the mouse and ensure\n that buttons, coordinates and modifiers are reported correctly. Events\n should be generated even when the drag leaves the window.\n\n Close the window or pres...
#!/usr/bin/env python '''Test that the window can be hidden and shown. Expected behaviour: One window will be opened. Every 5 seconds it will toggle between hidden and shown. Press escape or close the window to finish the test. ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' import time ...
[ [ 8, 0, 0.1757, 0.2162, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.3243, 0.027, 0, 0.66, 0.125, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.3514, 0.027, 0, 0.66, ...
[ "'''Test that the window can be hidden and shown.\n\nExpected behaviour:\n One window will be opened. Every 5 seconds it will toggle between\n hidden and shown.\n\n Press escape or close the window to finish the test.\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id: $'", "import tim...
#!/usr/bin/env python '''Test that a window can be opened. Expected behaviour: One small window will be opened coloured purple. Close the window or press ESC to end the test. ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' import unittest from pyglet import window from pyglet.gl import * clas...
[ [ 8, 0, 0.1351, 0.1892, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.2703, 0.027, 0, 0.66, 0.1429, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.2973, 0.027, 0, 0.66, ...
[ "'''Test that a window can be opened.\n\nExpected behaviour: \n One small window will be opened coloured purple.\n\n Close the window or press ESC to end the test.\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id$'", "import unittest", "from pyglet import window", "from pyglet.gl imp...
#!/usr/bin/env python '''Test that close event works correctly. Expected behaviour: One window will be opened. Click the close button and ensure the event is printed to the terminal. The window should not close when you do this. Press ESC to end the test. ''' __docformat__ = 'restructuredtext' __v...
[ [ 8, 0, 0.1707, 0.2195, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.3171, 0.0244, 0, 0.66, 0.125, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.3415, 0.0244, 0, 0.66,...
[ "'''Test that close event works correctly.\n\nExpected behaviour:\n One window will be opened. Click the close button and ensure the\n event is printed to the terminal. The window should not close\n when you do this.\n\n Press ESC to end the test.", "__docformat__ = 'restructuredtext'", "__version...
#!/usr/bin/env python '''Test that window expose event works correctly. Expected behaviour: One window will be opened. Uncovering the window from other windows or the edge of the screen should produce the expose event. Note that on OS X and other compositing window managers this event is equivalent ...
[ [ 8, 0, 0.2353, 0.3235, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.4412, 0.0294, 0, 0.66, 0.1667, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.4706, 0.0294, 0, 0.66...
[ "'''Test that window expose event works correctly.\n\nExpected behaviour:\n One window will be opened. Uncovering the window from other windows\n or the edge of the screen should produce the expose event.\n\n Note that on OS X and other compositing window managers this event\n is equivalent to EVENT_SH...
#!/usr/bin/env python '''Test that window location can be set. Expected behaviour: One window will be opened. The window's location will be printed to the terminal. - Use the arrow keys to move the window. Close the window or press ESC to end the test. ''' __docformat__ = 'restructuredtext' __v...
[ [ 8, 0, 0.1705, 0.2273, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.3182, 0.0227, 0, 0.66, 0.1429, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.3409, 0.0227, 0, 0.66...
[ "'''Test that window location can be set.\n\nExpected behaviour:\n One window will be opened. The window's location will be printed\n to the terminal. \n\n - Use the arrow keys to move the window.", "__docformat__ = 'restructuredtext'", "__version__ = '$Id: $'", "import unittest", "from pyglet i...