Coder Social home page Coder Social logo

pyopenxr's People

Contributors

cmbruns avatar el-dee avatar jherico avatar strandborg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pyopenxr's Issues

Rename handle types

...to make room for a class called "Instance", for example. The low level opaque handle type should be "InstanceHandle"

Remove Api.NATIVE_PYTHON

this was an ill considered hack.
A particular Type might have these three api names:
C: "uint32_t"
ctypes: "c_uint32"
python: "int"

Create function generator

This is the last major missing piece before we can begin trying to actually code things using pyopenxr

Create System class

Keep simple uses as simple as possible via exceptions and reasonable defaults

with xr.System() as system:
  pass

Create initial release 1.0.1901

  • Update and install latest OpenXR-SDK from github
    • On Windows, be sure to set the DYNAMIC_LOADER option in CMake, because we need a shared DLL library.
  • Update latest OpenXR-Registry from github
  • Build and install libclang
  • Pull latest pyopenxr sources from github
  • Generate: Run CMake and configure src/generate/CMakeLists.txt with build folder outside of src.
  • Commit to local repository
  • Run tests
  • python -m build --sdist --wheel
  • twine upload --repository pypi dist/*
  • Create tag like 1.0.1901 at current HEAD
  • Push to github INCLUDING TAGS
  • Write release notes and publish release on github

Create Session class

Attributes:

  • has a parent System
  • has a SessionHandle
  • has a GraphicsBinding
  • has a GraphicsBinding type e.g. xr.GraphicsBindingOpenGLWin32KHR
  • has a swapchain image type e.g. xr.SwapchainImageOpenGLKHR
  • has SessionCreateFlags

Methods:

  • create()
  • destroy()
  • enumerate_reference_spaces()
  • [create_reference_space(...)]
  • [get_reference_space_bounds_rect(...)]
  • [create_action_space(...)]
  • enumerate_swapchain_formats()
  • [create_swapchain(...)]
  • begin(...)
  • end()
  • request_exit()
  • wait_frame()
  • begin_frame()
  • end_frame()
  • locate_views()
  • attach_action_sets(...)
  • get_current_interaction_profile(...)
  • get_action_state_boolean(...)
  • get_action_state_float(...)
  • get_action_state_vector2f(...)
  • get_action_state_pose(...)
  • sync_actions()
  • enumerate_bound_sources_for_action()
  • get_input_source_localized_name(...)
  • apply_haptic_feedback(...)
  • stop_haptic_feedback(...)

Hook up logging

OpenXR has some logging functions. We should hook those up to the python logging system.

Expose all the symbols

... and maybe structs at the same time. This is a prerequisite to wrapping the raw C functions.

  • wrap release version
  • wrap enums
  • wrap constants
  • wrap typedefs
  • wrap structures
  • wrap C functions
  • wrap exceptions

Release 1.0.1902

  • On Linux:
    • Update and install latest OpenXR-SDK from github
    • Update latest OpenXR-Registry from github
    • Build and install libclang
    • Pull latest pyopenxr sources from github
    • Generate: Run CMake and configure src/generate/CMakeLists.txt with build folder outside of src.
    • Run tests
    • Commit to local repository
    • Push to github
  • On Windows:
    • Update and install latest OpenXR-SDK from github
      • On Windows, be sure to set the DYNAMIC_LOADER option in CMake, because we need a shared DLL library.
    • Update latest OpenXR-Registry from github
    • Build and install libclang
    • Pull latest pyopenxr sources from github
    • Generate: Run CMake and configure src/generate/CMakeLists.txt with build folder outside of src.
    • Run tests
    • Commit to local repository
    • python -m build --sdist --wheel
    • twine upload --repository pypi dist/*
    • Create tag like 1.0.1901 at current HEAD
    • Push to github INCLUDING TAGS
    • Write release notes and publish release on github

Allow running headless, without xrGetOpenGLGraphicsRequirementsKHR

Hi,

I am trying to get a headless session (without the compositor) with the XR_MND_headless extension.
I modified the example script a bit:

import time
import xr

available = xr.enumerate_instance_extension_properties()
required = [xr.MND_HEADLESS_EXTENSION_NAME]
for prop in required:
    assert prop in available

with xr.Instance(application_name="track_headless", requested_extensions = required) as instance:
    with xr.System(instance) as system:
        with xr.Session(system) as session:
            for _ in range(50):
                print ("entered loop")
                session.poll_xr_events()

But it fails at system creation:

Info: All enumerated devices attached.
Info: Loaded drivers: HTCVive
Info: Adding tracked object T20 from HTC
Info: Device T20 has watchman FW version 1562916277 and FPGA version 538/10/2; named '                       watchman'. Hardware id 0x110e0009
Info: Detected LH gen 2 system.
LOG in xrCreateInstance: Info: Adding lighthouse ch 1 (idx: 0, cnt: 1)
Instance created
	createInfo->applicationInfo.applicationName: track_headless
	createInfo->applicationInfo.applicationVersion: 0
	createInfo->applicationInfo.engineName: pyopenvr
	createInfo->applicationInfo.engineVersion: 1902
	appinfo.detected.engine.name: (null)
	appinfo.detected.engine.version: 0.0.0
	quirks.disable_vulkan_format_depth_stencil: false
Info: OOTX not set for LH in channel 1; attaching ootx decoder using device T20
Info: LightcapMode (T20) 1 -> 2
Info: MPFIT stats for T20:
Info: 	seed runs         0 / 0
Info: 	error failures    0
Traceback (most recent call last):
  File "/home/adi/xrwork/pyopenxr/examples/track_nohmd.py", line 10, in <module>
    with xr.System(instance) as system:
  File "/home/adi/.local/lib/python3.9/site-packages/xr/classes.py", line 115, in __init__
    get_instance_proc_addr(
  File "/home/adi/.local/lib/python3.9/site-packages/xr/functions.py", line 33, in get_instance_proc_addr
    raise result
xr.exception.FunctionUnsupportedError: The requested function was not found or is otherwise unsupported.

And this is the part of the System class being the culprit:

        self.pxrGetOpenGLGraphicsRequirementsKHR = ctypes.cast(
            get_instance_proc_addr(
                self.instance.handle,
                "xrGetOpenGLGraphicsRequirementsKHR",
            ),
            PFN_xrGetOpenGLGraphicsRequirementsKHR
        )

Insert docstrings

The standard header has no docstring comments. But it should be possible to pull documentation from the OpenXR-Registry project

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.