{ "info": { "author": "Roman Valov", "author_email": "roman.valov@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "======\npyglfw\n======\n\nPython bindings for the `GLFW `_ library.\n\nHome: https://bitbucket.org/pyglfw/pyglfw\n\nMirror: https://github.com/pyglfw/pyglfw\n\nIntroduction\n============\n\nAt the moment of development there were already available\nnumerous variants of bindings for the glfw library to python.\nBesides driving by NIH syndrome these binding were developed\nwith following assumptions in mind:\n\n - Compatibility with GLFW version 3 and higher API.\n - Support for both Python2 (2.7) and Python3 (3.3+).\n - Provide low-level and pythonic API separately.\n - No external dependencies. Thus using ctypes.\n\nPlatforms\n---------\n\nDuring development these bindings were proven to work \non all major operating systems environments including\nWindows, OSX and Linux.\n\nCPython implementations were tested against versions\nof Python 2.7 and Python 3.3 with no serious issues found.\n\nBy the way testing was performed with PyPy. As a result there\nwere revealed issue with ctypes implemenation in PyPy. Issue\nwas fixed and should be available as a part of PyPy 2.2.2.\n\n\nLicensing\n---------\n\nThese bindings are distributed under the terms and\nconditions of zlib license with the exception to files\nin examples folder which are provided with no limitations\nto use. Full text of license with copyright notice is\nprovided in the LICENSE file.\n\n-------\n\nInstallation\n============\n\nEnsure you've installed GLFW shared library binary\naccording to instructions on project's page related\nto installed operating system.\n\nProject releases are available from pypi and could\nbe installed using pip or easy_install, i.e.:\n\n::\n\n # pip install pyglfw\n\nMoreover exe installables for the Windows platform\ncould be found on the project's home `download page`__\n\n__ https://bitbucket.org/pyglfw/pyglfw/downloads\n\nIn addition, Ubuntu users are able to install pyglfw\nusing project's `PPA`__. Archive also provides packages\nfor glfw3 library itself and backported python-opengl.\n\n__ https://launchpad.net/~pyglfw/+archive/pyglfw\n\nLatest version could be installed from cloned source\nwith provided setup.py script. Following commands\ndepend on system used:\n\n\nOn Linux and OSX\n----------------\n\n::\n\n $ python ./setup.py sdist\n\nthen\n\n::\n\n # easy_install dist/pyglfw-.tar.gz\n\nor\n\n::\n\n # pip install dist/pyglfw-.tar.gz\n\n\nOn Windows\n----------\n\n::\n\n > python.exe setup.py bdist_wininst\n\nthen run exe installer from dist folder.\n\n-------\n\nLibapi\n======\n\nLow-level **libapi** package serves as thin wrapper\nabove GLFW library. It's API mostly resemble one of\nC library except functions that require pass-by-ref\nparameters. As a rule of thumb all functions that\nreturn void and fill several values via pass-by-ref\nparameters are mapped to functions returning tuple\nof values. And functions that return pointer to array\nwith number of items set via pass-by-ref parameter are \nmapped to functions returning list of items. I.e.:\n\n::\n\n int major, minor, rev;\n glfwGetVersion(&major, &minor, &rev)\n\nbecomes\n\n::\n\n major, minor, rev = glfwGetVersion()\n\nand\n\n::\n\n int n_items;\n GLFWmonitor **monitors = glfwGetMonitors(&n_items)\n\nbecomes\n\n::\n \n monitors = glfwGetMonitors()\n\n\nSpecial note should be done regarding window pointer\nfunctions. glfwSetWindowPointer allows to set any \npython object as a window private data and retrieve\nit back with glfwGetWindowPointer. However it's still\nrequired to hold reference to this object in python\ncode. Also this functionality will not work with PyPy\nimplemetation due to lack of py_object support.\n\nThe requirement to hold references also spreads to\nfunctions that are settings varios callbacks. Please\nrefer to *raw_api* in examples for usage primer.\n\nPyglfw\n======\n\nPythonic **pyglfw** package handles following moments:\n\n - Encapsulation of struct pointers and functions API\n into objects with properties and methods.\n - Transparent usage of strings (either from python 2\n or from python 3).\n - Raising exceptions in case of errors.\n - Eliminates need to use of ctypes structures and\n ctypes-based callback prototypes.\n - Holds references for set to callback functions,\n so there is no need to hold them outside.\n - Provide pythonic types for callback functions.\n\nand following functionality is restricted:\n\n - No get/set window pointers. Due to its ambiquity.\n - No set error callback. Error callback is used to\n raise exeptions.\n - Set callback methods doesn't return previously\n used callback. It's unable to certainly map them\n to python object in every case.\n - No check for extensions and proc address query.\n This should be handled with dedicated frameworks\n like PyOpenGL.\n\nSide-by-Side\n============\n\nHere is side-by-side comparison of same operations\nperformed via low-level (libapi) and pythonic (pyglfw)\nbindings.\n\nBasics\n------\n\nlibapi:\n\n::\n\n from pyglfw.libapi import *\n\n glfwInit()\n\n glfwGetVersion()\n\n glfwTerminate()\n\n glfwPollEvents()\n\npyglfw:\n\n::\n\n import pyglfw.pyglfw as glfw\n\n glfw.init()\n\n glfw.api_version()\n\n glfw.terminate()\n\n glfw.poll_events()\n\nMonitors\n--------\n\nlibapi:\n\n::\n\n monitorp = glfwGetPrimaryMonitor()\n\n curmode = glfwGetVideoMode(monitorp)\n\n allmodes = glfwGetVideoModes(monitorp)\n\n @GLFWmonitorfun\n def on_monitor_event(monitor, event):\n if event == GLFW_CONNECTED:\n print(glfwGetMonitorName(monitor))\n\n glfwSetMonitorCallback(on_monitor_event)\n\npyglfw:\n\n::\n\n monitor = glfw.get_primary_monitor()\n\n curmore = monitor.video_mode\n\n allmodes = monitor.video_modes\n\n def on_monitor_event(monitor, event):\n if event == glfw.Monitor.CONNECTED:\n print(monitor.name)\n\n glfw.Monitor.set_callback(on_monitor_event)\n\nHints\n-----\n\nlibapi:\n\n::\n\n glfwDefaultWindowHints()\n\n glfwWindowHint(GLFW_CLIENT_API, GLFW_OPENGL_API)\n\n w, h = curmode.width, curmode.height\n windowp = glfwCreateWindow(w, h, b'libapi', None, None)\n\n glfwDestroyWindow(windowp)\n\npyglfw:\n\n::\n\n glfw.Window.hint()\n\n glfw.Window.hint(client_api=glfw.Window.OPENGL_API)\n\n w, h = curmode.width, curmode.height\n window = glfw.Window(w, h, 'pyglfw')\n\n window.close()\n\nSwap\n----\n\nlibapi:\n\n::\n\n context = glfwGetCurrentContext()\n\n glfwMakeContextCurrent(windowp)\n\n glfwSwapInterval(0)\n\n glfwMakeContextCurrent(context)\n\n glfwMakeContextCurrent(windowp)\n\n glfwSwapBuffers(windowp)\n\n\npyglfw:\n\n::\n\n # makes context current\n # and restores previous\n window.swap_interval(0)\n\n window.make_current()\n\n window.swap_buffers()\n\nWindows\n-------\n\nlibapi:\n\n::\n\n if not glfwWindowShouldClose():\n glfwSetWindowTitle(b'libapi')\n\n size = glfwGetWindowSize()\n\n glfwShowWindow()\n\n is_visible = glfwGetWindowAttrib(GLFW_VISIBLE)\n\n client_api = glfwGetWindowAttrib(GLFW_CLIENT_API)\n\n glfwSetWindowAttrib(GLFW_FOCUSED, 1)\n\n @GLFWwindowsizefun\n def on_window_size(windowp, w, h):\n glfwSetWindowSize(windowp, size[0], size[1])\n\n glfwSetWindowSizeCallback(windowp, on_window_size)\n\n\npyglfw:\n\n::\n\n if not window.should_close:\n window.set_title('pyglfw')\n\n size = window.size\n\n window.show()\n\n is_visible = window.visible\n\n client_api = window.client_api\n\n window.has_focus = True\n\n def on_window_size(window, w, h):\n window.size = size\n\n window.set_window_size_callback(on_window_size)\n\nInputs\n------\n\nlibapi:\n\n::\n\n mode = glfwGetInputMode(windowp, GLFW_STICKY_KEYS)\n\n glfwSetInputMode(windowp, GLFW_STICKY_MOUSE_BUTTONS, mode)\n\n is_escape = glfwGetKey(windowp, GLFW_ESCAPE)\n\n is_middle = glfwGetMouseButton(windowp, GLFW_MOUSE_BUTTON_MIDDLE)\n\n cursor_at = glfwGetCursorPos(windowp)\n\n @GLFWkeyfun\n def on_key(windowp, key, scancode, action, mods):\n if key == GLFW_ESCAPE:\n glfwSetWindowShouldClose(1)\n\n glfwSetKeyCallback(windowp, on_key)\n\n if glfwJoystickPresent(0):\n joy_name = glfwGetJoystickName(0)\n joy_axes = glfwGetJoystickAxes(0)\n\npyglfw:\n\n::\n\n mode = window.sticky_keys\n\n window.sticky_mice = mode\n\n is_escape = window.keys.escape\n\n is_middle = window.mice.middle\n\n cursor_at = window.cursor_pos\n\n def on_key(window, key, scancode, action, mods):\n if key == glfw.Keys.ESCAPE:\n window.should_close = True\n\n window.set_key_callback(on_key)\n\n js = glfw.Joystick(0)\n\n if js:\n joy_name = js.name\n joy_axes = js.axes", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://bitbucket.org/pyglfw/pyglfw", "keywords": null, "license": "zlib", "maintainer": null, "maintainer_email": null, "name": "pyglfw", "package_url": "https://pypi.org/project/pyglfw/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pyglfw/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://bitbucket.org/pyglfw/pyglfw" }, "release_url": "https://pypi.org/project/pyglfw/0.2.2/", "requires_dist": null, "requires_python": null, "summary": "Python bindings for the GLFW library", "version": "0.2.2" }, "last_serial": 1079588, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "2053ed3618da3eb9f88825d27d94ea50", "sha256": "521f704b53893edb41ad8476621855fdab420b3662e88925f77890c6f390440b" }, "downloads": -1, "filename": "pyglfw-0.1.0.tar.gz", "has_sig": false, "md5_digest": "2053ed3618da3eb9f88825d27d94ea50", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14599, "upload_time": "2013-12-18T14:43:01", "url": "https://files.pythonhosted.org/packages/0c/72/70843772b9dfeb84456e28b8d61b5f3de8cf4008ebadb987b801f955d937/pyglfw-0.1.0.tar.gz" }, { "comment_text": "", "digests": { "md5": "3e60e812133b250278cd04ee529ffaf5", "sha256": "e0b4ca2195e41c71a4c69f0ea91d9ba8c385c6dc6637b65b8b0747c0cfb9af19" }, "downloads": -1, "filename": "pyglfw-0.1.0.win32.exe", "has_sig": false, "md5_digest": "3e60e812133b250278cd04ee529ffaf5", "packagetype": "bdist_wininst", "python_version": "any", "requires_python": null, "size": 231851, "upload_time": "2013-12-18T14:36:21", "url": "https://files.pythonhosted.org/packages/db/b5/07d140d522c6fb987641cbb414fdb5f8d72300e3b98419c1fabaf60e4629/pyglfw-0.1.0.win32.exe" }, { "comment_text": "", "digests": { "md5": "b893d753de56713435d4ed3153e96969", "sha256": "7fd121b2584b4eedacbf78c68b3767512781d551748b5f691f37c7e69ea5cdf2" }, "downloads": -1, "filename": "pyglfw-0.1.0.win-amd64.exe", "has_sig": false, "md5_digest": "b893d753de56713435d4ed3153e96969", "packagetype": "bdist_wininst", "python_version": "any", "requires_python": null, "size": 259499, "upload_time": "2013-12-18T14:36:47", "url": "https://files.pythonhosted.org/packages/44/1b/e03a4300d835cabf56afe1e1823e8c8d527421694bcb015a7ca501ae6bf7/pyglfw-0.1.0.win-amd64.exe" }, { "comment_text": "", "digests": { "md5": "d99c7cb0d875e75326f2e8ba4c1cb11b", "sha256": "c05591aaf81729945605d98deb02774dac47152e563cbbdb9da24e24e4bd354e" }, "downloads": -1, "filename": "pyglfw-0.1.0.zip", "has_sig": false, "md5_digest": "d99c7cb0d875e75326f2e8ba4c1cb11b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22033, "upload_time": "2013-12-18T14:38:26", "url": "https://files.pythonhosted.org/packages/d2/0f/4b8af733e84403f5492de2e8f149038393c4486e242f71f3d1bd5312ae97/pyglfw-0.1.0.zip" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "2f6af82d8312b863b73ee33dabae8565", "sha256": "92bb0e1e6229e7339d45814ee68621d5e6a9f189bd68845099fc3670caa84cd4" }, "downloads": -1, "filename": "pyglfw-0.2.0.tar.gz", "has_sig": false, "md5_digest": "2f6af82d8312b863b73ee33dabae8565", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14828, "upload_time": "2014-05-01T16:46:19", "url": "https://files.pythonhosted.org/packages/0e/d1/72091d4d85cffdca0ca88ef404036657f2fcddaf482b3e6a4a380fe017e1/pyglfw-0.2.0.tar.gz" }, { "comment_text": "", "digests": { "md5": "a9180ad0f77082e03d446049d8c5876a", "sha256": "921325f187c575ab85980814a425f9db61d16935387a39406e3635257f541028" }, "downloads": -1, "filename": "pyglfw-0.2.0.win32.exe", "has_sig": false, "md5_digest": "a9180ad0f77082e03d446049d8c5876a", "packagetype": "bdist_wininst", "python_version": "any", "requires_python": null, "size": 223267, "upload_time": "2014-05-01T16:51:15", "url": "https://files.pythonhosted.org/packages/a1/ad/f2116d8778b0d4f3afe5a7187e9c5b99e885b8f5751762509a157003c339/pyglfw-0.2.0.win32.exe" }, { "comment_text": "", "digests": { "md5": "7d6c2573467282024a89fda73d18665a", "sha256": "ea36bb0de49eb1d1dc1a72fde6a8a5b7aa60a55078d925a4e9ae7b69020f3343" }, "downloads": -1, "filename": "pyglfw-0.2.0.win-amd64.exe", "has_sig": false, "md5_digest": "7d6c2573467282024a89fda73d18665a", "packagetype": "bdist_wininst", "python_version": "any", "requires_python": null, "size": 250915, "upload_time": "2014-05-01T16:51:30", "url": "https://files.pythonhosted.org/packages/e9/5e/5f8d500bbb5c8d7ab2ec127638f1011f09635c8eb0089c9d36782b9bd424/pyglfw-0.2.0.win-amd64.exe" }, { "comment_text": "", "digests": { "md5": "ac95b299b7644eef099161cadb0bc3eb", "sha256": "0ae90d67a2df8d649e982ad6fb3727da58d3390a9bf60a0de977a364f60aee5a" }, "downloads": -1, "filename": "pyglfw-0.2.0.zip", "has_sig": false, "md5_digest": "ac95b299b7644eef099161cadb0bc3eb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22425, "upload_time": "2014-05-01T16:50:58", "url": "https://files.pythonhosted.org/packages/20/06/50e1917fed825081f008dbd42c6f06ada03e209fa5c07bd6895ac0e54d63/pyglfw-0.2.0.zip" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "1f7aa70116391fee0ecabeb87d8da9f8", "sha256": "5c9a7091d10d851f41180a619a56d4decc5c5791774a1c7066dc6537085c9261" }, "downloads": -1, "filename": "pyglfw-0.2.2.tar.gz", "has_sig": false, "md5_digest": "1f7aa70116391fee0ecabeb87d8da9f8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19093, "upload_time": "2014-05-03T13:52:58", "url": "https://files.pythonhosted.org/packages/73/d2/09224b2f0a66251b078956f2e1004feca36d4eb3b31bb3ec169938d12fd9/pyglfw-0.2.2.tar.gz" }, { "comment_text": "", "digests": { "md5": "987e80b673928d076e353d8a4836645a", "sha256": "74e4e969a14c727b4bfaff17018e2ca12a449d2f74d3b4fd3cd0d566a91db4d7" }, "downloads": -1, "filename": "pyglfw-0.2.2.win32.exe", "has_sig": false, "md5_digest": "987e80b673928d076e353d8a4836645a", "packagetype": "bdist_wininst", "python_version": "any", "requires_python": null, "size": 223277, "upload_time": "2014-05-03T13:56:35", "url": "https://files.pythonhosted.org/packages/57/2b/94be4b32400f9218064ee8705d375d7659a109a31bc458973806d2346c77/pyglfw-0.2.2.win32.exe" }, { "comment_text": "", "digests": { "md5": "297a67877319bb6507301bf0df7ee31b", "sha256": "ea23995442c132c2627d37ab608331f3e27cf70f5614d3a4a9015bfec053a33a" }, "downloads": -1, "filename": "pyglfw-0.2.2.win-amd64.exe", "has_sig": false, "md5_digest": "297a67877319bb6507301bf0df7ee31b", "packagetype": "bdist_wininst", "python_version": "any", "requires_python": null, "size": 250925, "upload_time": "2014-05-03T13:56:48", "url": "https://files.pythonhosted.org/packages/ec/2f/5d5e837351f99d711676efe34322194cb1f8f97709a8c37670c0f6ce772b/pyglfw-0.2.2.win-amd64.exe" }, { "comment_text": "", "digests": { "md5": "9253c18fdf366d5c0267f38c959aa5cf", "sha256": "305d87f06cd080709e188122de88a26f8d33ef20c73d5a829551cec84031a341" }, "downloads": -1, "filename": "pyglfw-0.2.2.zip", "has_sig": false, "md5_digest": "9253c18fdf366d5c0267f38c959aa5cf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 29903, "upload_time": "2014-05-03T13:56:22", "url": "https://files.pythonhosted.org/packages/de/f7/23c619865328b1ac099f08ff185806fc8275fe40236d52bd21665117a404/pyglfw-0.2.2.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1f7aa70116391fee0ecabeb87d8da9f8", "sha256": "5c9a7091d10d851f41180a619a56d4decc5c5791774a1c7066dc6537085c9261" }, "downloads": -1, "filename": "pyglfw-0.2.2.tar.gz", "has_sig": false, "md5_digest": "1f7aa70116391fee0ecabeb87d8da9f8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19093, "upload_time": "2014-05-03T13:52:58", "url": "https://files.pythonhosted.org/packages/73/d2/09224b2f0a66251b078956f2e1004feca36d4eb3b31bb3ec169938d12fd9/pyglfw-0.2.2.tar.gz" }, { "comment_text": "", "digests": { "md5": "987e80b673928d076e353d8a4836645a", "sha256": "74e4e969a14c727b4bfaff17018e2ca12a449d2f74d3b4fd3cd0d566a91db4d7" }, "downloads": -1, "filename": "pyglfw-0.2.2.win32.exe", "has_sig": false, "md5_digest": "987e80b673928d076e353d8a4836645a", "packagetype": "bdist_wininst", "python_version": "any", "requires_python": null, "size": 223277, "upload_time": "2014-05-03T13:56:35", "url": "https://files.pythonhosted.org/packages/57/2b/94be4b32400f9218064ee8705d375d7659a109a31bc458973806d2346c77/pyglfw-0.2.2.win32.exe" }, { "comment_text": "", "digests": { "md5": "297a67877319bb6507301bf0df7ee31b", "sha256": "ea23995442c132c2627d37ab608331f3e27cf70f5614d3a4a9015bfec053a33a" }, "downloads": -1, "filename": "pyglfw-0.2.2.win-amd64.exe", "has_sig": false, "md5_digest": "297a67877319bb6507301bf0df7ee31b", "packagetype": "bdist_wininst", "python_version": "any", "requires_python": null, "size": 250925, "upload_time": "2014-05-03T13:56:48", "url": "https://files.pythonhosted.org/packages/ec/2f/5d5e837351f99d711676efe34322194cb1f8f97709a8c37670c0f6ce772b/pyglfw-0.2.2.win-amd64.exe" }, { "comment_text": "", "digests": { "md5": "9253c18fdf366d5c0267f38c959aa5cf", "sha256": "305d87f06cd080709e188122de88a26f8d33ef20c73d5a829551cec84031a341" }, "downloads": -1, "filename": "pyglfw-0.2.2.zip", "has_sig": false, "md5_digest": "9253c18fdf366d5c0267f38c959aa5cf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 29903, "upload_time": "2014-05-03T13:56:22", "url": "https://files.pythonhosted.org/packages/de/f7/23c619865328b1ac099f08ff185806fc8275fe40236d52bd21665117a404/pyglfw-0.2.2.zip" } ] }