|
XenevaOS
|


Go to the source code of this file.
Macros | |
| #define | DEODHAI3D_MAX_WINDOWS 128 |
| #define | DEODHAI3D_MAX_REGIONS 64 |
Functions | |
| void | Deodhai3DInitialise (ChCanvas *canvas) |
| Deodhai3DInitialise – set up the 3D compositor. Call once after the wallpaper is in the back surface and the screen blur is baked. Snapshots the flat wallpaper (used as the fallback panorama and to restore 2D mode). 3D mode starts disabled. | |
| bool | Deodhai3DLoadPanorama (const char *path) |
| Deodhai3DLoadPanorama – load a 360 degree cylindrical panorama (JPEG). Without one, the flat wallpaper is wrapped with mirror repeat. | |
| void | Deodhai3DSetEnabled (bool enable) |
| Deodhai3DSetEnabled – switch between 3D and the classic 2D compositor. Enabling places every window where it is on screen now; disabling restores the flat wallpaper and the 2D layout. | |
| void | Deodhai3DToggle () |
| Deodhai3DToggle – flips 3D mode. | |
| bool | Deodhai3DEnabled () |
| Deodhai3DEnabled – returns true while 3D mode is active. | |
| void | XRComposeFrame3D (ChCanvas *canvas) |
| XRComposeFrame3D – the 3D compose pipeline; drop-in for XRComposeFrame (falls back to it while 3D mode is off or a window is zoomed). | |
| bool | Deodhai3DHandleMouse (ChCanvas *canvas, int x, int y, int button) |
| Deodhai3DHandleMouse – 3D input: drag on empty space turns the camera, drag a titlebar to move a window around you, Ctrl + titlebar drag pushes it away / pulls it closer. Everything else is forwarded to the window under the cursor in the coordinates the client expects. | |
| void | Deodhai3DSetCamera (float yaw, float pitch) |
| Deodhai3DSetCamera – set camera orientation (radians) | |
| void | Deodhai3DGetCamera (float *yaw, float *pitch) |
| Deodhai3DGetCamera – get camera orientation (radians) | |
| bool | Deodhai3DWindowSetPosition (Window *win, float x, float y, float z) |
| Deodhai3DWindowSetPosition – translate a window in 3D space. The window turns to face the camera. | |
| bool | Deodhai3DWindowGetPosition (Window *win, float *x, float *y, float *z) |
| Deodhai3DWindowGetPosition – get the world position of a window. | |
| bool | Deodhai3DWindowPushDepth (Window *win, float factor) |
| Deodhai3DWindowPushDepth – move a window along its view ray (it stays under the same screen spot, only grows / shrinks). Eased over a few frames. | |
| bool | Deodhai3DWindowSendToBack (Window *win) |
| Deodhai3DWindowSendToBack – eases a window behind every other window (painter order is by distance, so it draws first) | |
| bool | Deodhai3DWindowBringToFront (Window *win) |
| Deodhai3DWindowBringToFront – eases a window in front of every other window. | |
| bool | Deodhai3DHandleKey (int key, bool ctrl) |
| Deodhai3DHandleKey – 3D keyboard shortcuts, all with Ctrl held: Ctrl+3 toggle 3D compositing Ctrl+- push the focused window back Ctrl+= pull it closer Ctrl+[ send it behind every window Ctrl+] bring it to the front. | |
| bool | Deodhai3DScreenToWindow (Window *win, int sx, int sy, int *lx, int *ly) |
| Deodhai3DScreenToWindow – maps a screen pixel onto a window's own pixel grid using the last composed frame. | |
| #define DEODHAI3D_MAX_REGIONS 64 |
| #define DEODHAI3D_MAX_WINDOWS 128 |
BSD 2-Clause License
Copyright (c) 2022-2026, Manas Kamal Choudhury All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. DeodhaiXR 3D compositor (software).
World model – the camera sits at the origin and can only rotate:
Layers, back to front:
Zoomed windows are screen-locked by definition: while one is visible the frame is delegated to XRComposeFrame unchanged.
Cost per frame (N windows, R repaint regions):
|
extern |
Deodhai3DEnabled – returns true while 3D mode is active.
|
extern |
Deodhai3DGetCamera – get camera orientation (radians)
Deodhai3DHandleKey – 3D keyboard shortcuts, all with Ctrl held: Ctrl+3 toggle 3D compositing Ctrl+- push the focused window back Ctrl+= pull it closer Ctrl+[ send it behind every window Ctrl+] bring it to the front.
| key | – character from ChitralekhaGetKeyPress |
| ctrl | – Ctrl state |
Deodhai3DHandleKey – 3D keyboard shortcuts, all with Ctrl held: Ctrl+3 toggle 3D compositing Ctrl+- push the focused window back Ctrl+= pull it closer Ctrl+[ send it behind every window Ctrl+] bring it to the front.
Deodhai3DHandleMouse – 3D input: drag on empty space turns the camera, drag a titlebar to move a window around you, Ctrl + titlebar drag pushes it away / pulls it closer. Everything else is forwarded to the window under the cursor in the coordinates the client expects.
| canvas | – Pointer to the system canvas |
| x | – Mouse x location |
| y | – Mouse y location |
| button | – Mouse button state |
Deodhai3DHandleMouse – 3D input: drag on empty space turns the camera, drag a titlebar to move a window around you, Ctrl + titlebar drag pushes it away / pulls it closer. Everything else is forwarded to the window under the cursor in the coordinates the client expects.
|
extern |
Deodhai3DInitialise – set up the 3D compositor. Call once after the wallpaper is in the back surface and the screen blur is baked. Snapshots the flat wallpaper (used as the fallback panorama and to restore 2D mode). 3D mode starts disabled.
| canvas | – Pointer to the system canvas |
Deodhai3DInitialise – set up the 3D compositor. Call once after the wallpaper is in the back surface and the screen blur is baked. Snapshots the flat wallpaper (used as the fallback panorama and to restore 2D mode). 3D mode starts disabled.
|
extern |
Deodhai3DLoadPanorama – load a 360 degree cylindrical panorama (JPEG). Without one, the flat wallpaper is wrapped with mirror repeat.
| path | – path of the jpeg |
Deodhai3DLoadPanorama – load a 360 degree cylindrical panorama (JPEG). Without one, the flat wallpaper is wrapped with mirror repeat.
Deodhai3DScreenToWindow – maps a screen pixel onto a window's own pixel grid using the last composed frame.
Deodhai3DScreenToWindow – maps a screen pixel onto a window's own pixel grid using the last composed frame.
|
extern |
Deodhai3DSetCamera – set camera orientation (radians)
| yaw | – rotation about the vertical axis, + turns right |
| pitch | – + looks up; clamped to +-DEODHAI3D_PITCH_LIMIT |
|
extern |
Deodhai3DSetEnabled – switch between 3D and the classic 2D compositor. Enabling places every window where it is on screen now; disabling restores the flat wallpaper and the 2D layout.
Deodhai3DSetEnabled – switch between 3D and the classic 2D compositor. Enabling places every window where it is on screen now; disabling restores the flat wallpaper and the 2D layout.
|
extern |
Deodhai3DToggle – flips 3D mode.
Deodhai3DWindowBringToFront – eases a window in front of every other window.
Deodhai3DWindowBringToFront – eases a window in front of every other window.
Deodhai3DWindowGetPosition – get the world position of a window.
Deodhai3DWindowPushDepth – move a window along its view ray (it stays under the same screen spot, only grows / shrinks). Eased over a few frames.
| win | – Pointer to window (a popup moves its parent) |
| factor | – distance multiplier: > 1 pushes back, < 1 pulls closer |
Deodhai3DWindowPushDepth – move a window along its view ray (it stays under the same screen spot, only grows / shrinks). Eased over a few frames.
Deodhai3DWindowSendToBack – eases a window behind every other window (painter order is by distance, so it draws first)
Deodhai3DWindowSendToBack – eases a window behind every other window (painter order is by distance, so it draws first)
Deodhai3DWindowSetPosition – translate a window in 3D space. The window turns to face the camera.
| win | – Pointer to window |
| x,y,z | – world position of the window centre (pixel units, +x right, +y down, +z forward) |
Deodhai3DWindowSetPosition – translate a window in 3D space. The window turns to face the camera.
|
extern |
XRComposeFrame3D – the 3D compose pipeline; drop-in for XRComposeFrame (falls back to it while 3D mode is off or a window is zoomed).
| canvas | – Pointer to the system canvas |
XRComposeFrame3D – the 3D compose pipeline; drop-in for XRComposeFrame (falls back to it while 3D mode is off or a window is zoomed).