You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+27-3Lines changed: 27 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,17 @@
7
7
8
8
PAL is a lightweight, low-level, cross-platform abstraction layer in **C**, designed to be **explicit** and as close to the **OS** as possible — similar in philosophy to Vulkan. It gives you precise control without hidden behavior, making it ideal for developers who want performance and predictability.
9
9
10
+
PAL is transparent. All queries — window size, position, monitor info, and more — reflect the current platform state. Using PAL is like working directly with the OS: it applies no hidden logic, makes no assumptions, and leaves behavior fully in your control.
11
+
12
+
This approach gives you total control: you handle events, manage resources, and cache state explicitly. PAL provides the building blocks; how you use them — whether for simple applications or advanced frameworks — is entirely up to you.
13
+
14
+
Example – Get Window Size
15
+
```c
16
+
// Direct query from the platform — not cached by PAL
17
+
palGetWindowSize(window, &w, &h);
18
+
```
19
+
> Note: palGetWindowSize queries the OS directly. If your application needs continuous updates (e.g., window moves or resizes frequently), it is more efficient to listen to PAL events rather than repeatedly querying the OS. This ensures your app stays performant.
20
+
10
21
---
11
22
12
23
## Why PAL?
@@ -60,7 +71,11 @@ For more detailed examples, see the [tests folder](./tests) tests folder, which
60
71
---
61
72
62
73
## Philosophy
63
-
74
+
- PAL is a thin layer over the OS, not a framework or library.
75
+
- Queries return the current platform state, reflecting any changes made through direct OS calls.
76
+
- Developers are responsible for state tracking, caching, and event handling.
77
+
- PAL enables cross-platform consistency while preserving full OS behavior and control.
78
+
- Advanced users can build libraries or frameworks on top of PAL.
64
79
- Minimal overhead (close to raw OS calls)
65
80
- Explicit API (no hidden behavior or defaults)
66
81
- Event system supporting both polling and callbacks
@@ -73,9 +88,10 @@ For more detailed examples, see the [tests folder](./tests) tests folder, which
73
88
74
89
## Supported Platforms
75
90
- Windows (Vista+)
91
+
- Linux (X11)
76
92
77
93
## Planned Platforms
78
-
- Linux (X11/Wayland)
94
+
- Linux (Wayland)
79
95
- macOS (Cocoa)
80
96
- Android
81
97
- iOS
@@ -84,6 +100,8 @@ For more detailed examples, see the [tests folder](./tests) tests folder, which
84
100
- Standard C library
85
101
- Platform SDKs (Win32, X11, Cocoa, etc.)
86
102
-[Make for Windows](https://www.gnu.org/software/make/) (if not using Visual Studio)
103
+
- XRandR (1.2+) for X11
104
+
- libXcursor for X11
87
105
88
106
## Compilers
89
107
- GCC
@@ -97,6 +115,7 @@ For more detailed examples, see the [tests folder](./tests) tests folder, which
97
115
PAL is written in **C99** and uses **Premake** as its build system. Configure modules via [pal_config.lua](./pal_config.lua).
98
116
See [pal_config.h](./include/pal/pal_config.h) to see the reflection of modules that will be built.
0 commit comments