code
stringlengths
1
1.72M
language
stringclasses
1 value
#!/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 ...
Python
#!/usr/bin/python # $Id:$ '''Display font information. Usage:: inspect_font.py <filename> [<filename> ...] ''' import sys from pyglet.font import ttf def inspect_font(filename): try: info = ttf.TruetypeInfo(filename) print '%s:' % filename, print info.get_name('family'), pr...
Python
"""bdist_mpkg.cmd_bdist_mpkg Implements the Distutils 'bdist_mpkg' command (create an OS X "mpkg" binary distribution).""" import os import sys import zipfile from setuptools import Command from distutils.util import get_platform, byte_compile from distutils.dir_util import remove_tree, mkpath from distutils.errors...
Python
import os, sys try: set except NameError: from sets import Set as set def fsencoding(s, encoding=sys.getfilesystemencoding()): if isinstance(s, unicode): s = s.encode(encoding) return s SCMDIRS = ['CVS', '.svn'] def skipscm(ofn): ofn = fsencoding(ofn) fn = os.path.basename(ofn) if ...
Python
#!/usr/bin/env python import sys, os import setuptools import bdist_mpkg_pyglet def main(): del sys.argv[0] if not sys.argv: sys.argv[:0] = ['setup.py', '--open'] elif sys.argv[0].startswith('-'): sys.argv[:0] = ['setup.py'] elif len(sys.argv) == 1: sys.argv[1:1] = ['--open'] ...
Python
import os import sys from cStringIO import StringIO from distutils.dir_util import mkpath from distutils.file_util import copy_file from bdist_mpkg_pyglet import tools, plists from bdist_mpkg_pyglet.util import copy_tree from bdist_mpkg_pyglet.templates import InstallationCheck def write_template((script, strings), d...
Python
import os import sys from itertools import chain from distutils.util import spawn from distutils.version import StrictVersion, LooseVersion from distutils.dir_util import mkpath import distutils.core try: set except NameError: from sets import Set as set def Version(s): try: return StrictVersion(s...
Python
import os import sys from plistlib import Plist import bdist_mpkg_pyglet from bdist_mpkg_pyglet import tools def _major_minor(v): rval = [0, 0] try: for i, rev in enumerate(v.version): rval[i] = int(rev) except (TypeError, ValueError, IndexError): pass return rval def comm...
Python
__version__ = '0.4.3-pyglet'
Python
InstallationCheck = dict( postjaguar=( u"#!/bin/sh\nexit 112\n", u'"16" = "This package requires Mac OS X 10.3 or later";', ), prepanther=(u"""#!/bin/sh # # We use IFRequirementDicts anyway and "parse" it to find where expect # Python to be. It's remotely possible that Python is not install...
Python
#!/usr/bin/python # $Id:$ '''Rewrite the license header of source files. Usage: license.py file.py file.py dir/ dir/ ... ''' import optparse import os import sys license = '''# pyglet # Copyright (c) 2006-2008 Alex Holkner # All rights reserved. # # Redistribution and use in source and binary ...
Python
#!/usr/bin/env python '''Demonstrates basic use of IncrementalTextLayout and Caret. A simple widget-like system is created in this example supporting keyboard and mouse focus. ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' import pyglet class Rectangle(object): '''Draws a rectangle into a batch....
Python
#!/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 ...
Python
#!/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 ...
Python
#!/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 ...
Python
#!/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 ...
Python
#!/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 ...
Python
#!/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 ...
Python
#!/usr/bin/python # $Id:$ import pyglet window = pyglet.window.Window() tablets = pyglet.input.get_tablets() canvases = [] if tablets: print 'Tablets:' for i, tablet in enumerate(tablets): print ' (%d) %s' % (i + 1, tablet.name) print 'Press number key to open corresponding tablet d...
Python
#!/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 me...
Python
#!/usr/bin/env python '''Print details of a media file that pyglet can open (requires AVbin). Usage:: media_info.py <filename> ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' import sys import pyglet def print_avbin_info(): try: from pyglet.media import avbin print 'Using A...
Python
#!/usr/bin/env python ''' ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' import pyglet from pyglet.gl import * joysticks = pyglet.input.get_joysticks() assert joysticks, 'No joystick device is connected' joystick = joysticks[0] joystick.open() window = pyglet.window.Window() @window.event def on_dr...
Python
#!/usr/bin/env python '''Graphically show all devices available via the pyglet.input interface. Each device is shown in its own collapsed panel. Click on a device panel to expand it, revealing that device's controls. The controls show the current live values, and flash white when the value changes. ''' __docformat...
Python
#!/usr/bin/python # $Id:$ '''In order to use the new features of OpenGL 3, you must explicitly create an OpenGL 3 context. You can do this by supplying the `major_version` and `minor_version` attributes for a GL Config. This example creates an OpenGL 3 context, prints the version string to stdout, and exits....
Python
#!/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 ...
Python
#!/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 ...
Python
#!/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 ...
Python
#!/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 ...
Python
''' A silly demonstration of how to use the Apple remote. ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' import pyglet from pyglet.gl import * import sys class MainWindow(pyglet.window.Window): def __init__(self): super(MainWindow, self).__init__(visible=False) self.set_caption('A...
Python
#!/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 ...
Python
#!/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 ...
Python
#!/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 ...
Python
#!/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 ...
Python
#!/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 ...
Python
#!/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 ...
Python
#!/usr/bin/env python ''' ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' import pyglet import sys window = pyglet.window.Window() @window.event def on_draw(): window.clear() remote = pyglet.input.get_apple_remote() if not remote: print 'Apple IR Remote not available.' sys.exit(0) remot...
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 met: # # * Redistribu...
Python
#!/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 ...
Python
#!/usr/bin/env python ''' ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' import pyglet window = pyglet.window.Window() devices = pyglet.input.get_devices() def watch_control(device, control): @control.event def on_change(value): print '%r: %r.on_change(%r)' % (device, control, value)...
Python
#!/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 ...
Python
#!/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 ...
Python
#!/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 ...
Python
#!/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 ...
Python
#!/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...
Python
#!/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...
Python
#!/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...
Python
#!/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 ...
Python
#!/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...
Python
#!/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...
Python
#!/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...
Python
#!/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...
Python
#!/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...
Python
#!/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, ...
Python
#!/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...
Python
#!/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...
Python
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 ...
Python
#!/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...
Python
#!/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 ...
Python
#!/usr/bin/env python ''' ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' import math import warnings from OpenGL.GL import * class DrawingContext(object): __slots__ = ['transitions'] def __init__(self): self.transitions = [] def draw(self, widget): if widget.transition: ...
Python
#!/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 == ...
Python
#!/usr/bin/env python ''' ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' import sys import lib_pulseaudio as pa import pyglet _debug = pyglet.options['debug_media'] from pyglet.media import AudioPlayer, Listener, MediaException def check(result): if result < 0: error = pa.pa_context_er...
Python
'''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_...
Python
'''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...
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 met: # # * Redistribu...
Python
#!/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)
Python
#!/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) ...
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 met: # # * Redistribu...
Python
#!/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()
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 met: # # * Redistribu...
Python
#!/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...
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 met: # # * Redistribu...
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 met: # # * Redistribu...
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 met: # # * Redistribu...
Python
#!/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. ...
Python
#!/usr/bin/env python ''' ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' import sys import lib_pulseaudio as pa import pyglet _debug = pyglet.options['debug_media'] import mt_media def check(result): if result < 0: error = pa.pa_context_errno(context._context) raise MediaExcept...
Python
'''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_...
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 met: # # * Redistribu...
Python
#!/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...
Python
#!/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 ...
Python
#!/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): ...
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 met: # # * Redistribu...
Python
#!/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)
Python
#!/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): ...
Python
'''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...
Python
#!/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...
Python
#!/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) ...
Python
'''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'): ...
Python
#!/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...
Python
#!/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 :-)
Python
# 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...
Python
#!/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...
Python
#!/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...
Python
#!/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...
Python
#!/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,...
Python
#!/usr/bin/python # $Id:$ import ctypes import pyglet lib = ctypes.windll.wintab32 LONG = ctypes.c_long BOOL = ctypes.c_int UINT = ctypes.c_uint WORD = ctypes.c_uint16 DWORD = ctypes.c_uint32 WCHAR = ctypes.c_wchar FIX32 = DWORD WTPKT = DWORD LCNAMELEN = 40 class AXIS(ctypes.Structure): _...
Python
#!/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...
Python
#!/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 ...
Python
# ---------------------------------------------------------------------------- # 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...
Python
#!/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.startswith('lin...
Python
#!/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...
Python