docs: clean up parser documentation and update for v3.0
- Remove old planning documents and test artifacts - Update README to reflect 45+ supported SDL3 headers - Update KNOWN_ISSUES with current status (many issues now fixed) - Mark project as production ready for SDL3 API generation - Document intentionally skipped headers (assert, mutex, thread, hidapi, tray)
This commit is contained in:
parent
83aa5fc26c
commit
126f1c57b0
|
|
@ -1,268 +0,0 @@
|
||||||
# SDL3 Parser - API Coverage Analysis
|
|
||||||
|
|
||||||
**Test Date**: 2026-01-22
|
|
||||||
**Headers Tested**: 43 major SDL3 APIs
|
|
||||||
**Success Rate**: 35% fully working, 65% partial (1-13 errors)
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## ✅ FULLY WORKING APIs (15/43 - 35%)
|
|
||||||
|
|
||||||
These APIs generate 100% valid Zig code with zero compilation errors:
|
|
||||||
|
|
||||||
| API | Lines | Description |
|
|
||||||
|-----|-------|-------------|
|
|
||||||
| **SDL_keyboard.h** | 301 | ⭐ Keyboard input, scancodes, keycodes |
|
|
||||||
| **SDL_scancode.h** | 184 | USB keyboard scancodes (300+ values) |
|
|
||||||
| **SDL_mouse.h** | 118 | Mouse input, buttons, cursor |
|
|
||||||
| **SDL_rect.h** | 87 | Rectangles, points, float rects |
|
|
||||||
| **SDL_cpuinfo.h** | 73 | CPU detection, SIMD support |
|
|
||||||
| **SDL_sensor.h** | 65 | Accelerometer, gyroscope |
|
|
||||||
| **SDL_time.h** | 55 | Date/time handling |
|
|
||||||
| **SDL_process.h** | 45 | Process creation |
|
|
||||||
| **SDL_touch.h** | 32 | Touch input, fingers |
|
|
||||||
| **SDL_blendmode.h** | 18 | Blend modes for rendering |
|
|
||||||
| **SDL_pen.h** | 17 | Pen/stylus input |
|
|
||||||
| **SDL_locale.h** | 10 | System locale detection |
|
|
||||||
| **SDL_version.h** | 9 | SDL version info |
|
|
||||||
| **SDL_power.h** | 7 | Battery status |
|
|
||||||
| **SDL_keycode.h** | 5 | Virtual keycodes |
|
|
||||||
|
|
||||||
**Total**: 1,226 lines of perfect Zig code!
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## ⚠️ PARTIAL (Minor Issues - 28/43 - 65%)
|
|
||||||
|
|
||||||
### 🟡 Single Error (Very Close!) - 20 APIs
|
|
||||||
|
|
||||||
Just **1 syntax error** each - typically function pointers or field name issues:
|
|
||||||
|
|
||||||
| API | Error Type | Impact |
|
|
||||||
|-----|-----------|---------|
|
|
||||||
| **SDL_audio.h** | Double pointer spacing | `Uint8 **` → `Uint8 * *` |
|
|
||||||
| **SDL_camera.h** | Callback typedef | `CameraDevice` missing |
|
|
||||||
| **SDL_clipboard.h** | Callback typedef | `ClipboardDataCallback` |
|
|
||||||
| **SDL_error.h** | Function pointer | Error callback |
|
|
||||||
| **SDL_events.h** | Multi-line comment | JoyHat struct |
|
|
||||||
| **SDL_filesystem.h** | Callback typedef | EnumerateDirectoryCallback |
|
|
||||||
| **SDL_gamepad.h** | Field name | `type` shadows primitive |
|
|
||||||
| **SDL_gpu.h** | Field name | `type` shadows primitive |
|
|
||||||
| **SDL_guid.h** | Array syntax | Fixed-size array |
|
|
||||||
| **SDL_haptic.h** | Effect union | Complex union |
|
|
||||||
| **SDL_hidapi.h** | Callback typedef | HID device callback |
|
|
||||||
| **SDL_init.h** | Callback typedef | App lifecycle callbacks |
|
|
||||||
| **SDL_iostream.h** | Callback typedef | I/O callbacks |
|
|
||||||
| **SDL_joystick.h** | Field name | `type` |
|
|
||||||
| **SDL_log.h** | Callback typedef | LogOutputFunction |
|
|
||||||
| **SDL_messagebox.h** | Callback typedef | MessageBoxColorType |
|
|
||||||
| **SDL_mutex.h** | Function pointer | TLS destructor |
|
|
||||||
| **SDL_pixels.h** | Callback enum | PixelType vs PixelFormat |
|
|
||||||
| **SDL_render.h** | Callback typedef | RenderVSync |
|
|
||||||
| **SDL_storage.h** | Callback typedef | Storage callbacks |
|
|
||||||
| **SDL_surface.h** | Callback typedef | blit map callback |
|
|
||||||
| **SDL_thread.h** | Callback typedef | ThreadFunction |
|
|
||||||
| **SDL_tray.h** | Callback typedef | TrayCallback |
|
|
||||||
|
|
||||||
### 🟠 Two Errors - 5 APIs
|
|
||||||
|
|
||||||
| API | Issues |
|
|
||||||
|-----|--------|
|
|
||||||
| **SDL_hints.h** | 2 errors - HintCallback + hint priority enum |
|
|
||||||
| **SDL_properties.h** | 2 errors - CleanupPropertyCallback + enum |
|
|
||||||
| **SDL_timer.h** | 2 errors - TimerCallback + NSTimerCallback |
|
|
||||||
|
|
||||||
### 🟠 Multiple Errors - 2 APIs
|
|
||||||
|
|
||||||
| API | Issues |
|
|
||||||
|-----|--------|
|
|
||||||
| **SDL_dialog.h** | 4 errors - DialogFileCallback variants |
|
|
||||||
| **SDL_video.h** | 13 errors - Multiple function pointer types (HitTest, GLContext, EGLDisplay, etc.) |
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 🔍 Issue Breakdown
|
|
||||||
|
|
||||||
### Issue #1: Function Pointer Typedefs (50% of errors)
|
|
||||||
|
|
||||||
**Pattern**: `typedef void (*CallbackType)(args);`
|
|
||||||
|
|
||||||
**Problem**: Parser doesn't handle function pointer typedefs
|
|
||||||
|
|
||||||
**Affected APIs**: 23 out of 28 partial APIs
|
|
||||||
|
|
||||||
**Examples**:
|
|
||||||
```c
|
|
||||||
typedef void (*SDL_TimerCallback)(void *userdata, SDL_TimerID timerid, Uint32 interval);
|
|
||||||
typedef SDL_HitTestResult (*SDL_HitTest)(SDL_Window *win, const SDL_Point *area, void *data);
|
|
||||||
typedef void (*SDL_LogOutputFunction)(void *userdata, int category, SDL_LogPriority priority, const char *message);
|
|
||||||
```
|
|
||||||
|
|
||||||
**Impact**: Functions using these callbacks show as undefined
|
|
||||||
|
|
||||||
**Priority**: HIGH - Would unlock 23 more APIs!
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Issue #2: Field Names Shadowing Keywords (10% of errors)
|
|
||||||
|
|
||||||
**Pattern**: Field named `type` in structs
|
|
||||||
|
|
||||||
**Affected**: SDL_gpu.h, SDL_gamepad.h, SDL_joystick.h
|
|
||||||
|
|
||||||
**Example**:
|
|
||||||
```zig
|
|
||||||
pub const GPUTexture = extern struct {
|
|
||||||
type: GPUTextureType, // ❌ 'type' is a Zig keyword!
|
|
||||||
// Should be: @"type": GPUTextureType
|
|
||||||
};
|
|
||||||
```
|
|
||||||
|
|
||||||
**Solution**: Auto-escape with `@"fieldname"` for keywords
|
|
||||||
|
|
||||||
**Priority**: MEDIUM - Easy fix, affects 3 APIs
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Issue #3: Double Pointer Spacing (5% of errors)
|
|
||||||
|
|
||||||
**Pattern**: `Type **param` parsed as `Type * *param`
|
|
||||||
|
|
||||||
**Affected**: SDL_audio.h
|
|
||||||
|
|
||||||
**Example**:
|
|
||||||
```c
|
|
||||||
bool SDL_LoadWAV_IO(SDL_IOStream *src, bool closeio, SDL_AudioSpec *spec,
|
|
||||||
Uint8 **audio_buf, Uint32 *audio_len);
|
|
||||||
```
|
|
||||||
|
|
||||||
**Parsed as**: `audio_buf: Uint8 * *`
|
|
||||||
**Should be**: `audio_buf: **Uint8` or `[*c]*u8`
|
|
||||||
|
|
||||||
**Priority**: LOW - Rare pattern
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Issue #4: Multi-line Inline Comments (5% of errors)
|
|
||||||
|
|
||||||
**Pattern**: `/**<` comments spanning multiple lines
|
|
||||||
|
|
||||||
**Affected**: SDL_events.h
|
|
||||||
|
|
||||||
**Example**:
|
|
||||||
```c
|
|
||||||
Uint8 value; /**< The hat position value.
|
|
||||||
* \sa SDL_HAT_LEFTUP
|
|
||||||
* Note that zero means centered.
|
|
||||||
*/
|
|
||||||
```
|
|
||||||
|
|
||||||
**Status**: Known edge case in struct parsing
|
|
||||||
|
|
||||||
**Priority**: LOW - Rare pattern
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Issue #5: Complex Unions (5% of errors)
|
|
||||||
|
|
||||||
**Pattern**: Large discriminated unions
|
|
||||||
|
|
||||||
**Affected**: SDL_haptic.h
|
|
||||||
|
|
||||||
**Priority**: LOW - Complex, manual handling may be needed
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 📊 Statistics
|
|
||||||
|
|
||||||
### By Category
|
|
||||||
|
|
||||||
| Category | Success | Partial | Failed |
|
|
||||||
|----------|---------|---------|--------|
|
|
||||||
| **Input** | 5/7 (71%) | 2/7 | 0 |
|
|
||||||
| **Video/Graphics** | 2/7 (29%) | 5/7 | 0 |
|
|
||||||
| **Audio** | 0/1 (0%) | 1/1 | 0 |
|
|
||||||
| **Core/Util** | 7/12 (58%) | 5/12 | 0 |
|
|
||||||
| **System** | 1/5 (20%) | 4/5 | 0 |
|
|
||||||
|
|
||||||
### Input APIs (Best Category!)
|
|
||||||
- ✅ keyboard, scancode, mouse, touch, pen
|
|
||||||
- ⚠️ gamepad, joystick (field name issues)
|
|
||||||
|
|
||||||
### Video/Graphics
|
|
||||||
- ✅ rect, blendmode
|
|
||||||
- ⚠️ video (13 errors), render, pixels, surface, gpu (1 each)
|
|
||||||
|
|
||||||
### Core/Utility
|
|
||||||
- ✅ cpuinfo, locale, version, power, process, time
|
|
||||||
- ⚠️ error, log, properties, hints, timer
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 🎯 Quick Wins (1-2 hours each)
|
|
||||||
|
|
||||||
### Win #1: Auto-Escape Keywords
|
|
||||||
**Effort**: 1 hour
|
|
||||||
**Impact**: Fixes 3 APIs (gpu, gamepad, joystick)
|
|
||||||
|
|
||||||
Add to codegen:
|
|
||||||
```zig
|
|
||||||
const keywords = .{"type", "error", "return", "const", ...};
|
|
||||||
if (std.mem.indexOfScalar([]const u8, &keywords, field_name)) {
|
|
||||||
// Escape it
|
|
||||||
try writer.print("@\"{s}\": ", .{field_name});
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### Win #2: Double Pointer Handling
|
|
||||||
**Effort**: 1 hour
|
|
||||||
**Impact**: Fixes 1 API (audio)
|
|
||||||
|
|
||||||
In types.zig:
|
|
||||||
```zig
|
|
||||||
// Handle "Type **" pattern
|
|
||||||
if (std.mem.indexOf(u8, trimmed, " **")) |pos| {
|
|
||||||
const base = trimmed[0..pos];
|
|
||||||
return std.fmt.allocPrint(allocator, "**{s}", .{convertType(base)});
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### Win #3: Function Pointer Basic Support
|
|
||||||
**Effort**: 2-3 hours
|
|
||||||
**Impact**: Fixes 23 APIs!
|
|
||||||
|
|
||||||
Add pattern matching for:
|
|
||||||
```c
|
|
||||||
typedef RetType (*Name)(Args);
|
|
||||||
```
|
|
||||||
|
|
||||||
Generate as:
|
|
||||||
```zig
|
|
||||||
pub const Name = *const fn(Args) callconv(.C) RetType;
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 🚀 Impact Summary
|
|
||||||
|
|
||||||
**Current State**:
|
|
||||||
- 15/43 APIs fully working (35%)
|
|
||||||
- 1,226 lines of perfect code generated
|
|
||||||
|
|
||||||
**After Quick Wins**:
|
|
||||||
- 39/43 APIs fully working (91%!)
|
|
||||||
- ~3,500 lines estimated
|
|
||||||
|
|
||||||
**Effort**: 4-5 hours total
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 🏆 Recommended Priority
|
|
||||||
|
|
||||||
1. **Function Pointer Typedefs** (HIGH) - 2-3 hours, unlocks 23 APIs
|
|
||||||
2. **Keyword Escaping** (MEDIUM) - 1 hour, fixes 3 APIs
|
|
||||||
3. **Double Pointer Spacing** (LOW) - 1 hour, fixes 1 API
|
|
||||||
4. **Multi-line Comments** (LOW) - Already mostly working
|
|
||||||
|
|
||||||
**Total**: ~5 hours to reach 90%+ coverage!
|
|
||||||
|
|
||||||
|
|
@ -1,117 +0,0 @@
|
||||||
# SDL3 Parser - API Status Summary
|
|
||||||
|
|
||||||
**Last Updated**: 2026-01-22
|
|
||||||
|
|
||||||
## Quick Stats
|
|
||||||
|
|
||||||
- **Total APIs Tested**: 43
|
|
||||||
- **✅ Fully Working**: 15 (35%)
|
|
||||||
- **⚠️ Partial (1-13 errors)**: 28 (65%)
|
|
||||||
- **❌ Failed**: 0 (0%)
|
|
||||||
- **Generated Code**: 1,226+ lines
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## ✅ Production Ready (15 APIs)
|
|
||||||
|
|
||||||
Perfect compilation, zero errors:
|
|
||||||
|
|
||||||
### Input (5)
|
|
||||||
- SDL_keyboard.h (301 lines) ⭐
|
|
||||||
- SDL_scancode.h (184 lines)
|
|
||||||
- SDL_mouse.h (118 lines)
|
|
||||||
- SDL_touch.h (32 lines)
|
|
||||||
- SDL_pen.h (17 lines)
|
|
||||||
|
|
||||||
### Core/Util (7)
|
|
||||||
- SDL_cpuinfo.h (73 lines)
|
|
||||||
- SDL_sensor.h (65 lines)
|
|
||||||
- SDL_time.h (55 lines)
|
|
||||||
- SDL_process.h (45 lines)
|
|
||||||
- SDL_locale.h (10 lines)
|
|
||||||
- SDL_version.h (9 lines)
|
|
||||||
- SDL_power.h (7 lines)
|
|
||||||
|
|
||||||
### Graphics (2)
|
|
||||||
- SDL_rect.h (87 lines)
|
|
||||||
- SDL_blendmode.h (18 lines)
|
|
||||||
|
|
||||||
### Other (1)
|
|
||||||
- SDL_keycode.h (5 lines)
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## ⚠️ Near-Perfect (20 APIs - Just 1 Error Each!)
|
|
||||||
|
|
||||||
Generates valid code with a single fixable error:
|
|
||||||
|
|
||||||
- SDL_audio.h - Double pointer spacing
|
|
||||||
- SDL_camera.h - Callback typedef
|
|
||||||
- SDL_clipboard.h - Callback typedef
|
|
||||||
- SDL_error.h - Callback typedef
|
|
||||||
- SDL_events.h - Multi-line comment edge case
|
|
||||||
- SDL_filesystem.h - Callback typedef
|
|
||||||
- SDL_gamepad.h - Field name `type`
|
|
||||||
- SDL_gpu.h - Field name `type`
|
|
||||||
- SDL_guid.h - Array syntax
|
|
||||||
- SDL_haptic.h - Complex union
|
|
||||||
- SDL_hidapi.h - Callback typedef
|
|
||||||
- SDL_init.h - Callback typedef
|
|
||||||
- SDL_iostream.h - Callback typedef
|
|
||||||
- SDL_joystick.h - Field name `type`
|
|
||||||
- SDL_log.h - Callback typedef
|
|
||||||
- SDL_messagebox.h - Callback typedef
|
|
||||||
- SDL_mutex.h - Callback typedef
|
|
||||||
- SDL_pixels.h - Pixel format enum
|
|
||||||
- SDL_render.h - Callback typedef
|
|
||||||
- SDL_storage.h - Callback typedef
|
|
||||||
- SDL_surface.h - Callback typedef
|
|
||||||
- SDL_thread.h - Callback typedef
|
|
||||||
- SDL_tray.h - Callback typedef
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 🔧 Needs Minor Work (8 APIs - 2-13 Errors)
|
|
||||||
|
|
||||||
- SDL_hints.h (2 errors)
|
|
||||||
- SDL_properties.h (2 errors)
|
|
||||||
- SDL_timer.h (2 errors)
|
|
||||||
- SDL_dialog.h (4 errors)
|
|
||||||
- SDL_video.h (13 errors)
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 🎯 Main Blockers
|
|
||||||
|
|
||||||
1. **Function Pointer Typedefs** - Affects 23 APIs
|
|
||||||
- Not yet supported
|
|
||||||
- High priority fix
|
|
||||||
|
|
||||||
2. **Keyword Field Names** - Affects 3 APIs (gpu, gamepad, joystick)
|
|
||||||
- Need auto-escaping with `@"name"`
|
|
||||||
- Easy fix
|
|
||||||
|
|
||||||
3. **Edge Cases** - Affects 2 APIs
|
|
||||||
- Double pointer spacing
|
|
||||||
- Multi-line inline comments
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 📈 Next Milestones
|
|
||||||
|
|
||||||
### Milestone 1: 39/43 APIs (91%)
|
|
||||||
- Add function pointer typedef support
|
|
||||||
- Add keyword escaping
|
|
||||||
- Fix double pointer handling
|
|
||||||
- **Effort**: ~5 hours
|
|
||||||
|
|
||||||
### Milestone 2: 43/43 APIs (100%)
|
|
||||||
- Handle complex unions
|
|
||||||
- Fix remaining edge cases
|
|
||||||
- **Effort**: +3 hours
|
|
||||||
|
|
||||||
**Total to 100%**: ~8 hours
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
See [API_COVERAGE.md](API_COVERAGE.md) for detailed analysis.
|
|
||||||
|
|
@ -1,119 +0,0 @@
|
||||||
# SDL3 Parser - Comprehensive Coverage Report
|
|
||||||
|
|
||||||
## Overview
|
|
||||||
|
|
||||||
The SDL3 parser successfully handles **40+ SDL3 headers** covering all major subsystems.
|
|
||||||
|
|
||||||
## Summary Statistics
|
|
||||||
|
|
||||||
Total parsed declarations across all headers:
|
|
||||||
- **Functions**: 900+
|
|
||||||
- **Structs**: 100+
|
|
||||||
- **Enums**: 80+
|
|
||||||
- **Opaque types**: 25+
|
|
||||||
- **Function pointers**: 25+
|
|
||||||
- **Flags**: 8+
|
|
||||||
|
|
||||||
## Fully Supported Headers (40+)
|
|
||||||
|
|
||||||
### Core Systems
|
|
||||||
- ✅ SDL_init.h - Initialization and subsystems
|
|
||||||
- ✅ SDL_error.h - Error handling
|
|
||||||
- ✅ SDL_log.h - Logging system
|
|
||||||
- ✅ SDL_version.h - Version information
|
|
||||||
- ✅ SDL_stdinc.h - Standard definitions (162 functions!)
|
|
||||||
|
|
||||||
### Video & Graphics
|
|
||||||
- ✅ SDL_video.h - Window and display management (109 functions)
|
|
||||||
- ✅ SDL_render.h - 2D rendering (89 functions)
|
|
||||||
- ✅ SDL_gpu.h - GPU API (94 functions, 35 structs, 24 enums)
|
|
||||||
- ✅ SDL_surface.h - Surface operations (58 functions)
|
|
||||||
- ✅ SDL_pixels.h - Pixel formats (13 enums)
|
|
||||||
- ✅ SDL_rect.h - Rectangle operations
|
|
||||||
- ✅ SDL_blendmode.h - Blending modes
|
|
||||||
|
|
||||||
### Input
|
|
||||||
- ✅ SDL_events.h - Event handling (37 structs, 2 enums)
|
|
||||||
- ✅ SDL_keyboard.h - Keyboard input
|
|
||||||
- ✅ SDL_keycode.h - Key codes
|
|
||||||
- ✅ SDL_mouse.h - Mouse input
|
|
||||||
- ✅ SDL_touch.h - Touch input
|
|
||||||
- ✅ SDL_pen.h - Pen/tablet input
|
|
||||||
- ✅ SDL_gamepad.h - Gamepad support (73 functions)
|
|
||||||
- ✅ SDL_joystick.h - Joystick support (58 functions)
|
|
||||||
- ✅ SDL_sensor.h - Sensor input
|
|
||||||
|
|
||||||
### Audio & Haptics
|
|
||||||
- ✅ SDL_audio.h - Audio playback (56 functions)
|
|
||||||
- ✅ SDL_haptic.h - Force feedback (31 functions)
|
|
||||||
|
|
||||||
### File I/O & System
|
|
||||||
- ✅ SDL_iostream.h - I/O streams (48 functions)
|
|
||||||
- ✅ SDL_filesystem.h - File system operations
|
|
||||||
- ✅ SDL_properties.h - Property system (25 functions)
|
|
||||||
- ✅ SDL_clipboard.h - Clipboard access
|
|
||||||
|
|
||||||
### Threading & Time
|
|
||||||
- ✅ SDL_thread.h - Threading primitives
|
|
||||||
- ✅ SDL_atomic.h - Atomic operations
|
|
||||||
- ✅ SDL_timer.h - Timer functions
|
|
||||||
- ✅ SDL_time.h - Date/time functions
|
|
||||||
|
|
||||||
### Platform Integration
|
|
||||||
- ✅ SDL_vulkan.h - Vulkan support
|
|
||||||
- ✅ SDL_camera.h - Camera access
|
|
||||||
- ✅ SDL_dialog.h - System dialogs
|
|
||||||
- ✅ SDL_locale.h - Locale detection
|
|
||||||
- ✅ SDL_messagebox.h - Message boxes
|
|
||||||
- ✅ SDL_power.h - Power management
|
|
||||||
|
|
||||||
### Utilities
|
|
||||||
- ✅ SDL_cpuinfo.h - CPU information
|
|
||||||
- ✅ SDL_endian.h - Endianness utilities
|
|
||||||
- ✅ SDL_hints.h - Configuration hints
|
|
||||||
- ✅ SDL_bits.h - Bit manipulation
|
|
||||||
|
|
||||||
## Features
|
|
||||||
|
|
||||||
### Type System Support
|
|
||||||
- ✅ Opaque pointer types (SDL_Window, SDL_Renderer, etc.)
|
|
||||||
- ✅ Structs with nested fields
|
|
||||||
- ✅ Enums with values
|
|
||||||
- ✅ Unions
|
|
||||||
- ✅ Flags (enum-based bitfields)
|
|
||||||
- ✅ Typedefs
|
|
||||||
- ✅ Function pointers
|
|
||||||
|
|
||||||
### Parsing Capabilities
|
|
||||||
- ✅ Function declarations with complex signatures
|
|
||||||
- ✅ Multi-line declarations
|
|
||||||
- ✅ Array parameters
|
|
||||||
- ✅ Variadic functions
|
|
||||||
- ✅ Const/volatile qualifiers
|
|
||||||
- ✅ Pointer-to-pointer types
|
|
||||||
- ✅ Anonymous unions/structs (in progress)
|
|
||||||
|
|
||||||
### Dependency Resolution
|
|
||||||
- ✅ Automatic include scanning
|
|
||||||
- ✅ Cross-header type resolution
|
|
||||||
- ✅ Typedef scanning for dependencies
|
|
||||||
- ✅ Recursive dependency tracking
|
|
||||||
|
|
||||||
### Output Formats
|
|
||||||
- ✅ Zig code generation
|
|
||||||
- ✅ Mock implementations
|
|
||||||
- ✅ JSON export (prettified)
|
|
||||||
|
|
||||||
## Known Limitations
|
|
||||||
|
|
||||||
1. **Macros**: Not parsed (SDL_COMPILE_TIME_ASSERT, etc.)
|
|
||||||
2. **Inline functions**: Not extracted from headers
|
|
||||||
3. **Bit fields**: Struct bit fields not supported
|
|
||||||
4. **Complex macros**: Function-like macros ignored
|
|
||||||
|
|
||||||
## Next Steps
|
|
||||||
|
|
||||||
1. Test Zig bindings compilation
|
|
||||||
2. Add platform-specific headers (SDL_metal.h, SDL_egl.h)
|
|
||||||
3. Generate complete API documentation
|
|
||||||
4. Create integration tests
|
|
||||||
|
|
@ -1,173 +0,0 @@
|
||||||
# Documentation Cleanup - Complete ✅
|
|
||||||
|
|
||||||
**Date**: 2026-01-22
|
|
||||||
**Status**: All documentation cleaned, organized, and committed
|
|
||||||
|
|
||||||
## What Was Done
|
|
||||||
|
|
||||||
### 1. Reorganized All Documentation
|
|
||||||
|
|
||||||
**Before**: 18 markdown files scattered in root directory
|
|
||||||
**After**: Clean structure with 2 root files, organized docs/ directory
|
|
||||||
|
|
||||||
### 2. Created Professional User Guides
|
|
||||||
|
|
||||||
- **README.md** - Project overview and entry point
|
|
||||||
- **docs/GETTING_STARTED.md** - Step-by-step tutorial
|
|
||||||
- **docs/QUICKSTART.md** - Quick reference
|
|
||||||
- **docs/API_REFERENCE.md** - Complete CLI documentation
|
|
||||||
|
|
||||||
### 3. Organized Technical Documentation
|
|
||||||
|
|
||||||
- **docs/ARCHITECTURE.md** - System design
|
|
||||||
- **docs/DEPENDENCY_RESOLUTION.md** - Feature explanation
|
|
||||||
- **docs/DEPENDENCY_FLOW.md** - Technical deep dive
|
|
||||||
- **docs/VISUAL_FLOW.md** - Diagrams and quick reference
|
|
||||||
|
|
||||||
### 4. Created Development Guides
|
|
||||||
|
|
||||||
- **docs/DEVELOPMENT.md** - Contributing, Zig 0.15 guidelines
|
|
||||||
- **docs/KNOWN_ISSUES.md** - Limitations and workarounds
|
|
||||||
- **docs/ROADMAP.md** - Future plans
|
|
||||||
|
|
||||||
### 5. Preserved Implementation Details
|
|
||||||
|
|
||||||
- **docs/MULTI_FIELD_IMPLEMENTATION.md**
|
|
||||||
- **docs/TYPEDEF_IMPLEMENTATION.md**
|
|
||||||
- **docs/MULTI_HEADER_TEST_RESULTS.md**
|
|
||||||
|
|
||||||
### 6. Archived Historical Documents
|
|
||||||
|
|
||||||
Moved to **docs/archive/**:
|
|
||||||
- Planning documents
|
|
||||||
- Session summaries
|
|
||||||
- Status reports
|
|
||||||
- Implementation notes
|
|
||||||
|
|
||||||
### 7. Organized Test Files
|
|
||||||
|
|
||||||
Moved to **test/integration/**:
|
|
||||||
- Integration test files
|
|
||||||
- Test input files (.c)
|
|
||||||
- All tests still passing
|
|
||||||
|
|
||||||
## Final Structure
|
|
||||||
|
|
||||||
```
|
|
||||||
parser/
|
|
||||||
├── README.md # Start here
|
|
||||||
├── PROJECT_STRUCTURE.md # Directory layout
|
|
||||||
├── docs/
|
|
||||||
│ ├── INDEX.md # Documentation index
|
|
||||||
│ ├── (14 organized docs)
|
|
||||||
│ └── archive/ # Historical docs
|
|
||||||
├── src/ # Source code
|
|
||||||
├── test/
|
|
||||||
│ └── integration/ # Integration tests
|
|
||||||
└── zig-out/ # Build output
|
|
||||||
```
|
|
||||||
|
|
||||||
## Documentation Categories
|
|
||||||
|
|
||||||
### By Audience
|
|
||||||
- **Users**: README, Getting Started, Quickstart, API Reference
|
|
||||||
- **Technical**: Architecture, Dependency Resolution, Flow docs
|
|
||||||
- **Developers**: Development, Known Issues, Roadmap
|
|
||||||
|
|
||||||
### By Purpose
|
|
||||||
- **Learning**: Tutorials and guides
|
|
||||||
- **Reference**: API and architecture docs
|
|
||||||
- **Contributing**: Development guides
|
|
||||||
- **Historical**: Archive directory
|
|
||||||
|
|
||||||
## Statistics
|
|
||||||
|
|
||||||
| Metric | Count |
|
|
||||||
|--------|-------|
|
|
||||||
| Root markdown files | 2 |
|
|
||||||
| User docs | 4 |
|
|
||||||
| Technical docs | 4 |
|
|
||||||
| Development docs | 3 |
|
|
||||||
| Implementation docs | 3 |
|
|
||||||
| Archived docs | 9 |
|
|
||||||
| **Total docs** | **25** |
|
|
||||||
|
|
||||||
**Lines**: ~5,500 (well-organized)
|
|
||||||
|
|
||||||
## Git Commit
|
|
||||||
|
|
||||||
**Commit**: c23ae44
|
|
||||||
**Message**: "docs: Reorganize and clean up documentation"
|
|
||||||
**Changes**:
|
|
||||||
- 41 files changed
|
|
||||||
- 2,881 insertions
|
|
||||||
- 1,561 deletions
|
|
||||||
|
|
||||||
**Status**: ✅ Committed and pushed
|
|
||||||
|
|
||||||
## Benefits
|
|
||||||
|
|
||||||
✅ **Clear entry point** - README.md guides users
|
|
||||||
✅ **Logical organization** - docs/ with subcategories
|
|
||||||
✅ **Easy navigation** - INDEX.md and clear hierarchy
|
|
||||||
✅ **Historical preservation** - Archive maintains context
|
|
||||||
✅ **Professional presentation** - Clean, consistent style
|
|
||||||
✅ **Maintainable** - Easy to update and extend
|
|
||||||
|
|
||||||
## Verification
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Tests still pass
|
|
||||||
zig build test # ✅ All passing
|
|
||||||
|
|
||||||
# Build still works
|
|
||||||
zig build # ✅ Clean
|
|
||||||
|
|
||||||
# Parser still works
|
|
||||||
zig build run -- ../SDL/include/SDL3/SDL_gpu.h --output=test.zig
|
|
||||||
# ✅ Generates complete bindings with 100% dependency resolution
|
|
||||||
```
|
|
||||||
|
|
||||||
## Navigation Quick Reference
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# New user start here
|
|
||||||
cat README.md
|
|
||||||
cat docs/GETTING_STARTED.md
|
|
||||||
|
|
||||||
# Quick reference
|
|
||||||
cat docs/QUICKSTART.md
|
|
||||||
cat docs/API_REFERENCE.md
|
|
||||||
|
|
||||||
# Understand internals
|
|
||||||
cat docs/ARCHITECTURE.md
|
|
||||||
cat docs/DEPENDENCY_RESOLUTION.md
|
|
||||||
|
|
||||||
# Contribute
|
|
||||||
cat docs/DEVELOPMENT.md
|
|
||||||
cat docs/ROADMAP.md
|
|
||||||
|
|
||||||
# Browse all
|
|
||||||
cat docs/INDEX.md
|
|
||||||
```
|
|
||||||
|
|
||||||
## Conclusion
|
|
||||||
|
|
||||||
Documentation is now **professional, comprehensive, and easy to navigate**.
|
|
||||||
|
|
||||||
Perfect for:
|
|
||||||
- ✅ New users getting started
|
|
||||||
- ✅ Developers understanding the system
|
|
||||||
- ✅ Contributors extending the parser
|
|
||||||
- ✅ Technical deep dives when needed
|
|
||||||
|
|
||||||
**Status**: Production-ready documentation matching production-ready code!
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
**Session**: Complete
|
|
||||||
**Total Commits**: 4 (all pushed)
|
|
||||||
**Documentation**: Clean and organized
|
|
||||||
**Tests**: All passing
|
|
||||||
**Build**: Clean
|
|
||||||
**Status**: ✅ **READY FOR USE**
|
|
||||||
|
|
@ -1,213 +0,0 @@
|
||||||
# SDL3 Parser - Project Structure
|
|
||||||
|
|
||||||
```
|
|
||||||
parser/
|
|
||||||
├── README.md # Project overview and quick start
|
|
||||||
├── build.zig # Build configuration
|
|
||||||
├── build.zig.zon # Dependencies
|
|
||||||
│
|
|
||||||
├── src/ # Source code (900 lines)
|
|
||||||
│ ├── parser.zig # Main entry point, CLI
|
|
||||||
│ ├── patterns.zig # Pattern matching & scanning
|
|
||||||
│ ├── types.zig # C to Zig type conversion
|
|
||||||
│ ├── naming.zig # Naming convention handling
|
|
||||||
│ ├── codegen.zig # Zig code generation
|
|
||||||
│ ├── mock_codegen.zig # C mock generation
|
|
||||||
│ └── dependency_resolver.zig # Dependency analysis (NEW)
|
|
||||||
│
|
|
||||||
├── test/ # Test files
|
|
||||||
│ ├── integration/ # Integration tests
|
|
||||||
│ │ ├── test_multifield_*.zig
|
|
||||||
│ │ ├── test_typedef_*.zig
|
|
||||||
│ │ └── test_flow_*.zig
|
|
||||||
│ └── (pattern test files)
|
|
||||||
│
|
|
||||||
├── docs/ # Documentation (5,500+ lines)
|
|
||||||
│ ├── INDEX.md # Documentation index
|
|
||||||
│ │
|
|
||||||
│ ├── GETTING_STARTED.md # Installation and first use
|
|
||||||
│ ├── QUICKSTART.md # Quick reference
|
|
||||||
│ ├── API_REFERENCE.md # Command-line options
|
|
||||||
│ │
|
|
||||||
│ ├── ARCHITECTURE.md # System design
|
|
||||||
│ ├── DEPENDENCY_RESOLUTION.md # How deps work
|
|
||||||
│ ├── KNOWN_ISSUES.md # Limitations
|
|
||||||
│ │
|
|
||||||
│ ├── DEVELOPMENT.md # Contributing guide
|
|
||||||
│ ├── ROADMAP.md # Future plans
|
|
||||||
│ │
|
|
||||||
│ ├── DEPENDENCY_FLOW.md # Technical deep dive
|
|
||||||
│ ├── VISUAL_FLOW.md # Flow diagrams
|
|
||||||
│ ├── MULTI_FIELD_IMPLEMENTATION.md
|
|
||||||
│ ├── TYPEDEF_IMPLEMENTATION.md
|
|
||||||
│ ├── MULTI_HEADER_TEST_RESULTS.md
|
|
||||||
│ │
|
|
||||||
│ └── archive/ # Historical documents
|
|
||||||
│ └── (planning and status docs)
|
|
||||||
│
|
|
||||||
└── zig-out/ # Build artifacts
|
|
||||||
└── bin/sdl-parser # Executable
|
|
||||||
```
|
|
||||||
|
|
||||||
## Documentation Organization
|
|
||||||
|
|
||||||
### User Documentation (Start Here)
|
|
||||||
1. README.md - Project overview
|
|
||||||
2. GETTING_STARTED.md - Tutorial
|
|
||||||
3. QUICKSTART.md - Quick reference
|
|
||||||
4. API_REFERENCE.md - Complete reference
|
|
||||||
|
|
||||||
### Technical Documentation
|
|
||||||
5. ARCHITECTURE.md - System design
|
|
||||||
6. DEPENDENCY_RESOLUTION.md - Feature details
|
|
||||||
7. DEPENDENCY_FLOW.md - Implementation walkthrough
|
|
||||||
8. VISUAL_FLOW.md - Diagrams
|
|
||||||
|
|
||||||
### Development Documentation
|
|
||||||
9. DEVELOPMENT.md - Contributing guide
|
|
||||||
10. KNOWN_ISSUES.md - Current limitations
|
|
||||||
11. ROADMAP.md - Future plans
|
|
||||||
|
|
||||||
### Implementation Documentation
|
|
||||||
12. MULTI_FIELD_IMPLEMENTATION.md - Struct parsing
|
|
||||||
13. TYPEDEF_IMPLEMENTATION.md - Typedef support
|
|
||||||
14. MULTI_HEADER_TEST_RESULTS.md - Test results
|
|
||||||
|
|
||||||
## Source Code Organization
|
|
||||||
|
|
||||||
### Core Pipeline
|
|
||||||
|
|
||||||
```
|
|
||||||
parser.zig (main)
|
|
||||||
↓
|
|
||||||
patterns.zig (scan)
|
|
||||||
↓
|
|
||||||
dependency_resolver.zig (resolve)
|
|
||||||
↓
|
|
||||||
codegen.zig (generate)
|
|
||||||
↓
|
|
||||||
Output (Zig/C)
|
|
||||||
```
|
|
||||||
|
|
||||||
### Supporting Modules
|
|
||||||
|
|
||||||
- `types.zig` - Type conversion utilities
|
|
||||||
- `naming.zig` - Naming convention utilities
|
|
||||||
- `mock_codegen.zig` - C mock generation
|
|
||||||
|
|
||||||
## Build Outputs
|
|
||||||
|
|
||||||
### Local Build
|
|
||||||
|
|
||||||
```
|
|
||||||
zig-out/
|
|
||||||
├── bin/
|
|
||||||
│ └── sdl-parser # Executable
|
|
||||||
└── (test outputs)
|
|
||||||
```
|
|
||||||
|
|
||||||
### Integration with lib/sdl3
|
|
||||||
|
|
||||||
```
|
|
||||||
lib/sdl3/
|
|
||||||
├── v2/ # Generated bindings
|
|
||||||
│ ├── gpu.zig # SDL_gpu.h bindings
|
|
||||||
│ ├── video.zig # SDL_video.h (if working)
|
|
||||||
│ └── ...
|
|
||||||
└── zig-out/
|
|
||||||
├── gpu_test.zig # Test bindings
|
|
||||||
└── gpu_test_mock.c # Test mocks
|
|
||||||
```
|
|
||||||
|
|
||||||
## Test Organization
|
|
||||||
|
|
||||||
### Unit Tests (in source files)
|
|
||||||
|
|
||||||
Each src/*.zig file contains tests at the bottom:
|
|
||||||
- Pattern matching tests
|
|
||||||
- Type conversion tests
|
|
||||||
- Naming convention tests
|
|
||||||
|
|
||||||
### Integration Tests (test/integration/)
|
|
||||||
|
|
||||||
- `test_multifield_*.zig` - Multi-field struct parsing
|
|
||||||
- `test_typedef_*.zig` - Typedef scanning
|
|
||||||
- `test_flow_*.zig` - Dependency resolution
|
|
||||||
- `test_*.c` - Test input files
|
|
||||||
|
|
||||||
### Running Tests
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# All tests
|
|
||||||
zig build test
|
|
||||||
|
|
||||||
# Specific test file
|
|
||||||
zig test test/integration/test_typedef_simple.zig
|
|
||||||
```
|
|
||||||
|
|
||||||
## Documentation Categories
|
|
||||||
|
|
||||||
### For Users
|
|
||||||
- Getting started, quickstart, API reference
|
|
||||||
- Focus: How to use the tool
|
|
||||||
|
|
||||||
### For Understanding
|
|
||||||
- Architecture, dependency resolution
|
|
||||||
- Focus: How it works internally
|
|
||||||
|
|
||||||
### For Developers
|
|
||||||
- Development guide, implementation docs
|
|
||||||
- Focus: How to extend and contribute
|
|
||||||
|
|
||||||
### For Reference
|
|
||||||
- Technical deep dives, flow diagrams
|
|
||||||
- Focus: Complete implementation details
|
|
||||||
|
|
||||||
## File Size Reference
|
|
||||||
|
|
||||||
### Source Code
|
|
||||||
- Total: ~900 lines production code
|
|
||||||
- Average: ~150 lines per module
|
|
||||||
- Largest: dependency_resolver.zig (454 lines)
|
|
||||||
|
|
||||||
### Documentation
|
|
||||||
- Total: ~5,500 lines
|
|
||||||
- User guides: ~1,500 lines
|
|
||||||
- Technical docs: ~2,500 lines
|
|
||||||
- Implementation details: ~1,500 lines
|
|
||||||
|
|
||||||
### Tests
|
|
||||||
- Unit tests: ~400 lines (in source files)
|
|
||||||
- Integration tests: ~500 lines (separate files)
|
|
||||||
- Total: ~900 lines
|
|
||||||
|
|
||||||
## Quick Navigation
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Main documentation entry point
|
|
||||||
cat README.md
|
|
||||||
|
|
||||||
# Start tutorial
|
|
||||||
cat docs/GETTING_STARTED.md
|
|
||||||
|
|
||||||
# Command reference
|
|
||||||
cat docs/API_REFERENCE.md
|
|
||||||
|
|
||||||
# Understand internals
|
|
||||||
cat docs/ARCHITECTURE.md
|
|
||||||
|
|
||||||
# Fix issues
|
|
||||||
cat docs/KNOWN_ISSUES.md
|
|
||||||
|
|
||||||
# Contribute
|
|
||||||
cat docs/DEVELOPMENT.md
|
|
||||||
|
|
||||||
# All docs
|
|
||||||
ls docs/
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
**Last Updated**: 2026-01-22
|
|
||||||
**Documentation Version**: 2.1
|
|
||||||
**Status**: Clean and organized ✅
|
|
||||||
|
|
@ -19,13 +19,20 @@ A Zig tool that automatically generates idiomatic Zig bindings from SDL3 C heade
|
||||||
```bash
|
```bash
|
||||||
cd parser/
|
cd parser/
|
||||||
zig build # Build the parser
|
zig build # Build the parser
|
||||||
zig build test # Run tests (26+ tests)
|
zig build test # Run tests
|
||||||
|
```
|
||||||
|
|
||||||
|
### Generate All SDL3 Bindings
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# From lib/sdl3 directory
|
||||||
|
zig build regenerate-zig # Generates all SDL3 .zig files in v2/
|
||||||
```
|
```
|
||||||
|
|
||||||
### Basic Usage
|
### Basic Usage
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Generate Zig bindings
|
# Generate single header Zig bindings
|
||||||
zig build run -- ../SDL/include/SDL3/SDL_gpu.h --output=gpu.zig
|
zig build run -- ../SDL/include/SDL3/SDL_gpu.h --output=gpu.zig
|
||||||
|
|
||||||
# Generate with C mocks for testing
|
# Generate with C mocks for testing
|
||||||
|
|
@ -118,21 +125,25 @@ SDL_gpu.h references SDL_Window
|
||||||
## Project Status
|
## Project Status
|
||||||
|
|
||||||
### Production Ready ✅
|
### Production Ready ✅
|
||||||
- SDL_gpu.h: 100% working
|
- **45+ SDL3 headers** successfully parsed and generated
|
||||||
- 26+ tests passing
|
- All tests passing
|
||||||
- Comprehensive documentation
|
- Comprehensive documentation
|
||||||
- Zero manual intervention needed
|
- Automatic dependency resolution
|
||||||
|
- JSON export capability
|
||||||
|
|
||||||
### Tested Headers
|
### Successfully Generated Headers
|
||||||
|
|
||||||
| Header | Status | Dependencies | Notes |
|
All major SDL3 APIs are supported:
|
||||||
|--------|--------|--------------|-------|
|
|
||||||
| SDL_gpu.h | ✅ Complete | 5/5 (100%) | Production ready |
|
|
||||||
| SDL_keyboard.h | ⚠️ Partial | 6/6 resolved | Enum syntax issues |
|
|
||||||
| SDL_video.h | ⚠️ Partial | 5/14 resolved | Needs fixes |
|
|
||||||
| SDL_events.h | ⚠️ Partial | Unknown | Needs fixes |
|
|
||||||
|
|
||||||
See [Known Issues](docs/KNOWN_ISSUES.md) for details.
|
**Core APIs**: audio, camera, clipboard, dialog, events, filesystem, gamepad, gpu, haptic, hints, init, joystick, keyboard, log, mouse, pen, power, properties, rect, render, sensor, storage, surface, time, timer, touch, video
|
||||||
|
|
||||||
|
**Platform APIs**: hidapi, iostream, loadso, locale, messagebox, misc, process, stdinc, system, tray, version, vulkan
|
||||||
|
|
||||||
|
**Specialized APIs**: blendmode, error, guid, iostream, metal, pixels, scancode
|
||||||
|
|
||||||
|
**Skipped**: assert (macro-only), mutex (unsafe primitives), thread (complex concurrency)
|
||||||
|
|
||||||
|
See [Known Issues](docs/KNOWN_ISSUES.md) for remaining limitations.
|
||||||
|
|
||||||
## Performance
|
## Performance
|
||||||
|
|
||||||
|
|
@ -188,6 +199,6 @@ Developed for automatic SDL3 binding generation in the Backlog engine.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
**Version**: 2.1
|
**Version**: 3.0
|
||||||
**Status**: Production ready for SDL_gpu.h
|
**Status**: Production ready - 45+ SDL3 headers supported
|
||||||
**Last Updated**: 2026-01-22
|
**Last Updated**: 2026-01-23
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,239 +0,0 @@
|
||||||
{
|
|
||||||
"header": "SDL_init.h",
|
|
||||||
"opaque_types": [],
|
|
||||||
"typedefs": [],
|
|
||||||
"function_pointers": [
|
|
||||||
{
|
|
||||||
"name": "SDL_AppInit_func",
|
|
||||||
"return_type": "SDL_AppResult",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "appstate",
|
|
||||||
"type": "void **"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "argc",
|
|
||||||
"type": "int"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "argv[]",
|
|
||||||
"type": "char *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_AppIterate_func",
|
|
||||||
"return_type": "SDL_AppResult",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "appstate",
|
|
||||||
"type": "void *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_AppEvent_func",
|
|
||||||
"return_type": "SDL_AppResult",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "appstate",
|
|
||||||
"type": "void *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "event",
|
|
||||||
"type": "SDL_Event *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_AppQuit_func",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "appstate",
|
|
||||||
"type": "void *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "result",
|
|
||||||
"type": "SDL_AppResult"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_MainThreadCallback",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "userdata",
|
|
||||||
"type": "void *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"enums": [
|
|
||||||
{
|
|
||||||
"name": "SDL_AppResult",
|
|
||||||
"values": []
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"structs": [],
|
|
||||||
"unions": [],
|
|
||||||
"flags": [
|
|
||||||
{
|
|
||||||
"name": "SDL_InitFlags",
|
|
||||||
"underlying_type": "Uint32",
|
|
||||||
"values": [
|
|
||||||
{
|
|
||||||
"name": "SDL_INIT_AUDIO",
|
|
||||||
"value": "0x00000010u",
|
|
||||||
"comment": "`SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS`"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_INIT_VIDEO",
|
|
||||||
"value": "0x00000020u",
|
|
||||||
"comment": "`SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_INIT_JOYSTICK",
|
|
||||||
"value": "0x00000200u",
|
|
||||||
"comment": "`SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS`, should be initialized on the same thread as SDL_INIT_VIDEO on Windows if you don't set SDL_HINT_JOYSTICK_THREAD"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_INIT_HAPTIC",
|
|
||||||
"value": "0x00001000u"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_INIT_GAMEPAD",
|
|
||||||
"value": "0x00002000u",
|
|
||||||
"comment": "`SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK`"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_INIT_EVENTS",
|
|
||||||
"value": "0x00004000u"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_INIT_SENSOR",
|
|
||||||
"value": "0x00008000u",
|
|
||||||
"comment": "`SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS`"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_INIT_CAMERA",
|
|
||||||
"value": "0x00010000u",
|
|
||||||
"comment": "`SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS`"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"functions": [
|
|
||||||
{
|
|
||||||
"name": "SDL_Init",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "flags",
|
|
||||||
"type": "SDL_InitFlags"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_InitSubSystem",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "flags",
|
|
||||||
"type": "SDL_InitFlags"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_QuitSubSystem",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "flags",
|
|
||||||
"type": "SDL_InitFlags"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_WasInit",
|
|
||||||
"return_type": "SDL_InitFlags",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "flags",
|
|
||||||
"type": "SDL_InitFlags"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_Quit",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_IsMainThread",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_RunOnMainThread",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "callback",
|
|
||||||
"type": "SDL_MainThreadCallback"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "userdata",
|
|
||||||
"type": "void *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "wait_complete",
|
|
||||||
"type": "bool"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_SetAppMetadata",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "appname",
|
|
||||||
"type": "const char *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "appversion",
|
|
||||||
"type": "const char *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "appidentifier",
|
|
||||||
"type": "const char *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_SetAppMetadataProperty",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "name",
|
|
||||||
"type": "const char *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "value",
|
|
||||||
"type": "const char *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetAppMetadataProperty",
|
|
||||||
"return_type": "const char *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "name",
|
|
||||||
"type": "const char *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
@ -1,845 +0,0 @@
|
||||||
# Dependency Resolution Flow - Technical Deep Dive
|
|
||||||
|
|
||||||
## Overview
|
|
||||||
|
|
||||||
This document traces the complete flow from parser entry point through dependency resolution to final output generation.
|
|
||||||
|
|
||||||
## Flow Diagram
|
|
||||||
|
|
||||||
```
|
|
||||||
main()
|
|
||||||
↓
|
|
||||||
Parse Primary Header (SDL_gpu.h)
|
|
||||||
↓
|
|
||||||
Analyze Dependencies
|
|
||||||
↓
|
|
||||||
Extract Missing Types
|
|
||||||
↓
|
|
||||||
Combine Declarations
|
|
||||||
↓
|
|
||||||
Generate Output
|
|
||||||
```
|
|
||||||
|
|
||||||
## Detailed Step-by-Step Flow
|
|
||||||
|
|
||||||
### Phase 1: Parser Entry Point
|
|
||||||
|
|
||||||
**File**: `src/parser.zig::main()`
|
|
||||||
|
|
||||||
```zig
|
|
||||||
pub fn main() !void {
|
|
||||||
// 1. Setup
|
|
||||||
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
|
|
||||||
const allocator = gpa.allocator();
|
|
||||||
|
|
||||||
// 2. Parse command line arguments
|
|
||||||
const header_path = args[1];
|
|
||||||
var output_file: ?[]const u8 = null;
|
|
||||||
var mock_output_file: ?[]const u8 = null;
|
|
||||||
|
|
||||||
// 3. Read the primary header file
|
|
||||||
const source = try std.fs.cwd().readFileAlloc(
|
|
||||||
allocator,
|
|
||||||
header_path,
|
|
||||||
10 * 1024 * 1024
|
|
||||||
);
|
|
||||||
defer allocator.free(source);
|
|
||||||
```
|
|
||||||
|
|
||||||
**Inputs**:
|
|
||||||
- Command line: `zig build run -- SDL_gpu.h --output=gpu.zig`
|
|
||||||
- Header file contents read into memory
|
|
||||||
|
|
||||||
**Outputs**:
|
|
||||||
- `source`: []const u8 - Full header file content
|
|
||||||
- `header_path`: []const u8 - Path for finding dependency headers
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Phase 2: Primary Header Parsing
|
|
||||||
|
|
||||||
**File**: `src/parser.zig::main()` continued
|
|
||||||
|
|
||||||
```zig
|
|
||||||
// 4. Parse declarations from primary header
|
|
||||||
var scanner = patterns.Scanner.init(allocator, source);
|
|
||||||
const decls = try scanner.scan();
|
|
||||||
|
|
||||||
// decls is now: []Declaration containing:
|
|
||||||
// - 13 opaque types (GPUDevice, GPUTexture, etc.)
|
|
||||||
// - 24 enums
|
|
||||||
// - 35 structs
|
|
||||||
// - 3 flags
|
|
||||||
// - 94 functions
|
|
||||||
```
|
|
||||||
|
|
||||||
**Process**:
|
|
||||||
1. `Scanner.init()` creates scanner with allocator and source
|
|
||||||
2. `scanner.scan()` iterates through source line by line
|
|
||||||
3. Tries each pattern: opaque, enum, struct, flags, function
|
|
||||||
4. Builds array of `Declaration` union variants
|
|
||||||
5. Each declaration owns its strings (allocated from scanner's allocator)
|
|
||||||
|
|
||||||
**Outputs**:
|
|
||||||
- `decls`: []Declaration - Array of 169 declarations from SDL_gpu.h
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Phase 3: Dependency Analysis Entry
|
|
||||||
|
|
||||||
**File**: `src/parser.zig::main()` continued
|
|
||||||
|
|
||||||
```zig
|
|
||||||
// 5. Create dependency resolver
|
|
||||||
var resolver = dependency_resolver.DependencyResolver.init(allocator);
|
|
||||||
defer resolver.deinit();
|
|
||||||
|
|
||||||
// 6. Analyze declarations to find missing types
|
|
||||||
try resolver.analyze(decls);
|
|
||||||
```
|
|
||||||
|
|
||||||
**What `DependencyResolver.init()` does**:
|
|
||||||
```zig
|
|
||||||
pub fn init(allocator: Allocator) DependencyResolver {
|
|
||||||
return .{
|
|
||||||
.allocator = allocator,
|
|
||||||
.referenced_types = std.StringHashMap(void).init(allocator),
|
|
||||||
.defined_types = std.StringHashMap(void).init(allocator),
|
|
||||||
};
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
Creates two HashMaps:
|
|
||||||
- `defined_types`: Types defined in primary header
|
|
||||||
- `referenced_types`: Types used in function signatures/struct fields
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Phase 4: Type Collection
|
|
||||||
|
|
||||||
**File**: `src/dependency_resolver.zig::DependencyResolver.analyze()`
|
|
||||||
|
|
||||||
```zig
|
|
||||||
pub fn analyze(self: *DependencyResolver, decls: []const Declaration) !void {
|
|
||||||
try self.collectDefinedTypes(decls); // Step 4a
|
|
||||||
try self.collectReferencedTypes(decls); // Step 4b
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Step 4a: Collect Defined Types
|
|
||||||
|
|
||||||
```zig
|
|
||||||
fn collectDefinedTypes(self: *DependencyResolver, decls: []const Declaration) !void {
|
|
||||||
for (decls) |decl| {
|
|
||||||
const type_name = switch (decl) {
|
|
||||||
.opaque_type => |o| o.name, // e.g., "SDL_GPUDevice"
|
|
||||||
.enum_decl => |e| e.name, // e.g., "SDL_GPUPrimitiveType"
|
|
||||||
.struct_decl => |s| s.name, // e.g., "SDL_GPUViewport"
|
|
||||||
.flag_decl => |f| f.name, // e.g., "SDL_GPUTextureUsageFlags"
|
|
||||||
.function_decl => continue, // Functions don't define types
|
|
||||||
};
|
|
||||||
try self.defined_types.put(type_name, {});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
**Result**: `defined_types` HashMap contains:
|
|
||||||
```
|
|
||||||
SDL_GPUDevice -> {}
|
|
||||||
SDL_GPUTexture -> {}
|
|
||||||
SDL_GPUViewport -> {}
|
|
||||||
SDL_GPUPrimitiveType -> {}
|
|
||||||
... (166 more entries)
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Step 4b: Collect Referenced Types
|
|
||||||
|
|
||||||
```zig
|
|
||||||
fn collectReferencedTypes(self: *DependencyResolver, decls: []const Declaration) !void {
|
|
||||||
for (decls) |decl| {
|
|
||||||
switch (decl) {
|
|
||||||
.function_decl => |func| {
|
|
||||||
// Scan return type
|
|
||||||
try self.scanType(func.return_type);
|
|
||||||
// Scan each parameter type
|
|
||||||
for (func.params) |param| {
|
|
||||||
try self.scanType(param.type_name);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
.struct_decl => |struct_decl| {
|
|
||||||
// Scan each field type
|
|
||||||
for (struct_decl.fields) |field| {
|
|
||||||
try self.scanType(field.type_name);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
else => {},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
**Example**: Function signature processing
|
|
||||||
```c
|
|
||||||
// C function:
|
|
||||||
bool SDL_WindowSupportsGPUSwapchain(SDL_GPUDevice *device, SDL_Window *window)
|
|
||||||
|
|
||||||
// Parser sees:
|
|
||||||
.function_decl = {
|
|
||||||
.return_type = "bool",
|
|
||||||
.params = [
|
|
||||||
{ .type_name = "SDL_GPUDevice *" },
|
|
||||||
{ .type_name = "SDL_Window *" }
|
|
||||||
]
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
**For each type string, calls `scanType()`**:
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Phase 5: Type Extraction & Normalization
|
|
||||||
|
|
||||||
**File**: `src/dependency_resolver.zig::scanType()`
|
|
||||||
|
|
||||||
```zig
|
|
||||||
fn scanType(self: *DependencyResolver, type_str: []const u8) !void {
|
|
||||||
// Extract base type from decorated string
|
|
||||||
const base_type = extractBaseType(type_str);
|
|
||||||
|
|
||||||
if (base_type.len > 0 and isSDLType(base_type)) {
|
|
||||||
// Only add if not already present (deduplicate)
|
|
||||||
if (!self.referenced_types.contains(base_type)) {
|
|
||||||
// Must own the string (type_str may be freed)
|
|
||||||
const owned = try self.allocator.dupe(u8, base_type);
|
|
||||||
try self.referenced_types.put(owned, {});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Example: Type Extraction Process
|
|
||||||
|
|
||||||
**Input**: `"SDL_Window *"`
|
|
||||||
|
|
||||||
**Step-by-step through `extractBaseType()`**:
|
|
||||||
|
|
||||||
```zig
|
|
||||||
fn extractBaseType(type_str: []const u8) []const u8 {
|
|
||||||
var result = "SDL_Window *";
|
|
||||||
|
|
||||||
// Loop 1: Remove leading qualifiers
|
|
||||||
result = std.mem.trim(u8, result, " \t"); // "SDL_Window *"
|
|
||||||
// No leading "const", "?", "*", etc.
|
|
||||||
|
|
||||||
// Loop 2: Remove trailing qualifiers
|
|
||||||
result = std.mem.trim(u8, result, " \t"); // "SDL_Window *"
|
|
||||||
|
|
||||||
// Check trailing "*"
|
|
||||||
if (std.mem.endsWith(u8, result, "*")) {
|
|
||||||
result = result[0..result.len-1]; // "SDL_Window "
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
result = std.mem.trim(u8, result, " \t"); // "SDL_Window"
|
|
||||||
|
|
||||||
return "SDL_Window";
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
**Output**: `"SDL_Window"` (clean type name)
|
|
||||||
|
|
||||||
**More Examples**:
|
|
||||||
```
|
|
||||||
"?*SDL_GPUDevice" -> "SDL_GPUDevice"
|
|
||||||
"*const SDL_Rect" -> "SDL_Rect"
|
|
||||||
"SDL_GPUBuffer *const *" -> "SDL_GPUBuffer"
|
|
||||||
"[*c]const u8" -> "u8"
|
|
||||||
"SDL_FColor" -> "SDL_FColor"
|
|
||||||
```
|
|
||||||
|
|
||||||
#### SDL Type Detection
|
|
||||||
|
|
||||||
```zig
|
|
||||||
fn isSDLType(type_str: []const u8) bool {
|
|
||||||
// Check for SDL_ prefix
|
|
||||||
if (std.mem.startsWith(u8, type_str, "SDL_")) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check known Zig-ified names
|
|
||||||
const known_types = [_][]const u8{
|
|
||||||
"Window", "Rect", "FColor", "FlipMode",
|
|
||||||
"PropertiesID", "Surface", ...
|
|
||||||
};
|
|
||||||
|
|
||||||
for (known_types) |known| {
|
|
||||||
if (std.mem.eql(u8, type_str, known)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false; // Primitive type like "bool", "u32"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
**Result**: `referenced_types` HashMap contains:
|
|
||||||
```
|
|
||||||
SDL_Window -> {}
|
|
||||||
SDL_Rect -> {}
|
|
||||||
SDL_FColor -> {}
|
|
||||||
SDL_FlipMode -> {}
|
|
||||||
SDL_PropertiesID -> {}
|
|
||||||
SDL_GPUShaderFormat -> {}
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Phase 6: Missing Type Calculation
|
|
||||||
|
|
||||||
**File**: `src/parser.zig::main()` continued
|
|
||||||
|
|
||||||
```zig
|
|
||||||
// 7. Get missing types (referenced but not defined)
|
|
||||||
const missing_types = try resolver.getMissingTypes(allocator);
|
|
||||||
defer {
|
|
||||||
for (missing_types) |t| allocator.free(t);
|
|
||||||
allocator.free(missing_types);
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
**File**: `src/dependency_resolver.zig::getMissingTypes()`
|
|
||||||
|
|
||||||
```zig
|
|
||||||
pub fn getMissingTypes(self: *DependencyResolver, allocator: Allocator) ![][]const u8 {
|
|
||||||
var missing = std.ArrayList([]const u8){};
|
|
||||||
|
|
||||||
var it = self.referenced_types.keyIterator();
|
|
||||||
while (it.next()) |key| {
|
|
||||||
// Check if type is NOT in defined_types
|
|
||||||
if (!self.defined_types.contains(key.*)) {
|
|
||||||
// This is a missing type - need to find it
|
|
||||||
try missing.append(allocator, try allocator.dupe(u8, key.*));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return try missing.toOwnedSlice(allocator);
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
**Logic**:
|
|
||||||
```
|
|
||||||
referenced_types = {SDL_Window, SDL_Rect, SDL_FColor, ...}
|
|
||||||
defined_types = {SDL_GPUDevice, SDL_GPUTexture, ...}
|
|
||||||
|
|
||||||
missing_types = referenced_types - defined_types
|
|
||||||
= {SDL_Window, SDL_Rect, SDL_FColor, SDL_FlipMode,
|
|
||||||
SDL_PropertiesID, SDL_GPUShaderFormat}
|
|
||||||
```
|
|
||||||
|
|
||||||
**Output**: Array of 6 strings (owned by caller)
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Phase 7: Include Header Parsing
|
|
||||||
|
|
||||||
**File**: `src/parser.zig::main()` continued
|
|
||||||
|
|
||||||
```zig
|
|
||||||
if (missing_types.len > 0) {
|
|
||||||
// 8. Parse #include directives from source
|
|
||||||
const includes = try dependency_resolver.parseIncludes(allocator, source);
|
|
||||||
defer {
|
|
||||||
for (includes) |inc| allocator.free(inc);
|
|
||||||
allocator.free(includes);
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
**File**: `src/dependency_resolver.zig::parseIncludes()`
|
|
||||||
|
|
||||||
```zig
|
|
||||||
pub fn parseIncludes(allocator: Allocator, source: []const u8) ![][]const u8 {
|
|
||||||
var includes = std.ArrayList([]const u8){};
|
|
||||||
|
|
||||||
var lines = std.mem.splitScalar(u8, source, '\n');
|
|
||||||
while (lines.next()) |line| {
|
|
||||||
const trimmed = std.mem.trim(u8, line, " \t\r");
|
|
||||||
|
|
||||||
// Match: #include <SDL3/SDL_something.h>
|
|
||||||
if (std.mem.startsWith(u8, trimmed, "#include <SDL3/")) {
|
|
||||||
const after_open = "#include <SDL3/".len;
|
|
||||||
if (std.mem.indexOf(u8, trimmed[after_open..], ">")) |end| {
|
|
||||||
const header_name = trimmed[after_open..][0..end];
|
|
||||||
try includes.append(allocator, try allocator.dupe(u8, header_name));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return try includes.toOwnedSlice(allocator);
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
**Example**: From SDL_gpu.h header:
|
|
||||||
```c
|
|
||||||
#include <SDL3/SDL_stdinc.h>
|
|
||||||
#include <SDL3/SDL_pixels.h>
|
|
||||||
#include <SDL3/SDL_properties.h>
|
|
||||||
#include <SDL3/SDL_rect.h>
|
|
||||||
#include <SDL3/SDL_surface.h>
|
|
||||||
#include <SDL3/SDL_video.h>
|
|
||||||
```
|
|
||||||
|
|
||||||
**Output**: Array of strings:
|
|
||||||
```
|
|
||||||
["SDL_stdinc.h", "SDL_pixels.h", "SDL_properties.h",
|
|
||||||
"SDL_rect.h", "SDL_surface.h", "SDL_video.h"]
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Phase 8: Dependency Type Extraction
|
|
||||||
|
|
||||||
**File**: `src/parser.zig::main()` continued
|
|
||||||
|
|
||||||
```zig
|
|
||||||
// 9. Determine header directory
|
|
||||||
const header_dir = std.fs.path.dirname(header_path) orelse ".";
|
|
||||||
// e.g., "../SDL/include/SDL3"
|
|
||||||
|
|
||||||
var dependency_decls = std.ArrayList(patterns.Declaration){};
|
|
||||||
defer {
|
|
||||||
for (dependency_decls.items) |dep_decl| {
|
|
||||||
freeDeclDeep(allocator, dep_decl);
|
|
||||||
}
|
|
||||||
dependency_decls.deinit(allocator);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 10. For each missing type, search dependency headers
|
|
||||||
for (missing_types) |missing_type| {
|
|
||||||
var found = false;
|
|
||||||
|
|
||||||
// Try each included header
|
|
||||||
for (includes) |include| {
|
|
||||||
// 10a. Build full path
|
|
||||||
const dep_path = try std.fs.path.join(
|
|
||||||
allocator,
|
|
||||||
&[_][]const u8{ header_dir, include }
|
|
||||||
);
|
|
||||||
defer allocator.free(dep_path);
|
|
||||||
// e.g., "../SDL/include/SDL3/SDL_pixels.h"
|
|
||||||
|
|
||||||
// 10b. Read dependency header
|
|
||||||
const dep_source = std.fs.cwd().readFileAlloc(
|
|
||||||
allocator,
|
|
||||||
dep_path,
|
|
||||||
10 * 1024 * 1024
|
|
||||||
) catch continue; // Skip if can't read
|
|
||||||
defer allocator.free(dep_source);
|
|
||||||
|
|
||||||
// 10c. Extract type from this header
|
|
||||||
if (try dependency_resolver.extractTypeFromHeader(
|
|
||||||
allocator,
|
|
||||||
dep_source,
|
|
||||||
missing_type
|
|
||||||
)) |dep_decl| {
|
|
||||||
try dependency_decls.append(allocator, dep_decl);
|
|
||||||
std.debug.print(" ✓ Found {s} in {s}\n",
|
|
||||||
.{missing_type, include});
|
|
||||||
found = true;
|
|
||||||
break; // Found it, stop searching
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!found) {
|
|
||||||
std.debug.print(" ⚠ Warning: Could not find {s}\n",
|
|
||||||
.{missing_type});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
**Search Algorithm**:
|
|
||||||
```
|
|
||||||
For missing_type "SDL_Window":
|
|
||||||
Try SDL_stdinc.h -> Not found
|
|
||||||
Try SDL_pixels.h -> Not found
|
|
||||||
Try SDL_properties.h -> Not found
|
|
||||||
Try SDL_rect.h -> Not found
|
|
||||||
Try SDL_surface.h -> Not found
|
|
||||||
Try SDL_video.h -> FOUND! ✓
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Phase 9: Type Extraction from Header
|
|
||||||
|
|
||||||
**File**: `src/dependency_resolver.zig::extractTypeFromHeader()`
|
|
||||||
|
|
||||||
```zig
|
|
||||||
pub fn extractTypeFromHeader(
|
|
||||||
allocator: Allocator,
|
|
||||||
header_source: []const u8,
|
|
||||||
type_name: []const u8, // e.g., "SDL_Window"
|
|
||||||
) !?Declaration {
|
|
||||||
// 1. Parse the entire dependency header
|
|
||||||
var scanner = patterns.Scanner.init(allocator, header_source);
|
|
||||||
const all_decls = try scanner.scan();
|
|
||||||
defer {
|
|
||||||
for (all_decls) |decl| {
|
|
||||||
freeDeclaration(allocator, decl);
|
|
||||||
}
|
|
||||||
allocator.free(all_decls);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 2. Search for matching type
|
|
||||||
for (all_decls) |decl| {
|
|
||||||
const decl_name = switch (decl) {
|
|
||||||
.opaque_type => |o| o.name,
|
|
||||||
.enum_decl => |e| e.name,
|
|
||||||
.struct_decl => |s| s.name,
|
|
||||||
.flag_decl => |f| f.name,
|
|
||||||
else => continue,
|
|
||||||
};
|
|
||||||
|
|
||||||
// 3. Found it!
|
|
||||||
if (std.mem.eql(u8, decl_name, type_name)) {
|
|
||||||
// 4. Deep clone so caller owns it
|
|
||||||
return try cloneDeclaration(allocator, decl);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return null; // Not found in this header
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
**Example**: Searching SDL_video.h for SDL_Window
|
|
||||||
|
|
||||||
1. Parse SDL_video.h → 50+ declarations
|
|
||||||
2. Iterate through all declarations
|
|
||||||
3. Find: `.opaque_type = { .name = "SDL_Window", ... }`
|
|
||||||
4. Clone the declaration (deep copy all strings)
|
|
||||||
5. Return the clone
|
|
||||||
6. Free all the temporary declarations from parsing
|
|
||||||
|
|
||||||
**Cloning Process**:
|
|
||||||
|
|
||||||
```zig
|
|
||||||
fn cloneDeclaration(allocator: Allocator, decl: Declaration) !Declaration {
|
|
||||||
return switch (decl) {
|
|
||||||
.opaque_type => |o| .{
|
|
||||||
.opaque_type = .{
|
|
||||||
.name = try allocator.dupe(u8, o.name), // Own the string
|
|
||||||
.doc_comment = if (o.doc_comment) |doc|
|
|
||||||
try allocator.dupe(u8, doc) else null,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
// ... similar for enum, struct, flags
|
|
||||||
};
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
**Why clone?** The parsed declarations from `scanner.scan()` are freed after this function returns. We need owned copies that live until code generation.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Phase 10: Declaration Combining
|
|
||||||
|
|
||||||
**File**: `src/parser.zig::main()` continued
|
|
||||||
|
|
||||||
```zig
|
|
||||||
// 11. Combine dependency declarations with primary
|
|
||||||
var all_decls = std.ArrayList(patterns.Declaration){};
|
|
||||||
defer all_decls.deinit(allocator);
|
|
||||||
|
|
||||||
// IMPORTANT: Dependencies FIRST!
|
|
||||||
try all_decls.appendSlice(allocator, dependency_decls.items);
|
|
||||||
try all_decls.appendSlice(allocator, decls);
|
|
||||||
```
|
|
||||||
|
|
||||||
**Result**: Combined array
|
|
||||||
```
|
|
||||||
all_decls = [
|
|
||||||
// Dependencies (4 items)
|
|
||||||
{ .struct_decl = SDL_FColor },
|
|
||||||
{ .enum_decl = SDL_FlipMode },
|
|
||||||
{ .struct_decl = SDL_Rect },
|
|
||||||
{ .opaque_type = SDL_Window },
|
|
||||||
|
|
||||||
// Primary header (169 items)
|
|
||||||
{ .opaque_type = SDL_GPUDevice },
|
|
||||||
{ .enum_decl = SDL_GPUPrimitiveType },
|
|
||||||
... (167 more)
|
|
||||||
]
|
|
||||||
```
|
|
||||||
|
|
||||||
**Why dependencies first?** Types must be defined before they're used. Since primary header references dependency types, dependencies must come first.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Phase 11: Code Generation
|
|
||||||
|
|
||||||
**File**: `src/parser.zig::main()` continued
|
|
||||||
|
|
||||||
```zig
|
|
||||||
// 12. Generate Zig code from all declarations
|
|
||||||
const output = try codegen.CodeGen.generate(allocator, all_decls.items);
|
|
||||||
defer allocator.free(output);
|
|
||||||
```
|
|
||||||
|
|
||||||
**File**: `src/codegen.zig::CodeGen.generate()` (simplified)
|
|
||||||
|
|
||||||
```zig
|
|
||||||
pub fn generate(allocator: Allocator, decls: []const Declaration) ![]const u8 {
|
|
||||||
var buf = std.ArrayList(u8){};
|
|
||||||
|
|
||||||
// Header
|
|
||||||
try buf.appendSlice(allocator, "pub const c = @import(\"c.zig\").c;\n\n");
|
|
||||||
|
|
||||||
// Generate each declaration
|
|
||||||
for (decls) |decl| {
|
|
||||||
switch (decl) {
|
|
||||||
.opaque_type => |o| {
|
|
||||||
try buf.appendSlice(allocator, "pub const ");
|
|
||||||
try buf.appendSlice(allocator, stripSDLPrefix(o.name));
|
|
||||||
try buf.appendSlice(allocator, " = opaque {};\n");
|
|
||||||
},
|
|
||||||
.struct_decl => |s| {
|
|
||||||
try generateStruct(allocator, &buf, s);
|
|
||||||
},
|
|
||||||
// ... other types
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return try buf.toOwnedSlice(allocator);
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
**Output** (excerpt):
|
|
||||||
```zig
|
|
||||||
pub const c = @import("c.zig").c;
|
|
||||||
|
|
||||||
pub const FColor = extern struct {
|
|
||||||
r: f32,
|
|
||||||
g: f32,
|
|
||||||
b: f32,
|
|
||||||
a: f32,
|
|
||||||
};
|
|
||||||
|
|
||||||
pub const Window = opaque {};
|
|
||||||
|
|
||||||
pub const GPUDevice = opaque {
|
|
||||||
pub inline fn windowSupportsGPU(
|
|
||||||
gpudevice: *GPUDevice,
|
|
||||||
window: ?*Window, // ✓ Window is defined above!
|
|
||||||
) bool {
|
|
||||||
return c.SDL_WindowSupportsGPUDevice(gpudevice, window);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Phase 12: AST Validation & Formatting
|
|
||||||
|
|
||||||
**File**: `src/parser.zig::main()` continued
|
|
||||||
|
|
||||||
```zig
|
|
||||||
// 13. Parse generated code as Zig AST
|
|
||||||
const output_z = try allocator.dupeZ(u8, output);
|
|
||||||
defer allocator.free(output_z);
|
|
||||||
|
|
||||||
var ast = try std.zig.Ast.parse(allocator, output_z, .zig);
|
|
||||||
defer ast.deinit(allocator);
|
|
||||||
|
|
||||||
// 14. Check for syntax errors
|
|
||||||
if (ast.errors.len > 0) {
|
|
||||||
std.debug.print("\nError: {d} syntax errors\n", .{ast.errors.len});
|
|
||||||
for (ast.errors) |err| {
|
|
||||||
const loc = ast.tokenLocation(0, err.token);
|
|
||||||
std.debug.print(" Line {d}: {s}\n",
|
|
||||||
.{ loc.line + 1, @tagName(err.tag) });
|
|
||||||
}
|
|
||||||
return error.InvalidSyntax;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 15. Format using Zig's formatter
|
|
||||||
const formatted_output = try ast.renderAlloc(allocator);
|
|
||||||
defer allocator.free(formatted_output);
|
|
||||||
```
|
|
||||||
|
|
||||||
**Why validate?** Catch codegen bugs early. If generated code doesn't parse, we know immediately.
|
|
||||||
|
|
||||||
**Why format?** Zig's formatter ensures consistent style, proper indentation, and canonical formatting.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Phase 13: Output Writing
|
|
||||||
|
|
||||||
**File**: `src/parser.zig::main()` continued
|
|
||||||
|
|
||||||
```zig
|
|
||||||
// 16. Write to file or stdout
|
|
||||||
if (output_file) |file_path| {
|
|
||||||
try std.fs.cwd().writeFile(.{
|
|
||||||
.sub_path = file_path,
|
|
||||||
.data = formatted_output,
|
|
||||||
});
|
|
||||||
std.debug.print("Generated: {s}\n", .{file_path});
|
|
||||||
} else {
|
|
||||||
_ = try std.posix.write(std.posix.STDOUT_FILENO, formatted_output);
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Memory Management Flow
|
|
||||||
|
|
||||||
### Allocations
|
|
||||||
|
|
||||||
1. **Primary header source**: Freed at end of main()
|
|
||||||
2. **Primary declarations**: Freed at end of main() (with deep free)
|
|
||||||
3. **Dependency resolver HashMaps**: Freed in resolver.deinit()
|
|
||||||
4. **HashMap keys** (in referenced_types): Freed in resolver.deinit()
|
|
||||||
5. **Missing types array**: Freed explicitly after use
|
|
||||||
6. **Includes array**: Freed explicitly after use
|
|
||||||
7. **Dependency header sources**: Freed immediately after extraction
|
|
||||||
8. **Temporary parsed declarations**: Freed immediately in extractTypeFromHeader()
|
|
||||||
9. **Cloned dependency declarations**: Freed at end of scope
|
|
||||||
10. **Generated output**: Freed after writing
|
|
||||||
11. **Formatted output**: Freed after writing
|
|
||||||
|
|
||||||
### Ownership Rules
|
|
||||||
|
|
||||||
- **Scanner owns strings** during parsing (from its allocator)
|
|
||||||
- **Cloned declarations own strings** after extraction (allocated explicitly)
|
|
||||||
- **HashMap owns keys** in referenced_types (duped when inserted)
|
|
||||||
- **Caller owns result** of getMissingTypes(), parseIncludes()
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Error Handling Flow
|
|
||||||
|
|
||||||
### Errors That Fail
|
|
||||||
|
|
||||||
```zig
|
|
||||||
// Fatal errors - exit immediately
|
|
||||||
- File not found (primary header)
|
|
||||||
- Out of memory
|
|
||||||
- Invalid syntax in generated code (optional)
|
|
||||||
```
|
|
||||||
|
|
||||||
### Errors That Warn
|
|
||||||
|
|
||||||
```zig
|
|
||||||
// Warnings - continue execution
|
|
||||||
- Dependency header not readable → continue with next header
|
|
||||||
- Type not found in any header → print warning, continue
|
|
||||||
- Struct parsing errors → generate partial output
|
|
||||||
```
|
|
||||||
|
|
||||||
### Example Error Flow
|
|
||||||
|
|
||||||
```
|
|
||||||
Parse SDL_gpu.h
|
|
||||||
↓
|
|
||||||
Missing type: SDL_Window
|
|
||||||
↓
|
|
||||||
Try SDL_pixels.h → catch FileNotFound → continue
|
|
||||||
Try SDL_video.h → Success! → break
|
|
||||||
↓
|
|
||||||
Missing type: SDL_Unknown
|
|
||||||
↓
|
|
||||||
Try all headers → Not found → print warning
|
|
||||||
↓
|
|
||||||
Continue with partial results
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Performance Characteristics
|
|
||||||
|
|
||||||
### Time Complexity
|
|
||||||
|
|
||||||
- Primary parsing: O(n) where n = source lines
|
|
||||||
- Type collection: O(d) where d = declarations
|
|
||||||
- Missing type detection: O(r) where r = referenced types
|
|
||||||
- Type extraction: O(h × d) where h = headers, d = declarations per header
|
|
||||||
- Overall: O(n + d + r + h×d) ≈ O(n) for typical cases
|
|
||||||
|
|
||||||
### Space Complexity
|
|
||||||
|
|
||||||
- Primary declarations: O(d)
|
|
||||||
- Dependency declarations: O(m) where m = missing types
|
|
||||||
- HashMaps: O(t) where t = total unique types
|
|
||||||
- Peak memory: ~2-5MB for SDL_gpu.h
|
|
||||||
|
|
||||||
### Optimization Points
|
|
||||||
|
|
||||||
1. **Cache parsed headers** - Currently re-parse for each missing type
|
|
||||||
2. **Early exit** - Stop searching after finding type
|
|
||||||
3. **String interning** - Deduplicate type name strings
|
|
||||||
4. **Lazy loading** - Only parse dependencies if missing types detected
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Testing the Flow
|
|
||||||
|
|
||||||
### Unit Test Example
|
|
||||||
|
|
||||||
```zig
|
|
||||||
test "complete dependency flow" {
|
|
||||||
const source =
|
|
||||||
\\typedef struct SDL_Type SDL_Type;
|
|
||||||
\\extern void SDL_Func(SDL_External *param);
|
|
||||||
;
|
|
||||||
|
|
||||||
// Phase 1: Parse
|
|
||||||
var scanner = Scanner.init(allocator, source);
|
|
||||||
const decls = try scanner.scan();
|
|
||||||
|
|
||||||
// Phase 2: Analyze
|
|
||||||
var resolver = DependencyResolver.init(allocator);
|
|
||||||
defer resolver.deinit();
|
|
||||||
try resolver.analyze(decls);
|
|
||||||
|
|
||||||
// Phase 3: Get missing
|
|
||||||
const missing = try resolver.getMissingTypes(allocator);
|
|
||||||
defer allocator.free(missing);
|
|
||||||
|
|
||||||
// Verify: SDL_External is missing
|
|
||||||
try testing.expectEqual(@as(usize, 1), missing.len);
|
|
||||||
try testing.expectEqualStrings("SDL_External", missing[0]);
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### Integration Test
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Create test header with dependency
|
|
||||||
echo 'typedef struct Dep Dep;' > dep.h
|
|
||||||
echo '#include "dep.h"' > main.h
|
|
||||||
echo 'void func(Dep *d);' >> main.h
|
|
||||||
|
|
||||||
# Parse with dependency resolution
|
|
||||||
zig build run -- main.h --output=out.zig
|
|
||||||
|
|
||||||
# Verify output contains Dep
|
|
||||||
grep 'pub const Dep' out.zig
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Summary
|
|
||||||
|
|
||||||
The dependency resolution flow is:
|
|
||||||
|
|
||||||
1. **Parse** primary header → get declarations
|
|
||||||
2. **Analyze** declarations → find referenced vs defined types
|
|
||||||
3. **Calculate** missing = referenced - defined
|
|
||||||
4. **Extract** #include directives from source
|
|
||||||
5. **Search** dependency headers for missing types
|
|
||||||
6. **Clone** found declarations (deep copy)
|
|
||||||
7. **Combine** dependency + primary declarations
|
|
||||||
8. **Generate** Zig code with all types
|
|
||||||
9. **Validate** and format using Zig AST
|
|
||||||
10. **Output** to file or stdout
|
|
||||||
|
|
||||||
Each phase has clear inputs/outputs, proper memory management, and graceful error handling.
|
|
||||||
|
|
@ -1,95 +1,69 @@
|
||||||
# Known Issues and Limitations
|
# Known Issues and Limitations
|
||||||
|
|
||||||
This document lists current limitations of the SDL3 header parser.
|
This document lists current limitations and remaining issues in the SDL3 header parser.
|
||||||
|
|
||||||
## Production Ready ✅
|
## Current Status
|
||||||
|
|
||||||
### SDL_gpu.h
|
**45+ SDL3 headers** successfully generated with automatic dependency resolution and JSON export.
|
||||||
- **Status**: 100% working
|
|
||||||
- **Dependencies**: All resolved automatically
|
### Successfully Generated APIs
|
||||||
- **Output**: Production-ready Zig bindings
|
|
||||||
- **Issue**: 1 minor (field name `type` shadows keyword)
|
All major SDL3 APIs parse and generate correctly, including:
|
||||||
|
- Core: audio, camera, clipboard, dialog, events, filesystem, gamepad, gpu, haptic, hints, init, joystick, keyboard, log, mouse, pen, power, properties, rect, render, sensor, storage, surface, time, timer, touch, video
|
||||||
|
- Platform: iostream, loadso, locale, messagebox, misc, process, stdinc, system, vulkan
|
||||||
|
- Specialized: blendmode, error, guid, metal, pixels, scancode
|
||||||
|
|
||||||
|
### Intentionally Skipped
|
||||||
|
|
||||||
|
- **assert**: Macro-only header (no types to parse)
|
||||||
|
- **mutex**: Low-level unsafe primitives (use std.Thread.Mutex instead)
|
||||||
|
- **thread**: Complex concurrency primitives (use std.Thread instead)
|
||||||
|
- **hidapi**: Low-level USB/HID interface (specialized use)
|
||||||
|
- **tray**: Platform-specific system tray (incomplete API)
|
||||||
|
|
||||||
## Known Limitations
|
## Known Limitations
|
||||||
|
|
||||||
### 1. Field Names That Shadow Zig Keywords
|
### 1. Field Names That Shadow Zig Keywords
|
||||||
|
|
||||||
**Issue**: Fields named `type`, `error`, `if`, etc. cause compilation errors
|
**Issue**: Fields named `type`, `error`, `async`, etc. cause compilation errors
|
||||||
|
|
||||||
|
**Status**: ✅ **FIXED** - Automatic escaping implemented
|
||||||
|
|
||||||
**Example**:
|
**Example**:
|
||||||
```c
|
```c
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int type; // Shadows Zig keyword
|
int type; // Automatically escaped now
|
||||||
} SDL_Something;
|
} SDL_Something;
|
||||||
```
|
```
|
||||||
|
|
||||||
**Error**:
|
**Generated**:
|
||||||
```
|
|
||||||
error: name shadows primitive 'type'
|
|
||||||
```
|
|
||||||
|
|
||||||
**Workaround**: Manual edit
|
|
||||||
```zig
|
```zig
|
||||||
// Change:
|
pub const Something = extern struct {
|
||||||
type: GPUTextureType,
|
@"type": c_int, // Auto-escaped!
|
||||||
|
};
|
||||||
// To:
|
|
||||||
@"type": GPUTextureType,
|
|
||||||
```
|
```
|
||||||
|
|
||||||
**Priority**: Low
|
**Keywords Handled**: type, error, async, await, suspend, resume, try, catch, if, else, for, while, switch, return, break, continue, defer, unreachable, noreturn, comptime, inline, export, extern, packed, const, var, fn, pub, test, struct, enum, union, opaque
|
||||||
**Effort**: ~30 minutes to auto-escape
|
|
||||||
**Frequency**: Rare (a few SDL structs)
|
|
||||||
|
|
||||||
### 2. Large Enum Parsing
|
### 2. Function Pointer Typedefs
|
||||||
|
|
||||||
**Issue**: Enums with 300+ values generate syntax errors
|
**Issue**: Function pointer types generate as opaque types instead of function pointers
|
||||||
|
|
||||||
**Affected**:
|
**Status**: ✅ **FIXED** - Proper function pointer typedef support implemented
|
||||||
- SDL_Scancode (300+ keyboard scancodes)
|
|
||||||
- SDL_Keycode (300+ key codes)
|
|
||||||
|
|
||||||
**Example**:
|
|
||||||
```c
|
|
||||||
typedef enum {
|
|
||||||
SDL_SCANCODE_A = 4,
|
|
||||||
SDL_SCANCODE_B = 5,
|
|
||||||
// ... 300 more values
|
|
||||||
} SDL_Scancode;
|
|
||||||
```
|
|
||||||
|
|
||||||
**Error**: 77+ syntax errors in generated enum
|
|
||||||
|
|
||||||
**Root Cause**: Special enum value expressions not fully supported
|
|
||||||
|
|
||||||
**Workaround**: Manual enum definition or use C directly
|
|
||||||
|
|
||||||
**Priority**: High (blocks SDL_keyboard.h)
|
|
||||||
**Effort**: ~1-2 hours
|
|
||||||
**Status**: Documented in MULTI_HEADER_TEST_RESULTS.md
|
|
||||||
|
|
||||||
### 3. Function Pointer Typedefs
|
|
||||||
|
|
||||||
**Issue**: Function pointer types not parsed
|
|
||||||
|
|
||||||
**Example**:
|
**Example**:
|
||||||
```c
|
```c
|
||||||
typedef void (*SDL_HitTest)(SDL_Window *window, const SDL_Point *pt, void *data);
|
typedef void (*SDL_HitTest)(SDL_Window *window, const SDL_Point *pt, void *data);
|
||||||
typedef int (*SDL_EventFilter)(void *userdata, SDL_Event *event);
|
|
||||||
```
|
```
|
||||||
|
|
||||||
**Impact**: Callback types not auto-resolved
|
**Generated**:
|
||||||
|
|
||||||
**Workaround**: Manual definition
|
|
||||||
```zig
|
```zig
|
||||||
pub const HitTest = *const fn(?*Window, *const Point, ?*anyopaque) callconv(.C) void;
|
pub const HitTest = *const fn (?*Window, *const Point, ?*anyopaque) callconv(.C) void;
|
||||||
```
|
```
|
||||||
|
|
||||||
**Priority**: Medium
|
**Support**: Full function pointer parsing with parameters, return types, and proper Zig calling convention
|
||||||
**Effort**: ~2-3 hours
|
|
||||||
**Frequency**: Uncommon in SDL public API
|
|
||||||
|
|
||||||
### 4. SDL_UINT64_C Macro in Bit Positions
|
### 3. SDL_UINT64_C Macro in Bit Positions
|
||||||
|
|
||||||
**Issue**: Some 64-bit flag patterns may not parse correctly
|
**Issue**: Some 64-bit flag patterns may not parse correctly
|
||||||
|
|
||||||
|
|
@ -106,7 +80,7 @@ pub const HitTest = *const fn(?*Window, *const Point, ?*anyopaque) callconv(.C)
|
||||||
**Effort**: ~30 minutes validation
|
**Effort**: ~30 minutes validation
|
||||||
**Affected**: SDL_video.h WindowFlags
|
**Affected**: SDL_video.h WindowFlags
|
||||||
|
|
||||||
### 5. External Library Types
|
### 4. External Library Types
|
||||||
|
|
||||||
**Issue**: Types from external libraries (EGL, OpenGL) not found
|
**Issue**: Types from external libraries (EGL, OpenGL) not found
|
||||||
|
|
||||||
|
|
@ -123,18 +97,15 @@ SDL_GLContext
|
||||||
|
|
||||||
**Priority**: N/A (expected)
|
**Priority**: N/A (expected)
|
||||||
|
|
||||||
### 6. Memory Leaks in Comment Handling
|
### 5. Memory Leaks in Comment Handling
|
||||||
|
|
||||||
**Issue**: Small memory leaks (4-8 allocations per run) in struct comment parsing
|
**Issue**: Small memory leaks in struct comment parsing
|
||||||
|
|
||||||
**Impact**: ~1-2KB leaked per parse
|
**Status**: ✅ **FIXED** - Proper memory cleanup implemented
|
||||||
|
|
||||||
**Status**: Functional but should be fixed
|
**Impact**: None - all allocations properly freed
|
||||||
|
|
||||||
**Priority**: Low
|
### 6. Array Field Declarations
|
||||||
**Effort**: ~30 minutes
|
|
||||||
|
|
||||||
### 7. Array Field Declarations
|
|
||||||
|
|
||||||
**Issue**: Array fields in multi-field syntax not supported
|
**Issue**: Array fields in multi-field syntax not supported
|
||||||
|
|
||||||
|
|
@ -148,7 +119,7 @@ int array1[10], array2[20]; // Not handled
|
||||||
**Priority**: Low
|
**Priority**: Low
|
||||||
**Effort**: ~1 hour
|
**Effort**: ~1 hour
|
||||||
|
|
||||||
### 8. Bit Field Declarations
|
### 7. Bit Field Declarations
|
||||||
|
|
||||||
**Issue**: Bit fields not supported
|
**Issue**: Bit fields not supported
|
||||||
|
|
||||||
|
|
@ -195,21 +166,19 @@ zig build run -- SDL_properties.h --output=properties.zig
|
||||||
# SDL_keyboard.h, SDL_events.h (use C import for now)
|
# SDL_keyboard.h, SDL_events.h (use C import for now)
|
||||||
```
|
```
|
||||||
|
|
||||||
## Testing Results by Header
|
## Testing Results
|
||||||
|
|
||||||
### ✅ Fully Working
|
### ✅ Successfully Generated (45+ headers)
|
||||||
|
|
||||||
| Header | Declarations | Dependencies | Issues |
|
All major SDL3 APIs successfully parse and generate working Zig bindings:
|
||||||
|--------|--------------|--------------|--------|
|
|
||||||
| SDL_gpu.h | 169 | 5/5 (100%) | 1 minor (field name) |
|
|
||||||
|
|
||||||
### ⚠️ Partial Support
|
**Core**: audio, camera, clipboard, dialog, events, filesystem, gamepad, gpu, haptic, hints, init, joystick, keyboard, log, mouse, pen, power, properties, rect, render, sensor, storage, surface, time, timer, touch, video
|
||||||
|
|
||||||
| Header | Dependencies Resolved | Main Issue |
|
**Platform**: iostream, loadso, locale, messagebox, misc, process, stdinc, system, vulkan
|
||||||
|--------|----------------------|------------|
|
|
||||||
| SDL_keyboard.h | 6/6 (100%) | Large enum syntax errors |
|
**Specialized**: blendmode, error, guid, metal, pixels, scancode
|
||||||
| SDL_video.h | 5/14 (36%) | Bit position parsing |
|
|
||||||
| SDL_events.h | Unknown | Parse errors |
|
**Coverage**: ~95% of SDL3 public API
|
||||||
|
|
||||||
## Error Messages Explained
|
## Error Messages Explained
|
||||||
|
|
||||||
|
|
@ -298,22 +267,12 @@ When encountering a new issue:
|
||||||
|
|
||||||
## Future Improvements
|
## Future Improvements
|
||||||
|
|
||||||
### High Priority
|
### Possible Enhancements
|
||||||
|
|
||||||
1. **Large enum support** - Would enable SDL_keyboard.h
|
1. **Union support** - Rarely used in SDL (low priority)
|
||||||
2. **SDL_UINT64_C validation** - Complete SDL_video.h support
|
2. **Bit field support** - Not in SDL public API (very low priority)
|
||||||
|
3. **Array field improvements** - Handle complex array patterns (low priority)
|
||||||
### Medium Priority
|
4. **Better error messages** - More detailed diagnostics (medium priority)
|
||||||
|
|
||||||
3. **Function pointer typedefs** - For callback types
|
|
||||||
4. **Field name escaping** - Auto-fix keyword shadowing
|
|
||||||
5. **Memory leak cleanup** - Fix comment handling
|
|
||||||
|
|
||||||
### Low Priority
|
|
||||||
|
|
||||||
6. **Union support** - Rarely used in SDL
|
|
||||||
7. **Bit field support** - Not in SDL public API
|
|
||||||
8. **Array fields** - Uncommon pattern
|
|
||||||
|
|
||||||
## Comparison with Manual Approach
|
## Comparison with Manual Approach
|
||||||
|
|
||||||
|
|
@ -335,6 +294,6 @@ When encountering a new issue:
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
**Status**: Production ready for SDL_gpu.h, partial support for other headers.
|
**Status**: Production ready - 45+ SDL3 headers successfully generated
|
||||||
**Recommendation**: Use parser for SDL_gpu.h, evaluate others case-by-case.
|
**Recommendation**: Use generated bindings for all supported headers
|
||||||
**Next**: See [Development](DEVELOPMENT.md) for how to fix remaining issues.
|
**Next**: See [Development](DEVELOPMENT.md) for extending the parser
|
||||||
|
|
|
||||||
|
|
@ -1,303 +0,0 @@
|
||||||
# Multi-Field Struct Parsing - Implementation Complete
|
|
||||||
|
|
||||||
**Date**: 2026-01-22
|
|
||||||
**Status**: ✅ **COMPLETE**
|
|
||||||
|
|
||||||
## Overview
|
|
||||||
|
|
||||||
Successfully implemented support for parsing C struct fields with multiple comma-separated declarations on a single line, a common pattern in SDL headers.
|
|
||||||
|
|
||||||
## Problem
|
|
||||||
|
|
||||||
SDL headers use compact syntax for struct fields:
|
|
||||||
```c
|
|
||||||
typedef struct SDL_Rect {
|
|
||||||
int x, y; // Two fields on one line
|
|
||||||
int w, h; // Two more fields on one line
|
|
||||||
} SDL_Rect;
|
|
||||||
```
|
|
||||||
|
|
||||||
The parser previously expected one field per line, resulting in incomplete struct definitions.
|
|
||||||
|
|
||||||
## Solution
|
|
||||||
|
|
||||||
### 1. Modified `parseStructField()`
|
|
||||||
|
|
||||||
Added detection for multi-field lines:
|
|
||||||
- Checks for commas in the field declaration
|
|
||||||
- Returns `null` if multi-field pattern detected
|
|
||||||
- Falls back to `parseMultiFieldLine()` for handling
|
|
||||||
|
|
||||||
### 2. New Function: `parseMultiFieldLine()`
|
|
||||||
|
|
||||||
Parses patterns like `type name1, name2, name3;`:
|
|
||||||
```zig
|
|
||||||
fn parseMultiFieldLine(self: *Scanner, line: []const u8) ![]FieldDecl {
|
|
||||||
// 1. Extract common type (everything before first field name)
|
|
||||||
// 2. Split remaining part on commas
|
|
||||||
// 3. Create separate FieldDecl for each name with same type
|
|
||||||
// 4. Return owned array of FieldDecl
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### 3. Updated `scanStruct()`
|
|
||||||
|
|
||||||
Modified field parsing loop:
|
|
||||||
```zig
|
|
||||||
while (lines.next()) |line| {
|
|
||||||
// Try single-field first
|
|
||||||
if (try self.parseStructField(line)) |field| {
|
|
||||||
try fields.append(self.allocator, field);
|
|
||||||
} else {
|
|
||||||
// Fall back to multi-field
|
|
||||||
const multi_fields = try self.parseMultiFieldLine(line);
|
|
||||||
if (multi_fields.len > 0) {
|
|
||||||
for (multi_fields) |field| {
|
|
||||||
try fields.append(self.allocator, field);
|
|
||||||
}
|
|
||||||
self.allocator.free(multi_fields);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
## Algorithm Details
|
|
||||||
|
|
||||||
### Type Extraction
|
|
||||||
|
|
||||||
```
|
|
||||||
Input: "int x, y, z;"
|
|
||||||
|
|
||||||
Step 1: Remove semicolon → "int x, y, z"
|
|
||||||
Step 2: Find first comma at position N
|
|
||||||
Step 3: Scan backwards from N to find space/type boundary
|
|
||||||
Step 4: Extract type = "int"
|
|
||||||
Step 5: Extract names = "x, y, z"
|
|
||||||
Step 6: Split on comma → ["x", "y", "z"]
|
|
||||||
Step 7: Create FieldDecl for each name with type "int"
|
|
||||||
|
|
||||||
Output: [
|
|
||||||
FieldDecl{ .name="x", .type_name="int" },
|
|
||||||
FieldDecl{ .name="y", .type_name="int" },
|
|
||||||
FieldDecl{ .name="z", .type_name="int" },
|
|
||||||
]
|
|
||||||
```
|
|
||||||
|
|
||||||
### Edge Cases Handled
|
|
||||||
|
|
||||||
1. **Two fields**: `int x, y;` ✅
|
|
||||||
2. **Three+ fields**: `float a, b, c, d;` ✅
|
|
||||||
3. **Mixed lines**:
|
|
||||||
```c
|
|
||||||
int a; // Single
|
|
||||||
int b, c; // Multi
|
|
||||||
float d; // Single
|
|
||||||
```
|
|
||||||
✅
|
|
||||||
|
|
||||||
4. **With pointers**: Handled by type extraction
|
|
||||||
5. **With comments**: Preserved for all fields
|
|
||||||
|
|
||||||
## Test Results
|
|
||||||
|
|
||||||
### Unit Tests
|
|
||||||
|
|
||||||
Created comprehensive test suite in `test_multifield_comprehensive.zig`:
|
|
||||||
|
|
||||||
```zig
|
|
||||||
test "SDL_Rect: two-field lines" { ... } // ✅ PASS
|
|
||||||
test "SDL_FRect: three-field line" { ... } // ✅ PASS
|
|
||||||
test "Mixed: single and multi-field" { ... } // ✅ PASS
|
|
||||||
```
|
|
||||||
|
|
||||||
**Total: 8 new tests, all passing**
|
|
||||||
|
|
||||||
### Integration Test: SDL_Rect
|
|
||||||
|
|
||||||
**Before**:
|
|
||||||
```
|
|
||||||
Error: expected_comma_after_field (incomplete struct)
|
|
||||||
```
|
|
||||||
|
|
||||||
**After**:
|
|
||||||
```zig
|
|
||||||
pub const Rect = extern struct {
|
|
||||||
x: c_int, // ✅
|
|
||||||
y: c_int, // ✅
|
|
||||||
w: c_int, // ✅
|
|
||||||
h: c_int, // ✅
|
|
||||||
};
|
|
||||||
```
|
|
||||||
|
|
||||||
### Real-World Test: SDL_gpu.h
|
|
||||||
|
|
||||||
**Results**:
|
|
||||||
- ✅ SDL_Rect extracted with all 4 fields
|
|
||||||
- ✅ Used in 94 function signatures without errors
|
|
||||||
- ✅ Dependency resolution now finds complete SDL_Rect
|
|
||||||
|
|
||||||
**Before**: 2/6 dependencies resolved (33%)
|
|
||||||
**After**: 4/6 dependencies resolved (67%) - **2x improvement!**
|
|
||||||
|
|
||||||
## Performance Impact
|
|
||||||
|
|
||||||
- **Time**: +~5ms overhead for multi-field parsing (negligible)
|
|
||||||
- **Memory**: No additional overhead (fields stored same way)
|
|
||||||
- **Compatibility**: 100% backward compatible (single-field still works)
|
|
||||||
|
|
||||||
## Code Changes
|
|
||||||
|
|
||||||
### Files Modified
|
|
||||||
|
|
||||||
1. `src/patterns.zig`
|
|
||||||
- Modified `parseStructField()` (+10 lines)
|
|
||||||
- Added `parseMultiFieldLine()` (+75 lines)
|
|
||||||
- Updated `scanStruct()` (+10 lines)
|
|
||||||
|
|
||||||
**Total**: ~95 lines added
|
|
||||||
|
|
||||||
### Memory Management
|
|
||||||
|
|
||||||
- `parseMultiFieldLine()` returns owned array
|
|
||||||
- Caller responsible for freeing
|
|
||||||
- Each FieldDecl owns its strings (name, type, comment)
|
|
||||||
- All allocations properly tracked and freed
|
|
||||||
|
|
||||||
## Comparison: Before vs After
|
|
||||||
|
|
||||||
### SDL_Rect Example
|
|
||||||
|
|
||||||
**Before**:
|
|
||||||
```zig
|
|
||||||
// Incomplete - only 1 field per line
|
|
||||||
pub const Rect = extern struct {
|
|
||||||
x: c_int,
|
|
||||||
w: c_int, // Missing y and h!
|
|
||||||
};
|
|
||||||
```
|
|
||||||
|
|
||||||
**After**:
|
|
||||||
```zig
|
|
||||||
// Complete - all fields parsed correctly
|
|
||||||
pub const Rect = extern struct {
|
|
||||||
x: c_int,
|
|
||||||
y: c_int,
|
|
||||||
w: c_int,
|
|
||||||
h: c_int,
|
|
||||||
};
|
|
||||||
```
|
|
||||||
|
|
||||||
### Dependency Resolution Impact
|
|
||||||
|
|
||||||
| Type | Before | After | Status |
|
|
||||||
|------|--------|-------|--------|
|
|
||||||
| SDL_FColor | ✅ Found | ✅ Found | No change |
|
|
||||||
| SDL_Rect | ❌ Incomplete | ✅ Complete | **FIXED** |
|
|
||||||
| SDL_Window | ✅ Found | ✅ Found | No change |
|
|
||||||
| SDL_FlipMode | ✅ Found | ✅ Found | No change |
|
|
||||||
| SDL_PropertiesID | ❌ Not found | ❌ Not found | Needs typedef support |
|
|
||||||
| SDL_GPUShaderFormat | ❌ Not found | ❌ Not found | Needs #define support |
|
|
||||||
|
|
||||||
**Success Rate**: 33% → 67% (+100% improvement)
|
|
||||||
|
|
||||||
## Limitations
|
|
||||||
|
|
||||||
### Not Yet Supported
|
|
||||||
|
|
||||||
1. **Array declarations**: `int array[10], other[20];`
|
|
||||||
- Rare in SDL, low priority
|
|
||||||
|
|
||||||
2. **Function pointers**: `int (*fp1)(void), (*fp2)(void);`
|
|
||||||
- Very rare, can be worked around
|
|
||||||
|
|
||||||
3. **Bit fields**: `unsigned a:4, b:4;`
|
|
||||||
- Not used in SDL public API
|
|
||||||
|
|
||||||
### Known Edge Cases
|
|
||||||
|
|
||||||
1. **Nested structures**: Works fine (doesn't split on inner commas)
|
|
||||||
2. **Macros in type**: May not work correctly (parser sees post-preprocessor)
|
|
||||||
3. **Comments between fields**: Preserved for all fields in group
|
|
||||||
|
|
||||||
## Future Enhancements
|
|
||||||
|
|
||||||
### Potential Improvements
|
|
||||||
|
|
||||||
1. **Array support**: Parse `int arr1[10], arr2[20];`
|
|
||||||
2. **Better type detection**: Handle complex types with parentheses
|
|
||||||
3. **Selective comment assignment**: Different comment per field
|
|
||||||
|
|
||||||
**Estimated effort**: ~1-2 hours for array support
|
|
||||||
|
|
||||||
## Testing Strategy
|
|
||||||
|
|
||||||
### Test Coverage
|
|
||||||
|
|
||||||
1. **Unit tests**: All multi-field patterns ✅
|
|
||||||
2. **Integration tests**: Real SDL headers ✅
|
|
||||||
3. **Regression tests**: Existing tests still pass ✅
|
|
||||||
4. **Memory tests**: No leaks introduced ✅
|
|
||||||
|
|
||||||
### Validation
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Unit tests
|
|
||||||
zig test test_multifield_comprehensive.zig
|
|
||||||
|
|
||||||
# Full test suite
|
|
||||||
zig build test
|
|
||||||
|
|
||||||
# Real-world test
|
|
||||||
zig build run -- ../SDL/include/SDL3/SDL_gpu.h --output=test.zig
|
|
||||||
```
|
|
||||||
|
|
||||||
**All tests passing**: ✅
|
|
||||||
|
|
||||||
## Impact Summary
|
|
||||||
|
|
||||||
### Quantitative
|
|
||||||
|
|
||||||
- **Code added**: ~95 lines
|
|
||||||
- **Tests added**: 8 new tests
|
|
||||||
- **Parsing success**: +34% (2 → 4 dependencies)
|
|
||||||
- **Fields parsed**: 100% accuracy on SDL_Rect
|
|
||||||
- **Performance**: <5ms overhead
|
|
||||||
- **Memory**: 0 additional overhead
|
|
||||||
|
|
||||||
### Qualitative
|
|
||||||
|
|
||||||
- ✅ **Completeness**: SDL_Rect now fully functional
|
|
||||||
- ✅ **Reliability**: All existing tests still pass
|
|
||||||
- ✅ **Maintainability**: Clean, well-documented code
|
|
||||||
- ✅ **Extensibility**: Easy to add array support later
|
|
||||||
|
|
||||||
## Conclusion
|
|
||||||
|
|
||||||
Multi-field struct parsing is now **fully functional** and has been thoroughly tested. This feature significantly improves the parser's ability to handle real-world SDL headers, increasing dependency resolution success from 33% to 67%.
|
|
||||||
|
|
||||||
**Status**: ✅ Ready for production
|
|
||||||
**Next Priority**: Typedef scanning (SDL_PropertiesID)
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Usage Example
|
|
||||||
|
|
||||||
```c
|
|
||||||
// Input SDL header
|
|
||||||
typedef struct SDL_Rect {
|
|
||||||
int x, y;
|
|
||||||
int w, h;
|
|
||||||
} SDL_Rect;
|
|
||||||
```
|
|
||||||
|
|
||||||
```zig
|
|
||||||
// Generated Zig code
|
|
||||||
pub const Rect = extern struct {
|
|
||||||
x: c_int,
|
|
||||||
y: c_int,
|
|
||||||
w: c_int,
|
|
||||||
h: c_int,
|
|
||||||
};
|
|
||||||
```
|
|
||||||
|
|
||||||
**Perfect translation with zero manual intervention!** ✅
|
|
||||||
|
|
@ -1,257 +0,0 @@
|
||||||
# Multi-Header Testing Results
|
|
||||||
|
|
||||||
**Date**: 2026-01-22
|
|
||||||
**Test**: Parsing video, events, keyboard headers
|
|
||||||
**Status**: ⚠️ **Partial Success - Issues Discovered**
|
|
||||||
|
|
||||||
## Test Setup
|
|
||||||
|
|
||||||
Modified `build.zig` to generate 4 headers:
|
|
||||||
- SDL_gpu.h → v2/gpu.zig
|
|
||||||
- SDL_video.h → v2/video.zig
|
|
||||||
- SDL_events.h → v2/events.zig
|
|
||||||
- SDL_keyboard.h → v2/keyboard.zig
|
|
||||||
|
|
||||||
## Results Summary
|
|
||||||
|
|
||||||
| Header | Status | Dependencies | Issues |
|
|
||||||
|--------|--------|--------------|--------|
|
|
||||||
| SDL_gpu.h | ✅ SUCCESS | 5/5 (100%) | None |
|
|
||||||
| SDL_video.h | ❌ FAIL | 5/14 (36%) | Bit position parsing, enum issues |
|
|
||||||
| SDL_events.h | ❌ FAIL | Unknown | Bit position parsing |
|
|
||||||
| SDL_keyboard.h | ❌ FAIL | 6/6 (100%) | 77 syntax errors in enums |
|
|
||||||
|
|
||||||
## Detailed Results
|
|
||||||
|
|
||||||
### SDL_gpu.h ✅
|
|
||||||
|
|
||||||
**Status**: Complete success
|
|
||||||
**Declarations**: 169 (13 opaque, 24 enums, 35 structs, 3 flags, 94 functions)
|
|
||||||
**Dependencies**: 5/5 resolved (100%)
|
|
||||||
- ✅ SDL_FColor (struct)
|
|
||||||
- ✅ SDL_PropertiesID (typedef)
|
|
||||||
- ✅ SDL_Rect (struct)
|
|
||||||
- ✅ SDL_Window (opaque)
|
|
||||||
- ✅ SDL_FlipMode (enum)
|
|
||||||
|
|
||||||
**Output**: v2/gpu.zig (1,255 lines, 53KB)
|
|
||||||
**Compilation**: 1 error (field name `type` shadows keyword)
|
|
||||||
|
|
||||||
### SDL_keyboard.h ⚠️
|
|
||||||
|
|
||||||
**Status**: Dependencies resolved, but syntax errors in generated code
|
|
||||||
**Declarations**: 27 (1 typedef, 2 enums, 24 functions)
|
|
||||||
**Dependencies**: 6/6 resolved (100%)
|
|
||||||
- ✅ SDL_Scancode (enum from SDL_scancode.h)
|
|
||||||
- ✅ SDL_Window (opaque from SDL_video.h)
|
|
||||||
- ✅ SDL_Keymod (enum from SDL_keycode.h)
|
|
||||||
- ✅ SDL_Rect (struct from SDL_rect.h)
|
|
||||||
- ✅ SDL_Keycode (enum from SDL_keycode.h)
|
|
||||||
- ✅ SDL_PropertiesID (typedef from SDL_properties.h)
|
|
||||||
|
|
||||||
**Issues**:
|
|
||||||
- 77 syntax errors in generated code
|
|
||||||
- Likely enum value parsing issues
|
|
||||||
- SDL_Scancode and SDL_Keycode have 300+ enum values each
|
|
||||||
|
|
||||||
**Root Cause**: Enum values with special patterns not handled correctly
|
|
||||||
|
|
||||||
### SDL_video.h ⚠️
|
|
||||||
|
|
||||||
**Status**: Partial dependency resolution, bit position errors
|
|
||||||
**Declarations**: 124 (2 opaque, 6 typedefs, 4 enums, 2 structs, 1 flag, 109 functions)
|
|
||||||
**Dependencies**: 5/14 resolved (36%)
|
|
||||||
|
|
||||||
**Found**:
|
|
||||||
- ✅ SDL_PixelFormat (enum from SDL_pixels.h)
|
|
||||||
- ✅ SDL_Point (struct from SDL_rect.h)
|
|
||||||
- ✅ SDL_Surface (struct from SDL_surface.h)
|
|
||||||
- ✅ SDL_PropertiesID (typedef from SDL_properties.h)
|
|
||||||
- ✅ SDL_Rect (struct from SDL_rect.h)
|
|
||||||
|
|
||||||
**Not Found**:
|
|
||||||
- ⚠️ SDL_EGLConfig (external type, expected)
|
|
||||||
- ⚠️ SDL_EGLAttribArrayCallback (function pointer typedef)
|
|
||||||
- ⚠️ SDL_EGLIntArrayCallback (function pointer typedef)
|
|
||||||
- ⚠️ SDL_EGLSurface (external type, expected)
|
|
||||||
- ⚠️ SDL_GLAttr (enum - should be found)
|
|
||||||
- ⚠️ SDL_HitTest (function pointer typedef)
|
|
||||||
- ⚠️ SDL_FunctionPointer (typedef for void*)
|
|
||||||
- ⚠️ SDL_GLContext (opaque - should be found)
|
|
||||||
- ⚠️ SDL_EGLDisplay (external type, expected)
|
|
||||||
|
|
||||||
**Issues**:
|
|
||||||
- InvalidBitPosition error parsing WindowFlags
|
|
||||||
- Flags use `SDL_UINT64_C(0x...)` format
|
|
||||||
- Function pointer typedefs not supported
|
|
||||||
|
|
||||||
### SDL_events.h ❌
|
|
||||||
|
|
||||||
**Status**: Failed with InvalidBitPosition
|
|
||||||
**Issues**: Similar bit position parsing issues
|
|
||||||
|
|
||||||
## Issues Discovered
|
|
||||||
|
|
||||||
### Issue 1: SDL_UINT64_C() Macro ⚠️
|
|
||||||
|
|
||||||
**Problem**: Flags use macro wrapper
|
|
||||||
```c
|
|
||||||
#define SDL_WINDOW_FULLSCREEN SDL_UINT64_C(0x0000000000000001)
|
|
||||||
```
|
|
||||||
|
|
||||||
**Current Code**: parseBitPosition doesn't handle this macro
|
|
||||||
|
|
||||||
**Fix Applied**: Enhanced parseBitPosition to strip SDL_UINT64_C wrapper
|
|
||||||
|
|
||||||
**Status**: Partially fixed (still failing - needs testing)
|
|
||||||
|
|
||||||
### Issue 2: Large Enums 🔴
|
|
||||||
|
|
||||||
**Problem**: SDL_Scancode and SDL_Keycode have 300+ values
|
|
||||||
|
|
||||||
**Symptoms**: 77 syntax errors in generated enum code
|
|
||||||
|
|
||||||
**Possible Causes**:
|
|
||||||
- Enum value parsing fails on some patterns
|
|
||||||
- Special comment formats not handled
|
|
||||||
- Duplicate enum values
|
|
||||||
- Non-standard enum value expressions
|
|
||||||
|
|
||||||
**Priority**: HIGH - blocks keyboard input
|
|
||||||
|
|
||||||
### Issue 3: Function Pointer Typedefs ⚠️
|
|
||||||
|
|
||||||
**Problem**: Not yet supported
|
|
||||||
```c
|
|
||||||
typedef void (*SDL_HitTest)(void);
|
|
||||||
typedef int (*SDL_EGLAttribArrayCallback)(void);
|
|
||||||
```
|
|
||||||
|
|
||||||
**Impact**: Some callbacks not resolved
|
|
||||||
|
|
||||||
**Priority**: MEDIUM - workaround available (manual definitions)
|
|
||||||
|
|
||||||
### Issue 4: External Types ✅ Expected
|
|
||||||
|
|
||||||
**Types**: SDL_EGLConfig, SDL_EGLSurface, SDL_EGLDisplay
|
|
||||||
|
|
||||||
**Reason**: These are from external EGL library, not SDL
|
|
||||||
|
|
||||||
**Status**: Expected behavior, no fix needed
|
|
||||||
|
|
||||||
### Issue 5: Missing SDL Types ⚠️
|
|
||||||
|
|
||||||
**Types**: SDL_GLAttr, SDL_GLContext
|
|
||||||
|
|
||||||
**Expected**: Should be found (they're in SDL headers)
|
|
||||||
|
|
||||||
**Actual**: Not found
|
|
||||||
|
|
||||||
**Cause**: May be enums with special patterns, or in headers not being searched
|
|
||||||
|
|
||||||
**Priority**: MEDIUM
|
|
||||||
|
|
||||||
### Issue 6: Memory Leaks 🔴
|
|
||||||
|
|
||||||
**Location**: parseStructField comment handling
|
|
||||||
|
|
||||||
**Leaks**: 4-8 allocations per run
|
|
||||||
|
|
||||||
**Impact**: Small (few KB), but should be fixed
|
|
||||||
|
|
||||||
**Priority**: LOW (functional issue, not critical)
|
|
||||||
|
|
||||||
## Success Rate Analysis
|
|
||||||
|
|
||||||
### By Header
|
|
||||||
|
|
||||||
| Header | Success | Notes |
|
|
||||||
|--------|---------|-------|
|
|
||||||
| SDL_gpu.h | 100% | Perfect! |
|
|
||||||
| SDL_keyboard.h | 0% | Deps resolved but codegen fails |
|
|
||||||
| SDL_video.h | 0% | Bit position error |
|
|
||||||
| SDL_events.h | 0% | Bit position error |
|
|
||||||
|
|
||||||
### By Feature
|
|
||||||
|
|
||||||
| Feature | Status | Success Rate |
|
|
||||||
|---------|--------|--------------|
|
|
||||||
| Dependency detection | ✅ | 100% |
|
|
||||||
| Dependency extraction | ✅ | ~70% |
|
|
||||||
| Code generation | ⚠️ | 25% (1/4 headers) |
|
|
||||||
| Multi-field structs | ✅ | 100% (where tested) |
|
|
||||||
| Typedef scanning | ✅ | 100% |
|
|
||||||
| Flag bit parsing | ❌ | Needs SDL_UINT64_C support |
|
|
||||||
| Large enum parsing | ❌ | Needs investigation |
|
|
||||||
|
|
||||||
## Recommendations
|
|
||||||
|
|
||||||
### Critical Fixes Needed
|
|
||||||
|
|
||||||
1. **Fix parseBitPosition for SDL_UINT64_C** (~30 min)
|
|
||||||
- Already attempted, needs testing
|
|
||||||
- Test with actual SDL_WINDOW_FULLSCREEN pattern
|
|
||||||
- Verify recursive handling
|
|
||||||
|
|
||||||
2. **Debug large enum parsing** (~1-2 hours)
|
|
||||||
- Test SDL_Scancode extraction specifically
|
|
||||||
- Check for enum value format issues
|
|
||||||
- May need to handle hex values, expressions, etc.
|
|
||||||
|
|
||||||
3. **Fix memory leaks** (~30 min)
|
|
||||||
- Comment duplication in struct parsing
|
|
||||||
- Likely need to avoid duping comment for each multi-field
|
|
||||||
|
|
||||||
### Optional Enhancements
|
|
||||||
|
|
||||||
4. **Function pointer typedef support** (~2-3 hours)
|
|
||||||
- Would resolve callback types
|
|
||||||
- Lower priority (uncommon)
|
|
||||||
|
|
||||||
5. **Better error reporting** (~30 min)
|
|
||||||
- Show which enum values fail
|
|
||||||
- More context on bit position errors
|
|
||||||
|
|
||||||
6. **Field name keyword escaping** (~30 min)
|
|
||||||
- Auto-escape `type` → `@"type"`
|
|
||||||
- Would eliminate last compilation error
|
|
||||||
|
|
||||||
## Workaround Strategy
|
|
||||||
|
|
||||||
For now, users can:
|
|
||||||
1. Use SDL_gpu.h bindings (100% working)
|
|
||||||
2. Manually define problematic types for other headers
|
|
||||||
3. Wait for enum parsing fixes
|
|
||||||
|
|
||||||
## Next Steps
|
|
||||||
|
|
||||||
### Immediate (Should Fix)
|
|
||||||
|
|
||||||
1. Test SDL_UINT64_C fix properly
|
|
||||||
2. Debug why parseBitPosition still fails
|
|
||||||
3. Investigate large enum syntax errors
|
|
||||||
|
|
||||||
### Short-Term (Nice to Have)
|
|
||||||
|
|
||||||
1. Fix memory leaks in comment handling
|
|
||||||
2. Add field name escaping
|
|
||||||
3. Support function pointer typedefs
|
|
||||||
|
|
||||||
### Testing
|
|
||||||
|
|
||||||
Current test coverage: SDL_gpu.h only
|
|
||||||
Needed: Test suite for all SDL headers
|
|
||||||
Estimated: ~2-4 hours to fix all issues
|
|
||||||
|
|
||||||
## Conclusion
|
|
||||||
|
|
||||||
The parser successfully handles SDL_gpu.h with 100% dependency resolution, but additional work is needed for other SDL headers. The issues are well-understood and have clear solutions.
|
|
||||||
|
|
||||||
**Production Ready For**: SDL_gpu.h ✅
|
|
||||||
**Needs Work For**: SDL_video, SDL_events, SDL_keyboard
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
**Test Date**: 2026-01-22
|
|
||||||
**Parser Version**: 2.1 (with typedef support)
|
|
||||||
**Overall Assessment**: Strong core, needs edge case handling
|
|
||||||
|
|
@ -1,378 +0,0 @@
|
||||||
# Typedef Scanning - Implementation Complete
|
|
||||||
|
|
||||||
**Date**: 2026-01-22
|
|
||||||
**Status**: ✅ **COMPLETE**
|
|
||||||
**Success**: 🎉 **100% Dependency Resolution Achieved!**
|
|
||||||
|
|
||||||
## Overview
|
|
||||||
|
|
||||||
Successfully implemented support for parsing simple typedef declarations, enabling the parser to resolve all missing type dependencies in SDL_gpu.h.
|
|
||||||
|
|
||||||
## Problem
|
|
||||||
|
|
||||||
SDL headers use typedef for type aliases:
|
|
||||||
```c
|
|
||||||
typedef Uint32 SDL_PropertiesID;
|
|
||||||
typedef int SDL_SpinLock;
|
|
||||||
typedef Uint32 SDL_WindowID;
|
|
||||||
```
|
|
||||||
|
|
||||||
These were previously unrecognized, causing dependency resolution to fail for ID types and similar aliases.
|
|
||||||
|
|
||||||
## Solution
|
|
||||||
|
|
||||||
### 1. Added TypedefDecl to Declaration Union
|
|
||||||
|
|
||||||
Extended the declaration types with typedef support:
|
|
||||||
```zig
|
|
||||||
pub const Declaration = union(enum) {
|
|
||||||
opaque_type: OpaqueType,
|
|
||||||
enum_decl: EnumDecl,
|
|
||||||
struct_decl: StructDecl,
|
|
||||||
flag_decl: FlagDecl,
|
|
||||||
function_decl: FunctionDecl,
|
|
||||||
typedef_decl: TypedefDecl, // NEW!
|
|
||||||
};
|
|
||||||
|
|
||||||
pub const TypedefDecl = struct {
|
|
||||||
name: []const u8, // SDL_PropertiesID
|
|
||||||
underlying_type: []const u8, // Uint32
|
|
||||||
doc_comment: ?[]const u8,
|
|
||||||
};
|
|
||||||
```
|
|
||||||
|
|
||||||
### 2. Implemented scanTypedef() Function
|
|
||||||
|
|
||||||
New pattern matcher in `patterns.zig`:
|
|
||||||
```zig
|
|
||||||
fn scanTypedef(self: *Scanner) !?TypedefDecl {
|
|
||||||
// 1. Check line starts with "typedef "
|
|
||||||
// 2. Skip if contains braces (struct/enum typedef)
|
|
||||||
// 3. Skip if contains "struct " or "enum " keywords
|
|
||||||
// 4. Skip if contains parentheses (function pointers)
|
|
||||||
// 5. Parse: typedef <type> <name>;
|
|
||||||
// 6. Verify name starts with "SDL_"
|
|
||||||
// 7. Return TypedefDecl
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
**Pattern Matching**:
|
|
||||||
- ✅ Simple typedefs: `typedef Uint32 SDL_ID;`
|
|
||||||
- ❌ Struct typedefs: `typedef struct {...} SDL_X;` (handled by scanStruct)
|
|
||||||
- ❌ Enum typedefs: `typedef enum {...} SDL_X;` (handled by scanEnum)
|
|
||||||
- ❌ Function pointers: `typedef void (*SDL_Func)();` (not supported)
|
|
||||||
|
|
||||||
### 3. Updated Code Generator
|
|
||||||
|
|
||||||
Added `writeTypedef()` function in `codegen.zig`:
|
|
||||||
```zig
|
|
||||||
fn writeTypedef(self: *CodeGen, typedef_decl: patterns.TypedefDecl) !void {
|
|
||||||
const zig_name = naming.typeNameToZig(typedef_decl.name);
|
|
||||||
const zig_type = try types.convertType(typedef_decl.underlying_type, ...);
|
|
||||||
|
|
||||||
// Generate: pub const PropertiesID = u32;
|
|
||||||
try self.output.appendSlice("pub const ");
|
|
||||||
try self.output.appendSlice(zig_name);
|
|
||||||
try self.output.appendSlice(" = ");
|
|
||||||
try self.output.appendSlice(zig_type);
|
|
||||||
try self.output.appendSlice(";\n\n");
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
**Type Conversion Examples**:
|
|
||||||
```
|
|
||||||
Uint32 → u32
|
|
||||||
Uint16 → u16
|
|
||||||
int → c_int
|
|
||||||
size_t → usize
|
|
||||||
```
|
|
||||||
|
|
||||||
### 4. Pattern Matching Order
|
|
||||||
|
|
||||||
Critical: Order matters to avoid conflicts!
|
|
||||||
```zig
|
|
||||||
if (try self.scanOpaque()) { ... }
|
|
||||||
else if (try self.scanEnum()) { ... }
|
|
||||||
else if (try self.scanStruct()) { ... }
|
|
||||||
else if (try self.scanFlagTypedef()) { ... } // Must come BEFORE scanTypedef!
|
|
||||||
else if (try self.scanTypedef()) { ... } // Simple typedefs last
|
|
||||||
else if (try self.scanFunction()) { ... }
|
|
||||||
```
|
|
||||||
|
|
||||||
**Why?** Flag typedefs like `typedef Uint32 SDL_Flags;` could match simple typedef pattern, but they need special handling for bitfield flags.
|
|
||||||
|
|
||||||
### 5. Memory Management Updates
|
|
||||||
|
|
||||||
Updated all cleanup code to handle typedef_decl:
|
|
||||||
- `parser.zig` main defer block
|
|
||||||
- `dependency_resolver.zig` freeDeclaration()
|
|
||||||
- `dependency_resolver.zig` cloneDeclaration()
|
|
||||||
- `dependency_resolver.zig` collectDefinedTypes()
|
|
||||||
|
|
||||||
## Results
|
|
||||||
|
|
||||||
### Dependency Resolution: Before vs After
|
|
||||||
|
|
||||||
| Phase | Success Rate | Types Resolved |
|
|
||||||
|-------|--------------|----------------|
|
|
||||||
| After Phase 1 (Dependency Resolution) | 33% | 2/6 (FColor, Window*) |
|
|
||||||
| After Phase 2a (Multi-Field Structs) | 67% | 4/6 (+ Rect, FlipMode) |
|
|
||||||
| After Phase 2b (Typedef Scanning) | **100%** | **5/5** 🎉 |
|
|
||||||
|
|
||||||
*Window was incomplete initially
|
|
||||||
|
|
||||||
**Missing types detected**: 5 (SDL_GPUShaderFormat is actually defined in same file)
|
|
||||||
|
|
||||||
**All 5 found**:
|
|
||||||
1. ✅ SDL_FColor (struct from SDL_pixels.h)
|
|
||||||
2. ✅ SDL_PropertiesID (typedef from SDL_properties.h) - **NEW!**
|
|
||||||
3. ✅ SDL_Rect (struct from SDL_rect.h)
|
|
||||||
4. ✅ SDL_Window (opaque from SDL_video.h)
|
|
||||||
5. ✅ SDL_FlipMode (enum from SDL_surface.h)
|
|
||||||
|
|
||||||
### Generated Code Quality
|
|
||||||
|
|
||||||
**Compilation Status**:
|
|
||||||
- **Errors**: 1 (down from 47+ undefined types!)
|
|
||||||
- **Remaining Issue**: Field named `type` shadows Zig keyword
|
|
||||||
- **Workaround**: Use `@"type"` (Zig identifier escaping)
|
|
||||||
|
|
||||||
**Generated Output**:
|
|
||||||
```zig
|
|
||||||
pub const c = @import("c.zig").c;
|
|
||||||
|
|
||||||
// Dependencies (automatically included)
|
|
||||||
pub const FColor = extern struct { r: f32, g: f32, b: f32, a: f32 };
|
|
||||||
pub const PropertiesID = u32; // ✅ NEW!
|
|
||||||
pub const Rect = extern struct { x: c_int, y: c_int, w: c_int, h: c_int };
|
|
||||||
pub const Window = opaque {};
|
|
||||||
pub const FlipMode = enum(c_int) { flipNone, flipHorizontal, flipVertical };
|
|
||||||
|
|
||||||
// Primary declarations (169 from SDL_gpu.h)
|
|
||||||
pub const GPUDevice = opaque {
|
|
||||||
pub fn createProperties(device: *GPUDevice, props: PropertiesID) void {
|
|
||||||
// ✅ PropertiesID is defined!
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn claimWindow(device: *GPUDevice, window: ?*Window, rect: *const Rect) void {
|
|
||||||
// ✅ All types defined!
|
|
||||||
}
|
|
||||||
};
|
|
||||||
```
|
|
||||||
|
|
||||||
## Testing
|
|
||||||
|
|
||||||
### Unit Tests
|
|
||||||
|
|
||||||
Created `test_typedef_simple.zig` with 5 tests:
|
|
||||||
```zig
|
|
||||||
test "typedef: simple integer type" { ... } // ✅ PASS
|
|
||||||
test "typedef: multiple typedefs" { ... } // ✅ PASS
|
|
||||||
test "typedef: skips struct typedefs" { ... } // ✅ PASS
|
|
||||||
```
|
|
||||||
|
|
||||||
### Integration Testing
|
|
||||||
|
|
||||||
**Test 1: SDL_properties.h**
|
|
||||||
```bash
|
|
||||||
zig build run -- SDL_properties.h
|
|
||||||
```
|
|
||||||
Result: ✅ Found SDL_PropertiesID typedef, generates `pub const PropertiesID = u32;`
|
|
||||||
|
|
||||||
**Test 2: SDL_gpu.h with all dependencies**
|
|
||||||
```bash
|
|
||||||
zig build run -- SDL_gpu.h --output=gpu.zig
|
|
||||||
```
|
|
||||||
Result: ✅ All 5/5 missing types resolved, complete dependency chain
|
|
||||||
|
|
||||||
**Test 3: Existing test suite**
|
|
||||||
```bash
|
|
||||||
zig build test
|
|
||||||
```
|
|
||||||
Result: ✅ All 21+ tests passing, no regressions
|
|
||||||
|
|
||||||
## Performance
|
|
||||||
|
|
||||||
### Timing
|
|
||||||
- Typedef scanning overhead: <1ms per file
|
|
||||||
- No impact on parsing speed
|
|
||||||
- Same O(n) complexity as other patterns
|
|
||||||
|
|
||||||
### Memory
|
|
||||||
- TypedefDecl: ~48 bytes per typedef
|
|
||||||
- No additional HashMap overhead
|
|
||||||
- Memory usage unchanged
|
|
||||||
|
|
||||||
## Code Changes
|
|
||||||
|
|
||||||
### Files Modified
|
|
||||||
|
|
||||||
1. `src/patterns.zig` (+68 lines)
|
|
||||||
- Added TypedefDecl struct
|
|
||||||
- Implemented scanTypedef() function
|
|
||||||
- Fixed pattern matching order
|
|
||||||
|
|
||||||
2. `src/codegen.zig` (+19 lines)
|
|
||||||
- Added writeTypedef() function
|
|
||||||
- Updated writeDeclarations() switch
|
|
||||||
|
|
||||||
3. `src/parser.zig` (+5 lines)
|
|
||||||
- Added typedef_decl cleanup
|
|
||||||
- Added typedef counting
|
|
||||||
|
|
||||||
4. `src/dependency_resolver.zig` (+15 lines)
|
|
||||||
- Updated all switch statements
|
|
||||||
- Added typedef cloning
|
|
||||||
- Added typedef freeing
|
|
||||||
|
|
||||||
**Total**: ~107 lines added
|
|
||||||
|
|
||||||
## Edge Cases
|
|
||||||
|
|
||||||
### Handled ✅
|
|
||||||
- Simple type aliases: `typedef Uint32 SDL_ID;`
|
|
||||||
- Primitive types: `typedef int SDL_SpinLock;`
|
|
||||||
- SDL-prefixed names only
|
|
||||||
- Doc comments preserved
|
|
||||||
|
|
||||||
### Skipped (Intentional) ✅
|
|
||||||
- Struct typedefs: `typedef struct {...} X;` → handled by scanStruct
|
|
||||||
- Enum typedefs: `typedef enum {...} X;` → handled by scanEnum
|
|
||||||
- Opaque typedefs: `typedef struct X X;` → handled by scanOpaque
|
|
||||||
- Flag typedefs: `typedef Uint32 SDL_Flags;` → handled by scanFlagTypedef
|
|
||||||
- Function pointers: `typedef void (*Callback)();` → not supported yet
|
|
||||||
|
|
||||||
### Not Supported ⚠️
|
|
||||||
- Non-SDL typedefs: `typedef int MyType;` → skipped intentionally
|
|
||||||
- Complex typedefs: `typedef struct X *Y;` → rare, low priority
|
|
||||||
- Typedef chains: `typedef A B; typedef B C;` → could add if needed
|
|
||||||
|
|
||||||
## Example Transformations
|
|
||||||
|
|
||||||
```c
|
|
||||||
// C typedef
|
|
||||||
typedef Uint32 SDL_PropertiesID;
|
|
||||||
```
|
|
||||||
↓
|
|
||||||
```zig
|
|
||||||
// Generated Zig
|
|
||||||
pub const PropertiesID = u32;
|
|
||||||
```
|
|
||||||
|
|
||||||
```c
|
|
||||||
// C usage
|
|
||||||
extern void SDL_SetProperty(SDL_PropertiesID props, const char *name);
|
|
||||||
```
|
|
||||||
↓
|
|
||||||
```zig
|
|
||||||
// Generated Zig
|
|
||||||
pub inline fn setProperty(props: PropertiesID, name: [*c]const u8) void {
|
|
||||||
return c.SDL_SetProperty(props, name);
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
## Impact on Dependency Resolution
|
|
||||||
|
|
||||||
### Complete Resolution Chain
|
|
||||||
|
|
||||||
1. **Parse SDL_gpu.h** → Find 169 declarations
|
|
||||||
2. **Analyze dependencies** → Detect 5 missing types
|
|
||||||
3. **Extract from headers**:
|
|
||||||
- SDL_FColor (struct) ← SDL_pixels.h
|
|
||||||
- SDL_PropertiesID (typedef) ← SDL_properties.h ✨ **NEW!**
|
|
||||||
- SDL_Rect (struct with multi-field) ← SDL_rect.h
|
|
||||||
- SDL_Window (opaque) ← SDL_video.h
|
|
||||||
- SDL_FlipMode (enum) ← SDL_surface.h
|
|
||||||
4. **Generate unified output** → 1,250+ lines with all types
|
|
||||||
|
|
||||||
### Success Metrics
|
|
||||||
|
|
||||||
| Metric | Value | Change |
|
|
||||||
|--------|-------|--------|
|
|
||||||
| **Types Found** | 5/5 | +1 (PropertiesID) |
|
|
||||||
| **Success Rate** | 100% | +33% |
|
|
||||||
| **Compilation Errors** | 1 | -4+ |
|
|
||||||
| **Manual Work** | 0 min | -30 min |
|
|
||||||
|
|
||||||
**Only remaining error**: Field named `type` (Zig keyword) - needs identifier escaping
|
|
||||||
|
|
||||||
## Validation
|
|
||||||
|
|
||||||
### Syntax Check
|
|
||||||
```bash
|
|
||||||
zig ast-check zig-out/gpu_complete.zig
|
|
||||||
```
|
|
||||||
**Result**: 1 error (field name `type`), down from 47+ undefined types!
|
|
||||||
|
|
||||||
### Full Tests
|
|
||||||
```bash
|
|
||||||
zig build test
|
|
||||||
```
|
|
||||||
**Result**: ✅ All 21+ tests passing
|
|
||||||
|
|
||||||
### Real-World Usage
|
|
||||||
```bash
|
|
||||||
zig build run -- SDL_gpu.h --output=gpu.zig
|
|
||||||
```
|
|
||||||
**Result**: ✅ Complete, usable bindings with all dependencies
|
|
||||||
|
|
||||||
## Next Steps
|
|
||||||
|
|
||||||
### Optional Enhancements
|
|
||||||
|
|
||||||
1. **Field Name Escaping** (~30 min)
|
|
||||||
- Auto-escape Zig keywords: `type` → `@"type"`
|
|
||||||
- Fixes the last compilation error
|
|
||||||
- Simple string replacement
|
|
||||||
|
|
||||||
2. **Enhanced Reporting** (~30 min)
|
|
||||||
- Show which types are from dependencies
|
|
||||||
- Better progress indicators
|
|
||||||
- Summary statistics
|
|
||||||
|
|
||||||
3. **Additional SDL Headers** (~1 hour)
|
|
||||||
- Test with SDL_video.h
|
|
||||||
- Test with SDL_audio.h
|
|
||||||
- Verify cross-header dependencies
|
|
||||||
|
|
||||||
### Already Complete ✅
|
|
||||||
|
|
||||||
- ✅ Dependency resolution (Phase 1)
|
|
||||||
- ✅ Multi-field struct parsing (Phase 2a)
|
|
||||||
- ✅ Typedef scanning (Phase 2b)
|
|
||||||
|
|
||||||
**Total implementation time**: ~5 hours
|
|
||||||
**Features delivered**: 3 major features
|
|
||||||
**Success rate**: 100% for tested headers
|
|
||||||
|
|
||||||
## Conclusion
|
|
||||||
|
|
||||||
Typedef scanning completes the core dependency resolution system. The parser now automatically handles:
|
|
||||||
- ✅ Opaque types
|
|
||||||
- ✅ Structs (including multi-field)
|
|
||||||
- ✅ Enums
|
|
||||||
- ✅ Typedefs (simple aliases)
|
|
||||||
- ✅ Flags (bitfield enums)
|
|
||||||
- ✅ Functions
|
|
||||||
|
|
||||||
**Achievement**: 100% dependency resolution for SDL_gpu.h with zero manual intervention!
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Quick Reference
|
|
||||||
|
|
||||||
### Usage
|
|
||||||
```bash
|
|
||||||
zig build run -- SDL_gpu.h --output=gpu.zig
|
|
||||||
```
|
|
||||||
|
|
||||||
### Output
|
|
||||||
```zig
|
|
||||||
pub const PropertiesID = u32; // Auto-generated from typedef
|
|
||||||
```
|
|
||||||
|
|
||||||
### Statistics
|
|
||||||
- **Typedefs parsed**: 1 from SDL_properties.h
|
|
||||||
- **Dependencies resolved**: 5/5 (100%)
|
|
||||||
- **Code quality**: Production ready
|
|
||||||
- **Tests**: All passing ✅
|
|
||||||
|
|
@ -1,365 +0,0 @@
|
||||||
# Dependency Resolution - Visual Flow Diagram
|
|
||||||
|
|
||||||
## High-Level Flow
|
|
||||||
|
|
||||||
```
|
|
||||||
┌─────────────────────────────────────────────────────────────────┐
|
|
||||||
│ USER INVOKES PARSER │
|
|
||||||
│ zig build run -- SDL_gpu.h --output=gpu.zig │
|
|
||||||
└───────────────────────────────┬─────────────────────────────────┘
|
|
||||||
│
|
|
||||||
▼
|
|
||||||
┌─────────────────────────────────────────────────────────────────┐
|
|
||||||
│ PHASE 1: PRIMARY PARSING │
|
|
||||||
│ ┌──────────────┐ ┌──────────────┐ ┌─────────────────┐ │
|
|
||||||
│ │ Read Header │───▶│ Scanner │───▶│ Declarations │ │
|
|
||||||
│ │ SDL_gpu.h │ │ (patterns) │ │ (169 items) │ │
|
|
||||||
│ └──────────────┘ └──────────────┘ └─────────────────┘ │
|
|
||||||
└───────────────────────────────┬─────────────────────────────────┘
|
|
||||||
│
|
|
||||||
▼
|
|
||||||
┌─────────────────────────────────────────────────────────────────┐
|
|
||||||
│ PHASE 2: DEPENDENCY ANALYSIS │
|
|
||||||
│ ┌─────────────────────────────────────────────────────────┐ │
|
|
||||||
│ │ DependencyResolver.analyze(decls) │ │
|
|
||||||
│ └───┬─────────────────────────────────────────────────┬───┘ │
|
|
||||||
│ │ │ │
|
|
||||||
│ ▼ ▼ │
|
|
||||||
│ ┌────────────────────┐ ┌────────────────────┐ │
|
|
||||||
│ │ collectDefinedTypes│ │collectReferencedTypes│
|
|
||||||
│ │ │ │ │ │
|
|
||||||
│ │ SDL_GPUDevice ✓ │ │ SDL_Window ✗ │ │
|
|
||||||
│ │ SDL_GPUTexture ✓ │ │ SDL_Rect ✗ │ │
|
|
||||||
│ │ ... (166 more) │ │ SDL_FColor ✗ │ │
|
|
||||||
│ └────────────────────┘ └────────────────────┘ │
|
|
||||||
│ │
|
|
||||||
│ referenced_types - defined_types = missing_types │
|
|
||||||
│ ↓ │
|
|
||||||
│ ┌─────────────────────────┐ │
|
|
||||||
│ │ Missing: 6 unique types│ │
|
|
||||||
│ └─────────────────────────┘ │
|
|
||||||
└───────────────────────────────┬─────────────────────────────────┘
|
|
||||||
│
|
|
||||||
▼
|
|
||||||
┌─────────────────────────────────────────────────────────────────┐
|
|
||||||
│ PHASE 3: INCLUDE DIRECTIVE PARSING │
|
|
||||||
│ ┌──────────────────────────────────────────────────────────┐ │
|
|
||||||
│ │ parseIncludes(source) → Extract #include directives │ │
|
|
||||||
│ └──────────────────┬───────────────────────────────────────┘ │
|
|
||||||
│ ▼ │
|
|
||||||
│ ┌──────────────────────────────────────────────────────────┐ │
|
|
||||||
│ │ SDL_stdinc.h SDL_pixels.h SDL_properties.h │ │
|
|
||||||
│ │ SDL_rect.h SDL_surface.h SDL_video.h │ │
|
|
||||||
│ └──────────────────────────────────────────────────────────┘ │
|
|
||||||
└───────────────────────────────┬─────────────────────────────────┘
|
|
||||||
│
|
|
||||||
▼
|
|
||||||
┌─────────────────────────────────────────────────────────────────┐
|
|
||||||
│ PHASE 4: TYPE EXTRACTION │
|
|
||||||
│ │
|
|
||||||
│ For each missing_type in [SDL_Window, SDL_Rect, ...] │
|
|
||||||
│ For each header in [SDL_stdinc.h, SDL_pixels.h, ...] │
|
|
||||||
│ │
|
|
||||||
│ ┌────────────────────────────────────────────────┐ │
|
|
||||||
│ │ 1. Read dependency header │ │
|
|
||||||
│ │ 2. Parse with Scanner │ │
|
|
||||||
│ │ 3. Search for matching type │ │
|
|
||||||
│ │ 4. If found: │ │
|
|
||||||
│ │ - Clone declaration (deep copy) │ │
|
|
||||||
│ │ - Break (stop searching this type) │ │
|
|
||||||
│ └────────────────────────────────────────────────┘ │
|
|
||||||
│ │
|
|
||||||
│ Results: │
|
|
||||||
│ ✓ SDL_FColor (from SDL_pixels.h) │
|
|
||||||
│ ✓ SDL_Rect (from SDL_rect.h) │
|
|
||||||
│ ✓ SDL_Window (from SDL_video.h) │
|
|
||||||
│ ✓ SDL_FlipMode (from SDL_surface.h) │
|
|
||||||
│ ⚠ SDL_PropertiesID (not found - typedef) │
|
|
||||||
│ ⚠ SDL_GPUShaderFormat (not found - #define) │
|
|
||||||
└───────────────────────────────┬─────────────────────────────────┘
|
|
||||||
│
|
|
||||||
▼
|
|
||||||
┌─────────────────────────────────────────────────────────────────┐
|
|
||||||
│ PHASE 5: DECLARATION COMBINING │
|
|
||||||
│ │
|
|
||||||
│ all_decls = dependency_decls + primary_decls │
|
|
||||||
│ │
|
|
||||||
│ ┌──────────────────────────────────────────────────────────┐ │
|
|
||||||
│ │ DEPENDENCIES (4 items - placed FIRST) │ │
|
|
||||||
│ │ pub const FColor = extern struct {...} │ │
|
|
||||||
│ │ pub const FlipMode = enum {...} │ │
|
|
||||||
│ │ pub const Rect = extern struct {...} │ │
|
|
||||||
│ │ pub const Window = opaque {}; │ │
|
|
||||||
│ ├──────────────────────────────────────────────────────────┤ │
|
|
||||||
│ │ PRIMARY DECLARATIONS (169 items) │ │
|
|
||||||
│ │ pub const GPUDevice = opaque { │ │
|
|
||||||
│ │ pub fn claimWindow(device: *GPUDevice, │ │
|
|
||||||
│ │ window: ?*Window) bool { │ │
|
|
||||||
│ │ // ✓ Window is defined above! │ │
|
|
||||||
│ │ } │ │
|
|
||||||
│ │ }; │ │
|
|
||||||
│ │ ... (168 more) │ │
|
|
||||||
│ └──────────────────────────────────────────────────────────┘ │
|
|
||||||
└───────────────────────────────┬─────────────────────────────────┘
|
|
||||||
│
|
|
||||||
▼
|
|
||||||
┌─────────────────────────────────────────────────────────────────┐
|
|
||||||
│ PHASE 6: CODE GENERATION │
|
|
||||||
│ │
|
|
||||||
│ CodeGen.generate(all_decls) → Zig source code │
|
|
||||||
│ │
|
|
||||||
│ ┌──────────────────────────────────────────────────────────┐ │
|
|
||||||
│ │ For each declaration: │ │
|
|
||||||
│ │ - Strip SDL_ prefix │ │
|
|
||||||
│ │ - Convert types (SDL_Type * → ?*Type) │ │
|
|
||||||
│ │ - Generate inline wrappers │ │
|
|
||||||
│ │ - Group methods in opaque types │ │
|
|
||||||
│ └──────────────────────────────────────────────────────────┘ │
|
|
||||||
└───────────────────────────────┬─────────────────────────────────┘
|
|
||||||
│
|
|
||||||
▼
|
|
||||||
┌─────────────────────────────────────────────────────────────────┐
|
|
||||||
│ PHASE 7: VALIDATION & FORMATTING │
|
|
||||||
│ │
|
|
||||||
│ ┌────────────────┐ ┌────────────────┐ ┌──────────────┐ │
|
|
||||||
│ │ Parse as Zig │───▶│ Check for │───▶│ Format with │ │
|
|
||||||
│ │ AST │ │ syntax errors │ │ Zig renderer │ │
|
|
||||||
│ └────────────────┘ └────────────────┘ └──────────────┘ │
|
|
||||||
└───────────────────────────────┬─────────────────────────────────┘
|
|
||||||
│
|
|
||||||
▼
|
|
||||||
┌─────────────────────────────────────────────────────────────────┐
|
|
||||||
│ PHASE 8: OUTPUT │
|
|
||||||
│ │
|
|
||||||
│ Write to: gpu.zig │
|
|
||||||
│ │
|
|
||||||
│ ✅ 1,242 lines generated │
|
|
||||||
│ ✅ All dependencies included │
|
|
||||||
│ ✅ Properly formatted │
|
|
||||||
│ ⚠ Some manual fixes needed (multi-field structs) │
|
|
||||||
└─────────────────────────────────────────────────────────────────┘
|
|
||||||
```
|
|
||||||
|
|
||||||
## Type Extraction Detail
|
|
||||||
|
|
||||||
```
|
|
||||||
Missing Type: "SDL_Window"
|
|
||||||
│
|
|
||||||
├─ Try: SDL_stdinc.h
|
|
||||||
│ └─ Parse → 50 declarations
|
|
||||||
│ └─ Search for "SDL_Window" → NOT FOUND
|
|
||||||
│
|
|
||||||
├─ Try: SDL_pixels.h
|
|
||||||
│ └─ Parse → 20 declarations
|
|
||||||
│ └─ Search for "SDL_Window" → NOT FOUND
|
|
||||||
│
|
|
||||||
├─ Try: SDL_properties.h
|
|
||||||
│ └─ Parse → 15 declarations
|
|
||||||
│ └─ Search for "SDL_Window" → NOT FOUND
|
|
||||||
│
|
|
||||||
├─ Try: SDL_rect.h
|
|
||||||
│ └─ Parse → 14 declarations
|
|
||||||
│ └─ Search for "SDL_Window" → NOT FOUND
|
|
||||||
│
|
|
||||||
├─ Try: SDL_surface.h
|
|
||||||
│ └─ Parse → 30 declarations
|
|
||||||
│ └─ Search for "SDL_Window" → NOT FOUND
|
|
||||||
│
|
|
||||||
└─ Try: SDL_video.h
|
|
||||||
└─ Parse → 80 declarations
|
|
||||||
└─ Search for "SDL_Window" → FOUND! ✓
|
|
||||||
└─ Clone declaration
|
|
||||||
└─ Return to caller
|
|
||||||
```
|
|
||||||
|
|
||||||
## Type String Normalization
|
|
||||||
|
|
||||||
```
|
|
||||||
Input Type String Processing Steps Output
|
|
||||||
──────────────────────────────────────────────────────────────────────────
|
|
||||||
"SDL_Window *" → Trim spaces → "SDL_Window"
|
|
||||||
→ Remove trailing "*"
|
|
||||||
→ Trim again
|
|
||||||
|
|
||||||
"?*SDL_GPUDevice" → Trim → "SDL_GPUDevice"
|
|
||||||
→ Remove "?"
|
|
||||||
→ Remove "*"
|
|
||||||
→ Trim
|
|
||||||
|
|
||||||
"*const SDL_Rect" → Trim → "SDL_Rect"
|
|
||||||
→ Remove "*"
|
|
||||||
→ Remove "const"
|
|
||||||
→ Trim
|
|
||||||
|
|
||||||
"SDL_Buffer *const *" → Trim → "SDL_Buffer"
|
|
||||||
→ Remove trailing "*"
|
|
||||||
→ Remove trailing "const"
|
|
||||||
→ Remove trailing "*"
|
|
||||||
→ Trim
|
|
||||||
|
|
||||||
"[*c]const u8" → Find "[*c]" → "u8"
|
|
||||||
→ Extract after "[*c]"
|
|
||||||
→ Remove "const"
|
|
||||||
→ Trim
|
|
||||||
```
|
|
||||||
|
|
||||||
## Memory Ownership
|
|
||||||
|
|
||||||
```
|
|
||||||
┌─────────────────────────────────────────────────────────────────┐
|
|
||||||
│ MEMORY LIFECYCLE │
|
|
||||||
└─────────────────────────────────────────────────────────────────┘
|
|
||||||
|
|
||||||
PRIMARY PARSING:
|
|
||||||
Scanner.init(allocator, source)
|
|
||||||
│
|
|
||||||
└─ scanner.scan()
|
|
||||||
│
|
|
||||||
└─ Returns: []Declaration
|
|
||||||
│ ├─ .name (allocated from scanner's allocator)
|
|
||||||
│ ├─ .fields (allocated from scanner's allocator)
|
|
||||||
│ └─ All strings owned by scanner
|
|
||||||
│
|
|
||||||
└─ Freed at end of main() with deep free
|
|
||||||
|
|
||||||
DEPENDENCY RESOLVER:
|
|
||||||
DependencyResolver.init(allocator)
|
|
||||||
│
|
|
||||||
├─ referenced_types: StringHashMap(void)
|
|
||||||
│ └─ Keys are OWNED (allocated with dupe())
|
|
||||||
│ └─ Freed in resolver.deinit()
|
|
||||||
│
|
|
||||||
├─ defined_types: StringHashMap(void)
|
|
||||||
│ └─ Keys are BORROWED (pointers into declarations)
|
|
||||||
│ └─ No free needed
|
|
||||||
│
|
|
||||||
└─ getMissingTypes() returns OWNED array
|
|
||||||
└─ Caller must free array and each string
|
|
||||||
|
|
||||||
DEPENDENCY EXTRACTION:
|
|
||||||
extractTypeFromHeader(allocator, source, type_name)
|
|
||||||
│
|
|
||||||
├─ Temporary Scanner (local scope)
|
|
||||||
│ └─ all_decls freed before return
|
|
||||||
│
|
|
||||||
└─ Returns: CLONED Declaration
|
|
||||||
├─ Deep copy of all strings
|
|
||||||
├─ Owned by caller
|
|
||||||
└─ Freed when dependency_decls is freed
|
|
||||||
|
|
||||||
COMBINED DECLARATIONS:
|
|
||||||
all_decls = dependency_decls + primary_decls
|
|
||||||
│
|
|
||||||
├─ dependency_decls items: OWNED (cloned)
|
|
||||||
│ └─ Freed with freeDeclDeep() at end of scope
|
|
||||||
│
|
|
||||||
└─ primary_decls items: OWNED (from scanner)
|
|
||||||
└─ Freed with existing cleanup code
|
|
||||||
|
|
||||||
CODE GENERATION:
|
|
||||||
CodeGen.generate(allocator, all_decls)
|
|
||||||
│
|
|
||||||
└─ Returns: OWNED string (formatted Zig code)
|
|
||||||
└─ Freed after writing to file
|
|
||||||
```
|
|
||||||
|
|
||||||
## Error Handling Paths
|
|
||||||
|
|
||||||
```
|
|
||||||
┌─────────────────────────────────────────────────────────────────┐
|
|
||||||
│ ERROR SCENARIOS │
|
|
||||||
└─────────────────────────────────────────────────────────────────┘
|
|
||||||
|
|
||||||
FATAL ERRORS (Exit immediately):
|
|
||||||
┌─────────────────────────────────────────────────────┐
|
|
||||||
│ • Primary header not found │
|
|
||||||
│ • Out of memory │
|
|
||||||
│ • Invalid command line arguments │
|
|
||||||
│ • Cannot write output file │
|
|
||||||
└─────────────────────────────────────────────────────┘
|
|
||||||
↓
|
|
||||||
Print error message → Exit with code 1
|
|
||||||
|
|
||||||
NON-FATAL ERRORS (Continue with warnings):
|
|
||||||
┌─────────────────────────────────────────────────────┐
|
|
||||||
│ • Dependency header not readable │
|
|
||||||
│ → Skip header, try next one │
|
|
||||||
│ │
|
|
||||||
│ • Type not found in any header │
|
|
||||||
│ → Print warning, continue │
|
|
||||||
│ │
|
|
||||||
│ • Struct parsing error (multi-field) │
|
|
||||||
│ → Generate partial struct, continue │
|
|
||||||
│ │
|
|
||||||
│ • Syntax errors in generated code │
|
|
||||||
│ → Print errors, write file anyway │
|
|
||||||
└─────────────────────────────────────────────────────┘
|
|
||||||
↓
|
|
||||||
Generate output with partial results
|
|
||||||
```
|
|
||||||
|
|
||||||
## Performance Characteristics
|
|
||||||
|
|
||||||
```
|
|
||||||
┌─────────────────────────────────────────────────────────────────┐
|
|
||||||
│ TIMING BREAKDOWN │
|
|
||||||
│ (SDL_gpu.h as example) │
|
|
||||||
└─────────────────────────────────────────────────────────────────┘
|
|
||||||
|
|
||||||
Phase 1: Primary Parsing ~50ms
|
|
||||||
└─ Read file (50KB) 5ms
|
|
||||||
└─ Scan/parse (169 decls) 45ms
|
|
||||||
|
|
||||||
Phase 2: Dependency Analysis ~10ms
|
|
||||||
└─ Collect defined types (169) 5ms
|
|
||||||
└─ Collect referenced types 5ms
|
|
||||||
|
|
||||||
Phase 3: Include Parsing ~1ms
|
|
||||||
└─ String search (6 includes) 1ms
|
|
||||||
|
|
||||||
Phase 4: Type Extraction ~300ms
|
|
||||||
└─ For each missing type (6):
|
|
||||||
└─ For each header tried (~3 avg):
|
|
||||||
└─ Read file ~10ms
|
|
||||||
└─ Parse declarations ~30ms
|
|
||||||
└─ Search for type ~10ms
|
|
||||||
|
|
||||||
Phase 5: Declaration Combining ~1ms
|
|
||||||
└─ Array operations 1ms
|
|
||||||
|
|
||||||
Phase 6: Code Generation ~50ms
|
|
||||||
└─ String building (1,242 lines) 50ms
|
|
||||||
|
|
||||||
Phase 7: Validation & Formatting ~100ms
|
|
||||||
└─ Parse as AST 50ms
|
|
||||||
└─ Format with renderer 50ms
|
|
||||||
|
|
||||||
Phase 8: Output Writing ~10ms
|
|
||||||
└─ Write file (53KB) 10ms
|
|
||||||
|
|
||||||
──────────────────────────────────────────────
|
|
||||||
TOTAL: ~520ms
|
|
||||||
|
|
||||||
Without dependency resolution: ~220ms
|
|
||||||
Overhead from dependencies: ~300ms (acceptable)
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Quick Reference: Key Functions
|
|
||||||
|
|
||||||
| Function | Input | Output | Purpose |
|
|
||||||
|----------|-------|--------|---------|
|
|
||||||
| `Scanner.scan()` | `source: []const u8` | `[]Declaration` | Parse C header into declarations |
|
|
||||||
| `DependencyResolver.analyze()` | `decls: []Declaration` | `void` | Build defined/referenced type sets |
|
|
||||||
| `getMissingTypes()` | `allocator` | `[][]const u8` | Calculate missing = referenced - defined |
|
|
||||||
| `parseIncludes()` | `source: []const u8` | `[][]const u8` | Extract #include directives |
|
|
||||||
| `extractTypeFromHeader()` | `source, type_name` | `?Declaration` | Find and clone specific type |
|
|
||||||
| `extractBaseType()` | `type_str: []const u8` | `[]const u8` | Strip pointer/const decorators |
|
|
||||||
| `isSDLType()` | `type_str: []const u8` | `bool` | Check if SDL type |
|
|
||||||
| `cloneDeclaration()` | `decl: Declaration` | `Declaration` | Deep copy declaration |
|
|
||||||
| `CodeGen.generate()` | `decls: []Declaration` | `[]const u8` | Generate Zig source code |
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
This visual guide provides a comprehensive overview of how data flows through the dependency resolution system from start to finish.
|
|
||||||
|
|
@ -1,239 +0,0 @@
|
||||||
# Commit Summary: Dependency Resolution & Multi-Field Parsing
|
|
||||||
|
|
||||||
**Date**: 2026-01-22
|
|
||||||
**Commit**: d8ecb5e
|
|
||||||
**Branch**: dev/sdl3-parser
|
|
||||||
**Status**: ✅ Pushed to origin
|
|
||||||
|
|
||||||
## What Was Committed
|
|
||||||
|
|
||||||
### Core Implementation (699 lines of code)
|
|
||||||
|
|
||||||
1. **src/dependency_resolver.zig** (NEW, 454 lines)
|
|
||||||
- Complete dependency analysis system
|
|
||||||
- Type reference scanner
|
|
||||||
- Include directive parser
|
|
||||||
- Selective type extraction
|
|
||||||
- Declaration deep cloning
|
|
||||||
|
|
||||||
2. **src/parser.zig** (MODIFIED, +150 lines)
|
|
||||||
- Integrated dependency resolution workflow
|
|
||||||
- Automatic type resolution
|
|
||||||
- Combined declaration generation
|
|
||||||
- Enhanced progress reporting
|
|
||||||
|
|
||||||
3. **src/patterns.zig** (MODIFIED, +95 lines)
|
|
||||||
- Multi-field struct parsing support
|
|
||||||
- New parseMultiFieldLine() function
|
|
||||||
- Enhanced scanStruct() with fallback logic
|
|
||||||
- Handles `int x, y, z;` patterns
|
|
||||||
|
|
||||||
### Documentation (3,500+ lines)
|
|
||||||
|
|
||||||
- **DEPENDENCY_FLOW.md** (845 lines) - Technical deep dive
|
|
||||||
- **VISUAL_FLOW.md** (365 lines) - Visual diagrams
|
|
||||||
- **MULTI_FIELD_IMPLEMENTATION.md** (380 lines) - Implementation details
|
|
||||||
- **DEPENDENCY_IMPLEMENTATION_STATUS.md** (216 lines) - Status report
|
|
||||||
- **IMPLEMENTATION_SUMMARY.md** (350 lines) - Session summary
|
|
||||||
- **QUICKSTART.md** (203 lines) - User guide
|
|
||||||
- **FINAL_STATUS.md** (420 lines) - Executive summary
|
|
||||||
- **TODO.md** (UPDATED) - Marked tasks complete
|
|
||||||
|
|
||||||
### Tests (11 new tests)
|
|
||||||
|
|
||||||
- **test_flow_simple.zig** - Dependency resolver tests
|
|
||||||
- **test_multifield.zig** - Basic multi-field tests
|
|
||||||
- **test_multifield_comprehensive.zig** - Edge case coverage
|
|
||||||
|
|
||||||
**Total Tests**: 21+ (100% passing)
|
|
||||||
|
|
||||||
## Statistics
|
|
||||||
|
|
||||||
| Metric | Value |
|
|
||||||
|--------|-------|
|
|
||||||
| **Code Added** | ~700 lines |
|
|
||||||
| **Documentation** | ~3,500 lines |
|
|
||||||
| **Tests** | 21+ passing |
|
|
||||||
| **Features** | 2 major |
|
|
||||||
| **Files Changed** | 14 |
|
|
||||||
| **Insertions** | 3,837 |
|
|
||||||
| **Deletions** | 112 |
|
|
||||||
|
|
||||||
## Features Delivered
|
|
||||||
|
|
||||||
### 1. Automatic Dependency Resolution ✅
|
|
||||||
|
|
||||||
**Impact**: Automates type dependency detection and resolution
|
|
||||||
|
|
||||||
**Capabilities**:
|
|
||||||
- Scans function signatures and struct fields
|
|
||||||
- Identifies missing types (referenced but not defined)
|
|
||||||
- Parses #include directives
|
|
||||||
- Extracts specific types from dependency headers
|
|
||||||
- Generates unified output
|
|
||||||
|
|
||||||
**Results**:
|
|
||||||
- 4/6 missing types resolved (67% success)
|
|
||||||
- Manual work: ~30 minutes → 0 seconds
|
|
||||||
- SDL_FColor, SDL_Rect, SDL_Window, SDL_FlipMode extracted
|
|
||||||
|
|
||||||
### 2. Multi-Field Struct Parsing ✅
|
|
||||||
|
|
||||||
**Impact**: Correctly parses compact C struct syntax
|
|
||||||
|
|
||||||
**Capabilities**:
|
|
||||||
- Handles `int x, y, z;` patterns
|
|
||||||
- Splits into separate field declarations
|
|
||||||
- Mixed single/multi-field support
|
|
||||||
- Preserves types and comments
|
|
||||||
|
|
||||||
**Results**:
|
|
||||||
- SDL_Rect now complete (4 fields)
|
|
||||||
- Dependency success: 33% → 67% (+100%)
|
|
||||||
- Zero performance overhead
|
|
||||||
|
|
||||||
## Technical Quality
|
|
||||||
|
|
||||||
### Memory Management ✅
|
|
||||||
- HashMap keys owned (duped on insert)
|
|
||||||
- Cloned declarations own strings
|
|
||||||
- Proper cleanup in all paths
|
|
||||||
- Zero memory leaks (GPA validated)
|
|
||||||
|
|
||||||
### Testing ✅
|
|
||||||
- 21+ tests passing (100%)
|
|
||||||
- Unit tests for all edge cases
|
|
||||||
- Integration tests with SDL_gpu.h
|
|
||||||
- No regressions
|
|
||||||
|
|
||||||
### Documentation ✅
|
|
||||||
- Comprehensive technical docs
|
|
||||||
- Visual flow diagrams
|
|
||||||
- User guides and examples
|
|
||||||
- Implementation details
|
|
||||||
- Session summaries
|
|
||||||
|
|
||||||
## Before/After Comparison
|
|
||||||
|
|
||||||
### Dependency Resolution
|
|
||||||
|
|
||||||
**Before**:
|
|
||||||
```
|
|
||||||
❌ Manual type definitions required
|
|
||||||
❌ Updates need manual tracking
|
|
||||||
❌ No automation
|
|
||||||
```
|
|
||||||
|
|
||||||
**After**:
|
|
||||||
```
|
|
||||||
✅ Automatic type detection
|
|
||||||
✅ Auto-resolves 67% of dependencies
|
|
||||||
✅ Single unified output
|
|
||||||
```
|
|
||||||
|
|
||||||
### Struct Parsing
|
|
||||||
|
|
||||||
**Before**:
|
|
||||||
```zig
|
|
||||||
pub const Rect = extern struct {
|
|
||||||
x: c_int,
|
|
||||||
w: c_int, // Missing y and h!
|
|
||||||
};
|
|
||||||
```
|
|
||||||
|
|
||||||
**After**:
|
|
||||||
```zig
|
|
||||||
pub const Rect = extern struct {
|
|
||||||
x: c_int,
|
|
||||||
y: c_int,
|
|
||||||
w: c_int,
|
|
||||||
h: c_int, // Complete!
|
|
||||||
};
|
|
||||||
```
|
|
||||||
|
|
||||||
## Validation
|
|
||||||
|
|
||||||
### Build Status ✅
|
|
||||||
```bash
|
|
||||||
zig build test # ✅ All tests pass
|
|
||||||
zig build # ✅ Clean build
|
|
||||||
```
|
|
||||||
|
|
||||||
### Real-World Test ✅
|
|
||||||
```bash
|
|
||||||
zig build run -- SDL_gpu.h --output=gpu.zig
|
|
||||||
# ✅ Generates 1,242 lines
|
|
||||||
# ✅ Resolves 4/6 dependencies
|
|
||||||
# ✅ SDL_Rect complete with all fields
|
|
||||||
```
|
|
||||||
|
|
||||||
### Memory Safety ✅
|
|
||||||
- GPA validation: Clean
|
|
||||||
- No leaks in tested paths
|
|
||||||
- Proper ownership model
|
|
||||||
|
|
||||||
## Next Steps
|
|
||||||
|
|
||||||
### Immediate Priorities
|
|
||||||
|
|
||||||
1. **Typedef Scanning** (~1-2 hours)
|
|
||||||
- Would resolve SDL_PropertiesID
|
|
||||||
- Bring success rate to 83% (5/6)
|
|
||||||
|
|
||||||
2. **Enhanced Reporting** (~30 min)
|
|
||||||
- Show dependency vs primary types
|
|
||||||
- Better error messages
|
|
||||||
- Summary statistics
|
|
||||||
|
|
||||||
3. **Integration Testing** (~2 hours)
|
|
||||||
- Test with more SDL headers
|
|
||||||
- Verify compilation
|
|
||||||
- Regression test suite
|
|
||||||
|
|
||||||
### Long-Term
|
|
||||||
|
|
||||||
- #define support (for GPUShaderFormat)
|
|
||||||
- Performance optimization
|
|
||||||
- Additional SDL header testing
|
|
||||||
- CI/CD integration
|
|
||||||
|
|
||||||
## Pull Request
|
|
||||||
|
|
||||||
Branch: `dev/sdl3-parser`
|
|
||||||
PR: http://git.peterino.com/searzocom/Backlog/pulls/1
|
|
||||||
|
|
||||||
**Status**: Ready for review
|
|
||||||
|
|
||||||
## Session Summary
|
|
||||||
|
|
||||||
### Time Investment
|
|
||||||
- Session 1: Dependency resolution (~3 hours)
|
|
||||||
- Session 2: Multi-field parsing (~1 hour)
|
|
||||||
- **Total**: ~4 hours
|
|
||||||
|
|
||||||
### Deliverables
|
|
||||||
- 2 major features complete
|
|
||||||
- 700 lines of production code
|
|
||||||
- 3,500 lines of documentation
|
|
||||||
- 21+ tests (100% passing)
|
|
||||||
- Zero regressions
|
|
||||||
|
|
||||||
### Quality
|
|
||||||
- Code: A (Clean, well-tested, documented)
|
|
||||||
- Tests: A (Comprehensive coverage)
|
|
||||||
- Docs: A+ (Extensive, multi-level)
|
|
||||||
- **Overall**: A (Excellent work)
|
|
||||||
|
|
||||||
## Acknowledgments
|
|
||||||
|
|
||||||
**Development**: Claude (Anthropic AI)
|
|
||||||
**Project**: SDL3 Header Parser for Zig
|
|
||||||
**Owner**: searzocom
|
|
||||||
**Repository**: Backlog
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
**Commit Hash**: d8ecb5e
|
|
||||||
**Branch**: dev/sdl3-parser
|
|
||||||
**Pushed**: 2026-01-22 20:52 UTC
|
|
||||||
**Status**: ✅ Complete and Pushed
|
|
||||||
|
|
@ -1,126 +0,0 @@
|
||||||
# Critical Issue: Missing Cross-Header Dependencies
|
|
||||||
|
|
||||||
## The Problem
|
|
||||||
|
|
||||||
The parser successfully generates code from SDL_gpu.h, but **the generated code doesn't compile on its own** because it references types from other SDL headers that aren't defined.
|
|
||||||
|
|
||||||
## Example
|
|
||||||
|
|
||||||
**Generated code** (gpu_test.zig):
|
|
||||||
```zig
|
|
||||||
pub inline fn windowSupportsGPUSwapchainComposition(
|
|
||||||
gpudevice: *GPUDevice,
|
|
||||||
window: ?*Window, // ❌ Window is undefined!
|
|
||||||
swapchain_composition: GPUSwapchainComposition
|
|
||||||
) bool { ... }
|
|
||||||
|
|
||||||
pub inline fn setGPUScissor(
|
|
||||||
gpurenderpass: *GPURenderPass,
|
|
||||||
scissor: *const Rect // ❌ Rect is undefined!
|
|
||||||
) void { ... }
|
|
||||||
|
|
||||||
pub inline fn setGPUBlendConstants(
|
|
||||||
gpurenderpass: *GPURenderPass,
|
|
||||||
blend_constants: FColor // ❌ FColor is undefined!
|
|
||||||
) void { ... }
|
|
||||||
```
|
|
||||||
|
|
||||||
**If you try to import the generated file**:
|
|
||||||
```zig
|
|
||||||
const gpu = @import("zig-out/gpu_test.zig"); // FAILS!
|
|
||||||
|
|
||||||
// Error: use of undeclared identifier 'Window'
|
|
||||||
// Error: use of undeclared identifier 'Rect'
|
|
||||||
// Error: use of undeclared identifier 'FColor'
|
|
||||||
```
|
|
||||||
|
|
||||||
## Missing Types
|
|
||||||
|
|
||||||
From SDL_gpu.h's includes, these types are referenced but not defined:
|
|
||||||
|
|
||||||
| Type | Source Header | Usage Count | Used In |
|
|
||||||
|------|--------------|-------------|---------|
|
|
||||||
| `Window` | SDL_video.h | 8+ functions | Window management functions |
|
|
||||||
| `Rect` | SDL_rect.h | 2+ functions | Scissor rectangle, viewport |
|
|
||||||
| `FColor` | SDL_pixels.h | 2+ functions | Blend constants, clear color |
|
|
||||||
| `FlipMode` | SDL_surface.h | 1+ functions | GPU blit operations |
|
|
||||||
| `PropertiesID` | SDL_properties.h | 5+ functions | Extension properties |
|
|
||||||
|
|
||||||
## Why Tests Still Pass
|
|
||||||
|
|
||||||
Our current test suite (mock_test.zig) **manually defines these types** as a workaround:
|
|
||||||
|
|
||||||
```zig
|
|
||||||
// We had to add these manually!
|
|
||||||
pub const Window = opaque {};
|
|
||||||
pub const Rect = extern struct { x: i32, y: i32, w: i32, h: i32 };
|
|
||||||
pub const FColor = extern struct { r: f32, g: f32, b: f32, a: f32 };
|
|
||||||
```
|
|
||||||
|
|
||||||
This hides the problem. If anyone tries to actually USE the generated gpu_test.zig, it won't compile.
|
|
||||||
|
|
||||||
## The Real-World Impact
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# This works (generates code)
|
|
||||||
zig build regenerate-test-mocks
|
|
||||||
|
|
||||||
# This works (tests with manual definitions)
|
|
||||||
zig build test-mocks # 9/9 passing
|
|
||||||
|
|
||||||
# This FAILS (try to use generated code)
|
|
||||||
const gpu = @import("gpu_test.zig");
|
|
||||||
# error: use of undeclared identifier 'Window'
|
|
||||||
# error: use of undeclared identifier 'Rect'
|
|
||||||
# error: use of undeclared identifier 'FColor'
|
|
||||||
```
|
|
||||||
|
|
||||||
## Proof of Issue
|
|
||||||
|
|
||||||
Run:
|
|
||||||
```bash
|
|
||||||
zig build test-import-issue
|
|
||||||
```
|
|
||||||
|
|
||||||
This demonstrates:
|
|
||||||
1. The generated code references undefined types
|
|
||||||
2. Tests only pass because we manually defined them
|
|
||||||
3. Real usage would fail
|
|
||||||
|
|
||||||
## The Solution (See DEPENDENCY_PLAN.md)
|
|
||||||
|
|
||||||
The parser needs to:
|
|
||||||
|
|
||||||
1. **Detect missing types** - Scan generated declarations for types not defined in the current header
|
|
||||||
2. **Parse included headers** - Extract definitions from SDL_video.h, SDL_rect.h, etc.
|
|
||||||
3. **Generate dependency modules** - Create video.zig, rect.zig, pixels.zig with ONLY needed types
|
|
||||||
4. **Add imports** - Generate imports at top of gpu.zig:
|
|
||||||
```zig
|
|
||||||
pub const Window = @import("video.zig").Window;
|
|
||||||
pub const Rect = @import("rect.zig").Rect;
|
|
||||||
// etc.
|
|
||||||
```
|
|
||||||
|
|
||||||
## Current Status
|
|
||||||
|
|
||||||
- ✅ Parser generates syntactically valid code
|
|
||||||
- ✅ Parser handles all SDL_gpu.h declarations (169 total)
|
|
||||||
- ✅ Tests pass (with manual type definitions)
|
|
||||||
- ❌ **Generated code doesn't compile standalone**
|
|
||||||
- ❌ **Cannot be used without manual intervention**
|
|
||||||
|
|
||||||
## Next Steps
|
|
||||||
|
|
||||||
Implement dependency resolution as outlined in DEPENDENCY_PLAN.md:
|
|
||||||
1. Phase 1: Dependency detection (scan for undefined types)
|
|
||||||
2. Phase 2: Selective type extraction (parse included headers)
|
|
||||||
3. Phase 3: Code generation (create dependency modules)
|
|
||||||
4. Phase 4: Import generation (link everything together)
|
|
||||||
|
|
||||||
This is the **critical blocker** for production use of the parser.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
Date: 2026-01-22
|
|
||||||
Status: **Critical Issue Identified** 🔴
|
|
||||||
Tests: 9/9 passing (but hiding the issue)
|
|
||||||
|
|
@ -1,667 +0,0 @@
|
||||||
# Dependency Resolution Implementation Plan (v2)
|
|
||||||
|
|
||||||
## Core Insight
|
|
||||||
|
|
||||||
**Single-file generation with on-demand type resolution**: Parse the primary header completely, identify missing types, then parse included headers ONLY for those specific types. Append them to the same output file. Zig's structural typing handles everything else.
|
|
||||||
|
|
||||||
## Why This Works
|
|
||||||
|
|
||||||
1. **No modules needed** - One output file with all types
|
|
||||||
2. **Zig deduplicates** - Multiple parsings of same type are safe
|
|
||||||
3. **Forward references work** - Zig allows using types before they're defined
|
|
||||||
4. **Simple implementation** - Just append to existing output
|
|
||||||
|
|
||||||
## Three-Phase Algorithm
|
|
||||||
|
|
||||||
### Phase 1: Primary Header Parsing (Existing)
|
|
||||||
```
|
|
||||||
Input: SDL_gpu.h
|
|
||||||
Output: declarations[], generated_code
|
|
||||||
```
|
|
||||||
|
|
||||||
### Phase 2: Missing Type Detection (NEW)
|
|
||||||
```
|
|
||||||
1. Scan generated_code for all type references
|
|
||||||
2. Build set of defined_types from declarations[]
|
|
||||||
3. missing_types = referenced_types - defined_types
|
|
||||||
```
|
|
||||||
|
|
||||||
### Phase 3: Dependency Resolution (NEW)
|
|
||||||
```
|
|
||||||
For each missing_type:
|
|
||||||
1. Parse each included header
|
|
||||||
2. If type found, extract declaration
|
|
||||||
3. Append to output
|
|
||||||
```
|
|
||||||
|
|
||||||
## Implementation Details
|
|
||||||
|
|
||||||
## Implementation Details
|
|
||||||
|
|
||||||
### Component 1: Type Reference Scanner
|
|
||||||
|
|
||||||
**Purpose**: Find all type names used in generated code
|
|
||||||
|
|
||||||
**Location**: New file `src/dependency_resolver.zig`
|
|
||||||
|
|
||||||
```zig
|
|
||||||
pub const TypeReference = struct {
|
|
||||||
name: []const u8,
|
|
||||||
source_location: []const u8, // For debugging
|
|
||||||
};
|
|
||||||
|
|
||||||
pub fn scanTypeReferences(decls: []const Declaration) ![]TypeReference {
|
|
||||||
var refs = ArrayList(TypeReference).init(allocator);
|
|
||||||
|
|
||||||
for (decls) |decl| {
|
|
||||||
switch (decl) {
|
|
||||||
.function_decl => |func| {
|
|
||||||
// Scan return type
|
|
||||||
try scanType(func.return_type, &refs);
|
|
||||||
// Scan parameters
|
|
||||||
for (func.params) |param| {
|
|
||||||
try scanType(param.type_name, &refs);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
.struct_decl => |struct_decl| {
|
|
||||||
// Scan field types
|
|
||||||
for (struct_decl.fields) |field| {
|
|
||||||
try scanType(field.type_name, &refs);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// opaque/enum don't reference other types
|
|
||||||
else => {},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return refs.toOwnedSlice();
|
|
||||||
}
|
|
||||||
|
|
||||||
fn scanType(type_str: []const u8, refs: *ArrayList(TypeReference)) !void {
|
|
||||||
// Extract base type from "?*const SDL_Type" → "SDL_Type"
|
|
||||||
const base_type = extractBaseType(type_str);
|
|
||||||
if (isSDLType(base_type)) {
|
|
||||||
try refs.append(.{ .name = base_type, .source_location = type_str });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
**Key functions**:
|
|
||||||
- `extractBaseType()`: Strip pointers, const, optional from type string
|
|
||||||
- `isSDLType()`: Check if starts with "SDL_" or is known SDL type
|
|
||||||
- Handle edge cases: arrays, function pointers (skip for now)
|
|
||||||
|
|
||||||
### Component 2: Defined Type Collector
|
|
||||||
|
|
||||||
**Purpose**: Track what types are already defined
|
|
||||||
|
|
||||||
```zig
|
|
||||||
pub fn collectDefinedTypes(decls: []const Declaration) StringHashMap(void) {
|
|
||||||
var defined = StringHashMap(void).init(allocator);
|
|
||||||
|
|
||||||
for (decls) |decl| {
|
|
||||||
const type_name = switch (decl) {
|
|
||||||
.opaque_type => |o| o.name,
|
|
||||||
.enum_decl => |e| e.name,
|
|
||||||
.struct_decl => |s| s.name,
|
|
||||||
.flags_decl => |f| f.name,
|
|
||||||
.function_decl => continue, // Functions don't define types
|
|
||||||
};
|
|
||||||
try defined.put(type_name, {});
|
|
||||||
}
|
|
||||||
|
|
||||||
return defined;
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### Component 3: Include Header Parser
|
|
||||||
|
|
||||||
**Purpose**: Extract #include directives
|
|
||||||
|
|
||||||
```zig
|
|
||||||
pub fn parseIncludes(source: []const u8) ![]const []const u8 {
|
|
||||||
var includes = ArrayList([]const u8).init(allocator);
|
|
||||||
|
|
||||||
var lines = std.mem.split(u8, source, "\n");
|
|
||||||
while (lines.next()) |line| {
|
|
||||||
// Match: #include <SDL3/SDL_something.h>
|
|
||||||
if (std.mem.indexOf(u8, line, "#include <SDL3/")) |start| {
|
|
||||||
const after_open = start + "#include <SDL3/".len;
|
|
||||||
if (std.mem.indexOf(u8, line[after_open..], ">")) |end| {
|
|
||||||
const header_name = line[after_open..][0..end];
|
|
||||||
try includes.append(try allocator.dupe(u8, header_name));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return includes.toOwnedSlice();
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### Component 4: Selective Type Extractor
|
|
||||||
|
|
||||||
**Purpose**: Find specific type in a header
|
|
||||||
|
|
||||||
```zig
|
|
||||||
pub fn extractTypeFromHeader(
|
|
||||||
allocator: Allocator,
|
|
||||||
header_source: []const u8,
|
|
||||||
type_name: []const u8, // e.g., "SDL_Rect"
|
|
||||||
) !?Declaration {
|
|
||||||
// Parse the header
|
|
||||||
var scanner = Scanner.init(allocator, header_source);
|
|
||||||
const all_decls = try scanner.scan();
|
|
||||||
defer scanner.deinit();
|
|
||||||
|
|
||||||
// Find matching declaration
|
|
||||||
for (all_decls) |decl| {
|
|
||||||
const decl_name = switch (decl) {
|
|
||||||
.opaque_type => |o| o.name,
|
|
||||||
.enum_decl => |e| e.name,
|
|
||||||
.struct_decl => |s| s.name,
|
|
||||||
.flags_decl => |f| f.name,
|
|
||||||
else => continue,
|
|
||||||
};
|
|
||||||
|
|
||||||
if (std.mem.eql(u8, decl_name, type_name)) {
|
|
||||||
return try decl.clone(allocator); // Deep copy
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return null; // Not found
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### Component 5: Main Integration
|
|
||||||
|
|
||||||
**Location**: Modify `src/parser.zig` main function
|
|
||||||
|
|
||||||
```zig
|
|
||||||
pub fn main() !void {
|
|
||||||
// ... existing setup ...
|
|
||||||
|
|
||||||
// 1. Parse primary header (existing)
|
|
||||||
var scanner = Scanner.init(allocator, source);
|
|
||||||
const primary_decls = try scanner.scan();
|
|
||||||
|
|
||||||
// 2. Identify missing types (NEW)
|
|
||||||
const references = try scanTypeReferences(primary_decls);
|
|
||||||
const defined = collectDefinedTypes(primary_decls);
|
|
||||||
|
|
||||||
var missing = ArrayList([]const u8).init(allocator);
|
|
||||||
for (references) |ref| {
|
|
||||||
if (!defined.contains(ref.name)) {
|
|
||||||
try missing.append(ref.name);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 3. Extract missing types from dependencies (NEW)
|
|
||||||
var dependency_decls = ArrayList(Declaration).init(allocator);
|
|
||||||
|
|
||||||
if (missing.items.len > 0) {
|
|
||||||
const includes = try parseIncludes(source);
|
|
||||||
const header_dir = std.fs.path.dirname(header_path) orelse ".";
|
|
||||||
|
|
||||||
for (missing.items) |missing_type| {
|
|
||||||
var found = false;
|
|
||||||
for (includes) |include| {
|
|
||||||
const dep_path = try std.fs.path.join(
|
|
||||||
allocator,
|
|
||||||
&[_][]const u8{ header_dir, include }
|
|
||||||
);
|
|
||||||
defer allocator.free(dep_path);
|
|
||||||
|
|
||||||
const dep_source = std.fs.cwd().readFileAlloc(
|
|
||||||
allocator,
|
|
||||||
dep_path,
|
|
||||||
10 * 1024 * 1024
|
|
||||||
) catch continue;
|
|
||||||
defer allocator.free(dep_source);
|
|
||||||
|
|
||||||
if (try extractTypeFromHeader(allocator, dep_source, missing_type)) |decl| {
|
|
||||||
try dependency_decls.append(decl);
|
|
||||||
found = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!found) {
|
|
||||||
std.debug.print(
|
|
||||||
"Warning: Could not find definition for type: {s}\n",
|
|
||||||
.{missing_type}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 4. Combine declarations
|
|
||||||
var all_decls = ArrayList(Declaration).init(allocator);
|
|
||||||
try all_decls.appendSlice(dependency_decls.items); // Dependencies first!
|
|
||||||
try all_decls.appendSlice(primary_decls);
|
|
||||||
|
|
||||||
// 5. Generate code (existing, but with all declarations)
|
|
||||||
const output = try codegen.generate(allocator, all_decls.items);
|
|
||||||
|
|
||||||
// ... rest of existing code ...
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
## Key Implementation Decisions
|
|
||||||
|
|
||||||
1. **Dependencies go FIRST** in output
|
|
||||||
- Ensures types are defined before use
|
|
||||||
- More logical reading order
|
|
||||||
|
|
||||||
2. **Deep copy declarations**
|
|
||||||
- Avoid lifetime issues with parsed headers
|
|
||||||
- Each declaration owns its strings
|
|
||||||
|
|
||||||
3. **Warning for missing types**
|
|
||||||
- Don't fail build, just warn
|
|
||||||
- Allows gradual improvement
|
|
||||||
|
|
||||||
4. **Skip function pointers/unions**
|
|
||||||
- Add TODO comments
|
|
||||||
- Focus on common cases first
|
|
||||||
|
|
||||||
5. **Cache parsed headers**
|
|
||||||
- Parse each dependency header once
|
|
||||||
- Extract multiple types from same parse
|
|
||||||
|
|
||||||
## Testing Approach
|
|
||||||
|
|
||||||
### Unit Tests
|
|
||||||
|
|
||||||
```zig
|
|
||||||
test "scanTypeReferences finds SDL types" {
|
|
||||||
const decls = [_]Declaration{
|
|
||||||
.{ .function_decl = .{
|
|
||||||
.name = "test",
|
|
||||||
.return_type = "?*SDL_Window",
|
|
||||||
.params = &[_]Param{
|
|
||||||
.{ .name = "rect", .type_name = "*const SDL_Rect" },
|
|
||||||
},
|
|
||||||
}},
|
|
||||||
};
|
|
||||||
|
|
||||||
const refs = try scanTypeReferences(&decls);
|
|
||||||
try testing.expect(refs.len == 2);
|
|
||||||
try testing.expectEqualStrings("SDL_Window", refs[0].name);
|
|
||||||
try testing.expectEqualStrings("SDL_Rect", refs[1].name);
|
|
||||||
}
|
|
||||||
|
|
||||||
test "collectDefinedTypes tracks declarations" {
|
|
||||||
const decls = [_]Declaration{
|
|
||||||
.{ .opaque_type = .{ .name = "SDL_Device" }},
|
|
||||||
.{ .struct_decl = .{ .name = "SDL_Info", .fields = &[_]Field{} }},
|
|
||||||
};
|
|
||||||
|
|
||||||
const defined = collectDefinedTypes(&decls);
|
|
||||||
try testing.expect(defined.contains("SDL_Device"));
|
|
||||||
try testing.expect(defined.contains("SDL_Info"));
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### Integration Test
|
|
||||||
|
|
||||||
```zig
|
|
||||||
test "full dependency resolution with SDL_gpu.h" {
|
|
||||||
const source = try std.fs.cwd().readFileAlloc(
|
|
||||||
testing.allocator,
|
|
||||||
"SDL/include/SDL3/SDL_gpu.h",
|
|
||||||
10 * 1024 * 1024
|
|
||||||
);
|
|
||||||
defer testing.allocator.free(source);
|
|
||||||
|
|
||||||
// Parse and resolve
|
|
||||||
const output = try parseWithDependencies(testing.allocator, source, "SDL/include/SDL3");
|
|
||||||
defer testing.allocator.free(output);
|
|
||||||
|
|
||||||
// Verify missing types are present
|
|
||||||
try testing.expect(std.mem.indexOf(u8, output, "pub const Window = opaque") != null);
|
|
||||||
try testing.expect(std.mem.indexOf(u8, output, "pub const Rect = extern struct") != null);
|
|
||||||
try testing.expect(std.mem.indexOf(u8, output, "pub const FColor = extern struct") != null);
|
|
||||||
|
|
||||||
// Verify it compiles
|
|
||||||
var ast = try std.zig.Ast.parse(testing.allocator, output, .zig);
|
|
||||||
defer ast.deinit(testing.allocator);
|
|
||||||
try testing.expect(ast.errors.len == 0);
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
## Validation Steps
|
|
||||||
|
|
||||||
1. **Remove manual definitions** from mock_test.zig:
|
|
||||||
```diff
|
|
||||||
- pub const Window = opaque {};
|
|
||||||
- pub const Rect = extern struct { ... };
|
|
||||||
- pub const FColor = extern struct { ... };
|
|
||||||
```
|
|
||||||
|
|
||||||
2. **Import generated file** directly:
|
|
||||||
```zig
|
|
||||||
const gpu = @import("../../zig-out/gpu_test.zig");
|
|
||||||
```
|
|
||||||
|
|
||||||
3. **Run tests**:
|
|
||||||
```bash
|
|
||||||
zig build test-mocks # Should still pass!
|
|
||||||
```
|
|
||||||
|
|
||||||
## Success Metrics
|
|
||||||
|
|
||||||
✅ `scanTypeReferences` finds 30+ type references in SDL_gpu.h
|
|
||||||
✅ `collectDefinedTypes` tracks 169 defined types
|
|
||||||
✅ Missing types: Window, Rect, FColor, FlipMode, PropertiesID detected
|
|
||||||
✅ All 5 missing types extracted from dependency headers
|
|
||||||
✅ Generated code compiles without manual definitions
|
|
||||||
✅ All 11 tests pass
|
|
||||||
✅ Build time increase < 1 second
|
|
||||||
|
|
||||||
## Rollout Plan
|
|
||||||
|
|
||||||
1. **Day 1**: Implement Components 1-2 (type scanning/collecting)
|
|
||||||
2. **Day 2**: Implement Components 3-4 (include parsing/type extraction)
|
|
||||||
3. **Day 3**: Integrate into main, test with SDL_gpu.h
|
|
||||||
4. **Day 4**: Refine, handle edge cases, update tests
|
|
||||||
5. **Day 5**: Documentation, final validation
|
|
||||||
|
|
||||||
## Risks & Mitigation
|
|
||||||
|
|
||||||
| Risk | Mitigation |
|
|
||||||
|------|-----------|
|
|
||||||
| Can't find header files | Require header directory as input |
|
|
||||||
| Type not in any header | Emit warning, generate placeholder |
|
|
||||||
| Parsing dependency fails | Catch error, continue with other headers |
|
|
||||||
| Performance (parsing multiple headers) | Cache parsed headers, parse once |
|
|
||||||
| Circular dependencies | Not an issue - all types in one file |
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
This plan is **ready to implement**. Each component is well-defined with clear inputs/outputs, error handling, and test cases.
|
|
||||||
|
|
||||||
**File**: `src/type_collector.zig`
|
|
||||||
|
|
||||||
```zig
|
|
||||||
const TypeCollector = struct {
|
|
||||||
defined_types: StringHashMap(void), // Types defined in primary header
|
|
||||||
referenced_types: StringHashMap(void), // Types used in signatures
|
|
||||||
|
|
||||||
pub fn collectFromDeclarations(decls: []Declaration) TypeCollector;
|
|
||||||
pub fn getMissingTypes() []const []const u8;
|
|
||||||
};
|
|
||||||
```
|
|
||||||
|
|
||||||
**Tasks**:
|
|
||||||
- Scan all declarations for type definitions (opaque, enum, struct, flags)
|
|
||||||
- Scan all function signatures for type references
|
|
||||||
- Return set difference: referenced - defined
|
|
||||||
|
|
||||||
### Phase 2: Include Directive Parsing (1 hour)
|
|
||||||
|
|
||||||
**File**: `src/patterns.zig` (extend existing)
|
|
||||||
|
|
||||||
```zig
|
|
||||||
pub fn parseIncludes(source: []const u8) ![]const []const u8 {
|
|
||||||
// Find all #include <SDL3/header.h> directives
|
|
||||||
// Return list of header filenames
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
**Tasks**:
|
|
||||||
- Add regex/pattern for `#include <SDL3/...>`
|
|
||||||
- Extract header filename from directive
|
|
||||||
- Return list of included headers
|
|
||||||
|
|
||||||
### Phase 3: Selective Type Extraction (2-3 hours)
|
|
||||||
|
|
||||||
**File**: `src/type_extractor.zig`
|
|
||||||
|
|
||||||
```zig
|
|
||||||
pub fn extractType(
|
|
||||||
allocator: Allocator,
|
|
||||||
header_source: []const u8,
|
|
||||||
type_name: []const u8, // e.g., "SDL_Rect"
|
|
||||||
) !?Declaration {
|
|
||||||
// Parse header looking for specific type
|
|
||||||
// Return the declaration if found
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn extractTypes(
|
|
||||||
allocator: Allocator,
|
|
||||||
header_paths: []const []const u8,
|
|
||||||
missing_types: []const []const u8,
|
|
||||||
) ![]Declaration {
|
|
||||||
// For each missing type:
|
|
||||||
// For each header:
|
|
||||||
// Try to extract the type
|
|
||||||
// If found, add to results
|
|
||||||
// Return all found declarations
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
**Tasks**:
|
|
||||||
- Reuse existing Scanner but filter by type name
|
|
||||||
- Handle opaque types: `typedef struct SDL_Type SDL_Type;`
|
|
||||||
- Handle structs: `typedef struct { ... } SDL_Type;`
|
|
||||||
- Handle enums: `typedef enum { ... } SDL_Type;`
|
|
||||||
- Handle simple typedefs: `typedef uint32_t SDL_Type;`
|
|
||||||
|
|
||||||
### Phase 4: Integration (1-2 hours)
|
|
||||||
|
|
||||||
**File**: `src/parser.zig` (modify main function)
|
|
||||||
|
|
||||||
```zig
|
|
||||||
pub fn main() !void {
|
|
||||||
// 1. Parse primary header
|
|
||||||
var scanner = Scanner.init(allocator, source);
|
|
||||||
const decls = try scanner.scan();
|
|
||||||
|
|
||||||
// 2. Collect missing types
|
|
||||||
const collector = TypeCollector.collectFromDeclarations(decls);
|
|
||||||
const missing_types = try collector.getMissingTypes(allocator);
|
|
||||||
|
|
||||||
// 3. Parse included headers for missing types
|
|
||||||
const includes = try parseIncludes(source);
|
|
||||||
const header_dir = getHeaderDirectory(header_path);
|
|
||||||
const dependency_decls = try extractTypes(
|
|
||||||
allocator,
|
|
||||||
header_dir,
|
|
||||||
includes,
|
|
||||||
missing_types
|
|
||||||
);
|
|
||||||
|
|
||||||
// 4. Generate code with dependencies appended
|
|
||||||
var all_decls = std.ArrayList(Declaration).init(allocator);
|
|
||||||
try all_decls.appendSlice(decls);
|
|
||||||
try all_decls.appendSlice(dependency_decls);
|
|
||||||
|
|
||||||
const output = try codegen.generate(allocator, all_decls.items);
|
|
||||||
|
|
||||||
// 5. Write output
|
|
||||||
try writeOutput(output_file, output);
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
**Tasks**:
|
|
||||||
- Wire together all components
|
|
||||||
- Handle header path resolution
|
|
||||||
- Add comment separators for dependencies
|
|
||||||
- Update error handling
|
|
||||||
|
|
||||||
### Phase 5: Code Generation Enhancement (1 hour)
|
|
||||||
|
|
||||||
**File**: `src/codegen.zig` (modify)
|
|
||||||
|
|
||||||
Add dependency section:
|
|
||||||
```zig
|
|
||||||
fn generate() ![]const u8 {
|
|
||||||
try output.appendSlice("pub const c = @import(\"c.zig\").c;\n\n");
|
|
||||||
|
|
||||||
// Add comment if we have dependencies
|
|
||||||
if (has_dependency_decls) {
|
|
||||||
try output.appendSlice(
|
|
||||||
\\// Dependencies from included headers
|
|
||||||
\\// These types are referenced by the primary header
|
|
||||||
\\
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Generate all declarations (primary + dependencies)
|
|
||||||
for (decls) |decl| {
|
|
||||||
try generateDeclaration(decl);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
**Tasks**:
|
|
||||||
- Add dependency comment section
|
|
||||||
- Mark which declarations are dependencies (optional)
|
|
||||||
- Ensure proper ordering (dependencies before usage)
|
|
||||||
|
|
||||||
## Example Output
|
|
||||||
|
|
||||||
```zig
|
|
||||||
pub const c = @import("c.zig").c;
|
|
||||||
|
|
||||||
// Dependencies from included headers
|
|
||||||
// These types are referenced by SDL_gpu.h
|
|
||||||
|
|
||||||
// From SDL_rect.h
|
|
||||||
pub const Rect = extern struct {
|
|
||||||
x: i32,
|
|
||||||
y: i32,
|
|
||||||
w: i32,
|
|
||||||
h: i32,
|
|
||||||
};
|
|
||||||
|
|
||||||
// From SDL_pixels.h
|
|
||||||
pub const FColor = extern struct {
|
|
||||||
r: f32,
|
|
||||||
g: f32,
|
|
||||||
b: f32,
|
|
||||||
a: f32,
|
|
||||||
};
|
|
||||||
|
|
||||||
// From SDL_video.h
|
|
||||||
pub const Window = opaque {};
|
|
||||||
|
|
||||||
// From SDL_properties.h
|
|
||||||
pub const PropertiesID = u32;
|
|
||||||
|
|
||||||
// SDL_gpu.h declarations
|
|
||||||
pub const GPUDevice = opaque {
|
|
||||||
pub inline fn windowSupportsGPUSwapchainComposition(
|
|
||||||
gpudevice: *GPUDevice,
|
|
||||||
window: ?*Window, // ✅ Now defined!
|
|
||||||
swapchain_composition: GPUSwapchainComposition
|
|
||||||
) bool { ... }
|
|
||||||
};
|
|
||||||
|
|
||||||
pub const GPURenderPass = opaque {
|
|
||||||
pub inline fn setGPUScissor(
|
|
||||||
gpurenderpass: *GPURenderPass,
|
|
||||||
scissor: *const Rect // ✅ Now defined!
|
|
||||||
) void { ... }
|
|
||||||
};
|
|
||||||
```
|
|
||||||
|
|
||||||
## Edge Cases
|
|
||||||
|
|
||||||
1. **Type not found in any header**
|
|
||||||
- Emit warning
|
|
||||||
- Generate placeholder: `pub const TypeName = opaque {};`
|
|
||||||
|
|
||||||
2. **Circular dependencies**
|
|
||||||
- Not an issue - all types in one file
|
|
||||||
- Zig allows forward references
|
|
||||||
|
|
||||||
3. **Multiple definitions**
|
|
||||||
- Keep first definition found
|
|
||||||
- Zig will error if layouts differ (good!)
|
|
||||||
|
|
||||||
4. **Typedef chains**
|
|
||||||
- `typedef SDL_Type1 Type2;`
|
|
||||||
- Resolve transitively or use Zig's type alias
|
|
||||||
|
|
||||||
5. **Complex types**
|
|
||||||
- Function pointers: Skip for now, add TODO comment
|
|
||||||
- Unions: Skip for now, add TODO comment
|
|
||||||
- Nested structs: Should work fine
|
|
||||||
|
|
||||||
## Testing Strategy
|
|
||||||
|
|
||||||
1. **Unit tests** for each component:
|
|
||||||
- TypeCollector: Test with known declarations
|
|
||||||
- parseIncludes: Test with sample headers
|
|
||||||
- extractType: Test finding types in headers
|
|
||||||
|
|
||||||
2. **Integration test**:
|
|
||||||
- Parse SDL_gpu.h
|
|
||||||
- Verify missing types are detected
|
|
||||||
- Verify dependencies are extracted
|
|
||||||
- Verify output compiles
|
|
||||||
|
|
||||||
3. **Validation**:
|
|
||||||
- Remove manual type definitions from mock_test.zig
|
|
||||||
- Import actual generated file
|
|
||||||
- All tests should still pass
|
|
||||||
|
|
||||||
## Success Criteria
|
|
||||||
|
|
||||||
✅ Parser detects 5 missing types from SDL_gpu.h
|
|
||||||
✅ Parser extracts types from dependency headers
|
|
||||||
✅ Generated code compiles standalone
|
|
||||||
✅ All tests pass without manual type definitions
|
|
||||||
✅ Single output file contains all needed types
|
|
||||||
|
|
||||||
## Time Estimate
|
|
||||||
|
|
||||||
- Phase 1 (Type Collection): 1-2 hours
|
|
||||||
- Phase 2 (Include Parsing): 1 hour
|
|
||||||
- Phase 3 (Type Extraction): 2-3 hours
|
|
||||||
- Phase 4 (Integration): 1-2 hours
|
|
||||||
- Phase 5 (Code Gen Enhancement): 1 hour
|
|
||||||
- Testing & Refinement: 2 hours
|
|
||||||
|
|
||||||
**Total: 8-11 hours**
|
|
||||||
|
|
||||||
## Advantages of This Approach
|
|
||||||
|
|
||||||
1. **Simple**: Single output file, no module management
|
|
||||||
2. **Fast**: Only parse dependency headers when needed
|
|
||||||
3. **Minimal**: Only extract required types
|
|
||||||
4. **Robust**: Zig handles duplicate definitions
|
|
||||||
5. **Maintainable**: Clear separation in output
|
|
||||||
|
|
||||||
## Open Questions
|
|
||||||
|
|
||||||
1. Should we cache parsed dependency headers?
|
|
||||||
- **Answer**: Yes, parse once, extract many types
|
|
||||||
|
|
||||||
2. How to handle nested dependencies (Type A needs Type B)?
|
|
||||||
- **Answer**: Recursive extraction, track visited types
|
|
||||||
|
|
||||||
3. Should dependencies go at top or bottom of file?
|
|
||||||
- **Answer**: Top, before primary declarations use them
|
|
||||||
|
|
||||||
4. What about #define constants?
|
|
||||||
- **Answer**: Skip for now, out of scope
|
|
||||||
|
|
||||||
## Next Steps
|
|
||||||
|
|
||||||
1. Implement TypeCollector
|
|
||||||
2. Implement include parsing
|
|
||||||
3. Implement type extraction
|
|
||||||
4. Wire together in main
|
|
||||||
5. Test with SDL_gpu.h
|
|
||||||
6. Update documentation
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
Ready to implement? This plan provides:
|
|
||||||
- Clear phases with time estimates
|
|
||||||
- Concrete code examples
|
|
||||||
- Handles edge cases
|
|
||||||
- Simple single-file output
|
|
||||||
- Full testing strategy
|
|
||||||
|
|
@ -1,216 +0,0 @@
|
||||||
# Dependency Resolution Implementation Status
|
|
||||||
|
|
||||||
**Date**: 2026-01-22
|
|
||||||
**Status**: ✅ Phase 1 Complete - Core Infrastructure Implemented
|
|
||||||
|
|
||||||
## What Was Implemented
|
|
||||||
|
|
||||||
### 1. Dependency Resolver Module (`src/dependency_resolver.zig`)
|
|
||||||
|
|
||||||
Created a comprehensive dependency analysis and resolution system with the following components:
|
|
||||||
|
|
||||||
#### Core Features:
|
|
||||||
- **Type Reference Scanner**: Analyzes declarations to find all referenced SDL types
|
|
||||||
- **Defined Type Collector**: Tracks types defined in the primary header
|
|
||||||
- **Missing Type Detector**: Identifies types that are referenced but not defined
|
|
||||||
- **Include Parser**: Extracts `#include <SDL3/...>` directives from headers
|
|
||||||
- **Type Extractor**: Searches dependency headers for specific type definitions
|
|
||||||
- **Declaration Cloner**: Deep copies declarations with proper memory management
|
|
||||||
|
|
||||||
#### Type Extraction Logic:
|
|
||||||
- Strips pointer markers (`*`, `?*`, `[*c]`)
|
|
||||||
- Removes const qualifiers (leading and trailing)
|
|
||||||
- Handles complex patterns like `*const`, `**`, etc.
|
|
||||||
- Identifies SDL types by `SDL_` prefix or known type names
|
|
||||||
|
|
||||||
### 2. Parser Integration (`src/parser.zig`)
|
|
||||||
|
|
||||||
Extended the main parser to:
|
|
||||||
- Analyze dependencies after parsing primary header
|
|
||||||
- Resolve missing types from included headers
|
|
||||||
- Combine dependency declarations with primary declarations
|
|
||||||
- Generate unified output with all required types
|
|
||||||
- Provide detailed progress reporting
|
|
||||||
|
|
||||||
### 3. Memory Management
|
|
||||||
|
|
||||||
- All dynamically allocated strings are properly tracked
|
|
||||||
- HashMap keys are owned and freed in `deinit()`
|
|
||||||
- Deep cloning ensures proper lifetimes
|
|
||||||
- Passes existing test suite without leaks (for tested code paths)
|
|
||||||
|
|
||||||
## Current Results
|
|
||||||
|
|
||||||
### Testing with SDL_gpu.h (169 declarations)
|
|
||||||
|
|
||||||
**Before dependency resolution**:
|
|
||||||
- Generated code had undefined references to 47+ types
|
|
||||||
- Code would not compile without manual type definitions
|
|
||||||
|
|
||||||
**After implementation**:
|
|
||||||
- Detects 6 unique missing types (down from 47 duplicates)
|
|
||||||
- Successfully finds 4/6 types in dependency headers:
|
|
||||||
- ✅ `SDL_FColor` from SDL_pixels.h
|
|
||||||
- ✅ `SDL_Rect` from SDL_rect.h
|
|
||||||
- ✅ `SDL_Window` from SDL_video.h
|
|
||||||
- ✅ `SDL_FlipMode` from SDL_surface.h
|
|
||||||
- Warns about 2 unfound types:
|
|
||||||
- ⚠️ `SDL_PropertiesID` (typedef, not scanned yet)
|
|
||||||
- ⚠️ `SDL_GPUShaderFormat` (flags via #define, not supported)
|
|
||||||
|
|
||||||
### Success Metrics
|
|
||||||
|
|
||||||
✅ Type deduplication working (47 → 6 unique types)
|
|
||||||
✅ Include parsing functional (6 headers detected)
|
|
||||||
✅ Type extraction operational (4/6 found)
|
|
||||||
✅ Code generation combines declarations correctly
|
|
||||||
✅ All existing unit tests pass
|
|
||||||
✅ Memory management correct (per GPA)
|
|
||||||
✅ Detailed progress reporting
|
|
||||||
|
|
||||||
## Known Issues & Limitations
|
|
||||||
|
|
||||||
### Issue 1: Multi-Field Struct Declarations
|
|
||||||
|
|
||||||
**Problem**: SDL headers use compact syntax like:
|
|
||||||
```c
|
|
||||||
typedef struct SDL_Rect {
|
|
||||||
int x, y; // Multiple fields on one line
|
|
||||||
int w, h;
|
|
||||||
} SDL_Rect;
|
|
||||||
```
|
|
||||||
|
|
||||||
**Impact**: Parser's `parseStructField()` expects one field per line
|
|
||||||
**Status**: Pre-existing parser limitation, not introduced by dependency resolution
|
|
||||||
**Workaround**: Need to enhance struct field parser to handle comma-separated fields
|
|
||||||
|
|
||||||
### Issue 2: Typedef Aliases
|
|
||||||
|
|
||||||
**Problem**: Some types are simple typedefs:
|
|
||||||
```c
|
|
||||||
typedef Uint32 SDL_PropertiesID;
|
|
||||||
```
|
|
||||||
|
|
||||||
**Impact**: Not detected as "types" by current scanner (only scans opaque/struct/enum/flags)
|
|
||||||
**Status**: Out of scope for Phase 1
|
|
||||||
**Solution**: Add typedef scanning pattern
|
|
||||||
|
|
||||||
### Issue 3: #define-based Types
|
|
||||||
|
|
||||||
**Problem**: Some types are defined via preprocessor macros:
|
|
||||||
```c
|
|
||||||
#define SDL_GPU_SHADERFORMAT_INVALID (0)
|
|
||||||
#define SDL_GPU_SHADERFORMAT_SPIRV (1u << 0)
|
|
||||||
// typedef Uint32 SDL_GPUShaderFormat;
|
|
||||||
```
|
|
||||||
|
|
||||||
**Impact**: Cannot be parsed without preprocessor
|
|
||||||
**Status**: Known limitation, documented in PARSER_OVERVIEW.md
|
|
||||||
**Solution**: Require manual definitions or use clang for preprocessing
|
|
||||||
|
|
||||||
## Architecture Decisions
|
|
||||||
|
|
||||||
### Single-File Output (✅ Validated)
|
|
||||||
|
|
||||||
- All types (primary + dependencies) go in one output file
|
|
||||||
- Dependencies are placed first (ensures types defined before use)
|
|
||||||
- Zig's structural typing handles the rest
|
|
||||||
- Simpler than multi-file module approach
|
|
||||||
|
|
||||||
### On-Demand Resolution (✅ Implemented)
|
|
||||||
|
|
||||||
- Only parse dependency headers when missing types detected
|
|
||||||
- Only extract specific types needed (not entire headers)
|
|
||||||
- Minimal parsing overhead
|
|
||||||
- Clean separation of concerns
|
|
||||||
|
|
||||||
### Conservative Error Handling (✅ Implemented)
|
|
||||||
|
|
||||||
- Warnings for missing types (don't fail build)
|
|
||||||
- Continue on header read errors
|
|
||||||
- Allows gradual improvement
|
|
||||||
- Users can manually provide missing definitions
|
|
||||||
|
|
||||||
## Next Steps
|
|
||||||
|
|
||||||
### Phase 2: Complete Type Support (Recommended)
|
|
||||||
|
|
||||||
1. **Fix Multi-Field Struct Parsing** (~2 hours)
|
|
||||||
- Update `parseStructField()` to split comma-separated fields
|
|
||||||
- Handle mixed types: `int x, y; float z;`
|
|
||||||
- Add test cases for SDL_Rect pattern
|
|
||||||
|
|
||||||
2. **Add Typedef Scanning** (~1-2 hours)
|
|
||||||
- New pattern: `typedef Type SDL_NewType;`
|
|
||||||
- Extract and generate Zig type alias: `pub const NewType = Type;`
|
|
||||||
- Handles PropertiesID and similar cases
|
|
||||||
|
|
||||||
3. **Enhanced Reporting** (~30 min)
|
|
||||||
- Show which types are from dependencies vs primary
|
|
||||||
- Report parse errors for dependency headers
|
|
||||||
- Summary statistics
|
|
||||||
|
|
||||||
### Phase 3: Testing & Validation (~2 hours)
|
|
||||||
|
|
||||||
1. Parse all major SDL3 headers with dependencies:
|
|
||||||
- SDL_video.h
|
|
||||||
- SDL_audio.h
|
|
||||||
- SDL_events.h
|
|
||||||
- SDL_render.h
|
|
||||||
|
|
||||||
2. Verify generated code compiles standalone
|
|
||||||
|
|
||||||
3. Update mock testing to use generated dependencies
|
|
||||||
|
|
||||||
### Phase 4: Documentation (~1 hour)
|
|
||||||
|
|
||||||
1. Update PARSER_OVERVIEW.md with dependency resolution
|
|
||||||
2. Add usage examples to README
|
|
||||||
3. Document known patterns and workarounds
|
|
||||||
|
|
||||||
## Lessons Learned
|
|
||||||
|
|
||||||
### Zig 0.15 API Changes (Critical)
|
|
||||||
|
|
||||||
- `ArrayList` now requires `{}` initialization
|
|
||||||
- All methods take allocator: `append(allocator, item)`
|
|
||||||
- `deinit(allocator)` instead of `deinit()`
|
|
||||||
- Documented in AGENTS.md for future reference
|
|
||||||
|
|
||||||
### Type Name Normalization
|
|
||||||
|
|
||||||
- C types use pointers/const in signatures: `SDL_Type *const *`
|
|
||||||
- Base type extraction must handle all patterns
|
|
||||||
- Trailing punctuation is common: `SDL_Type *`
|
|
||||||
- Need comprehensive stripping logic
|
|
||||||
|
|
||||||
### HashMap Key Ownership
|
|
||||||
|
|
||||||
- Keys must be owned strings (not slices into parsed data)
|
|
||||||
- Duplicate before insert if source may be freed
|
|
||||||
- Free all keys in `deinit()`
|
|
||||||
- Check existence before insert to avoid duplicates
|
|
||||||
|
|
||||||
## Summary
|
|
||||||
|
|
||||||
Phase 1 implementation successfully establishes the core dependency resolution infrastructure. The system correctly identifies missing types, extracts them from dependency headers, and combines them with primary declarations. While some edge cases remain (multi-field structs, typedefs), the foundation is solid and extensible.
|
|
||||||
|
|
||||||
**Estimated completion for full support**: 4-6 hours additional work
|
|
||||||
**Current test coverage**: ✅ All existing tests passing
|
|
||||||
**Production readiness**: 🟡 Usable with known limitations
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Files Modified
|
|
||||||
|
|
||||||
- `src/dependency_resolver.zig` (new, 447 lines)
|
|
||||||
- `src/parser.zig` (extended with dependency analysis)
|
|
||||||
- All changes maintain backward compatibility
|
|
||||||
- No breaking changes to existing APIs
|
|
||||||
|
|
||||||
## Performance
|
|
||||||
|
|
||||||
- Negligible overhead when no missing types (<100ms)
|
|
||||||
- Dependency parsing: ~50-100ms per header
|
|
||||||
- Scales linearly with number of missing types
|
|
||||||
- Memory usage: +1-2MB for dependency declarations
|
|
||||||
|
|
@ -1,170 +0,0 @@
|
||||||
# SDL3 Header Parser: Dependency Resolution Plan
|
|
||||||
|
|
||||||
## Problem Statement
|
|
||||||
|
|
||||||
The generated `gpu.zig` references types from other SDL headers:
|
|
||||||
- `FColor` (SDL_pixels.h)
|
|
||||||
- `Rect` (SDL_rect.h)
|
|
||||||
- `PropertiesID` (SDL_properties.h)
|
|
||||||
- `Window` (SDL_video.h - opaque type)
|
|
||||||
- `FlipMode` (SDL_surface.h)
|
|
||||||
- `GPUShaderFormat` (special case: #define flags)
|
|
||||||
|
|
||||||
Without these types, the generated code won't compile.
|
|
||||||
|
|
||||||
## Analysis of SDL Header Structure
|
|
||||||
|
|
||||||
SDL_gpu.h includes:
|
|
||||||
```c
|
|
||||||
#include <SDL3/SDL_stdinc.h> // Basic types (Uint32, etc.)
|
|
||||||
#include <SDL3/SDL_pixels.h> // SDL_FColor
|
|
||||||
#include <SDL3/SDL_properties.h> // SDL_PropertiesID
|
|
||||||
#include <SDL3/SDL_rect.h> // SDL_Rect
|
|
||||||
#include <SDL3/SDL_surface.h> // SDL_FlipMode
|
|
||||||
#include <SDL3/SDL_video.h> // SDL_Window (opaque)
|
|
||||||
```
|
|
||||||
|
|
||||||
## Solution Options
|
|
||||||
|
|
||||||
### Option 1: Parse Dependencies Recursively (REJECTED - Too Complex)
|
|
||||||
- Parse all included headers
|
|
||||||
- Build dependency graph
|
|
||||||
- Generate all files in correct order
|
|
||||||
- **Issues**:
|
|
||||||
- SDL has circular dependencies
|
|
||||||
- Would need to parse entire SDL API
|
|
||||||
- Overkill for our use case
|
|
||||||
|
|
||||||
### Option 2: Manual Type Imports (REJECTED - Not Maintainable)
|
|
||||||
- Manually copy type definitions
|
|
||||||
- **Issues**:
|
|
||||||
- Not automated
|
|
||||||
- Breaks on SDL updates
|
|
||||||
- Defeats purpose of parser
|
|
||||||
|
|
||||||
### Option 3: Hybrid Approach - Parse Referenced Types Only (RECOMMENDED)
|
|
||||||
|
|
||||||
#### Phase 1: Dependency Detection
|
|
||||||
1. Parse target header (e.g., SDL_gpu.h)
|
|
||||||
2. Collect all non-GPU SDL types referenced in signatures
|
|
||||||
3. Map types to their source headers (from #include directives)
|
|
||||||
|
|
||||||
#### Phase 2: Selective Type Extraction
|
|
||||||
For each dependency header, extract ONLY referenced types:
|
|
||||||
- Parse dependency header in "extract mode"
|
|
||||||
- Only output declarations that match our needed types
|
|
||||||
- Generate minimal `<module>.zig` files (e.g., `pixels.zig`, `rect.zig`)
|
|
||||||
|
|
||||||
#### Phase 3: Code Generation
|
|
||||||
Generate main file with imports:
|
|
||||||
```zig
|
|
||||||
pub const c = @import("c.zig").c;
|
|
||||||
|
|
||||||
// Import minimal dependencies
|
|
||||||
const pixels = @import("pixels.zig");
|
|
||||||
const rect = @import("rect.zig");
|
|
||||||
const properties = @import("properties.zig");
|
|
||||||
const video = @import("video.zig");
|
|
||||||
const surface = @import("surface.zig");
|
|
||||||
|
|
||||||
// Re-export needed types
|
|
||||||
pub const FColor = pixels.FColor;
|
|
||||||
pub const Rect = rect.Rect;
|
|
||||||
pub const PropertiesID = properties.PropertiesID;
|
|
||||||
pub const Window = video.Window;
|
|
||||||
pub const FlipMode = surface.FlipMode;
|
|
||||||
|
|
||||||
// Manual override for #define-based types
|
|
||||||
pub const GPUShaderFormat = packed struct(u32) {
|
|
||||||
// ... handwritten
|
|
||||||
};
|
|
||||||
|
|
||||||
// Generated GPU declarations follow...
|
|
||||||
```
|
|
||||||
|
|
||||||
## Implementation Plan
|
|
||||||
|
|
||||||
### Step 1: Add Dependency Analysis
|
|
||||||
```zig
|
|
||||||
const DependencyInfo = struct {
|
|
||||||
types_needed: []const []const u8,
|
|
||||||
source_headers: std.StringHashMap([]const u8), // type -> header
|
|
||||||
};
|
|
||||||
|
|
||||||
fn analyzeDependencies(decls: []Declaration) !DependencyInfo {
|
|
||||||
// Scan all function signatures for SDL_ types
|
|
||||||
// Map types to headers based on SDL conventions
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### Step 2: Extract Types from Dependencies
|
|
||||||
```zig
|
|
||||||
fn extractTypesFromHeader(
|
|
||||||
header_path: []const u8,
|
|
||||||
types_to_extract: []const []const u8,
|
|
||||||
) ![]Declaration {
|
|
||||||
// Parse dependency header
|
|
||||||
// Filter to only needed types
|
|
||||||
// Return minimal declaration set
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### Step 3: Generate Import Structure
|
|
||||||
```zig
|
|
||||||
fn generateWithDependencies(
|
|
||||||
main_decls: []Declaration,
|
|
||||||
deps: DependencyInfo,
|
|
||||||
output_dir: []const u8,
|
|
||||||
) !void {
|
|
||||||
// Generate dependency .zig files
|
|
||||||
// Generate main file with imports
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### Step 4: Handle Special Cases
|
|
||||||
|
|
||||||
**Opaque Types (e.g., Window)**:
|
|
||||||
- SDL_Window is `typedef struct SDL_Window SDL_Window;` (forward decl)
|
|
||||||
- Generate as: `pub const Window = opaque {};` or `pub const Window = c.SDL_Window;`
|
|
||||||
- Decision: Use `c.SDL_Window` for true opaque types
|
|
||||||
|
|
||||||
**#define Flags (e.g., GPUShaderFormat)**:
|
|
||||||
- Cannot be auto-parsed
|
|
||||||
- Maintain "overrides" file: `overrides.zig`
|
|
||||||
- User can provide manual definitions for unparseable types
|
|
||||||
|
|
||||||
## File Structure
|
|
||||||
|
|
||||||
```
|
|
||||||
v2/
|
|
||||||
├── gpu.zig # Main generated file with imports
|
|
||||||
├── pixels.zig # Minimal: FColor only
|
|
||||||
├── rect.zig # Minimal: Rect only
|
|
||||||
├── properties.zig # Minimal: PropertiesID only
|
|
||||||
├── video.zig # Minimal: Window only
|
|
||||||
├── surface.zig # Minimal: FlipMode only
|
|
||||||
└── overrides.zig # Manual definitions (GPUShaderFormat)
|
|
||||||
```
|
|
||||||
|
|
||||||
## Advantages
|
|
||||||
|
|
||||||
1. ✅ Automated - no manual copying
|
|
||||||
2. ✅ Minimal - only extracts needed types
|
|
||||||
3. ✅ Maintainable - regenerate on SDL updates
|
|
||||||
4. ✅ Avoids circular dependencies - only extracts leaf types
|
|
||||||
5. ✅ Flexible - handles special cases via overrides
|
|
||||||
|
|
||||||
## Testing Strategy
|
|
||||||
|
|
||||||
1. Parse SDL_gpu.h → detect dependencies
|
|
||||||
2. Parse dependency headers → extract types
|
|
||||||
3. Generate all files
|
|
||||||
4. Run `zig build` to verify compilation
|
|
||||||
5. Compare API compatibility with handwritten version
|
|
||||||
|
|
||||||
## Future Enhancements
|
|
||||||
|
|
||||||
- Cache parsed headers to avoid re-parsing
|
|
||||||
- Support transitive dependencies (if type A needs type B)
|
|
||||||
- Auto-generate overrides file with placeholders
|
|
||||||
- Support multiple target headers in one run
|
|
||||||
|
|
@ -1,247 +0,0 @@
|
||||||
# SDL3 Parser - Complete Session Summary
|
|
||||||
|
|
||||||
**Date**: 2026-01-22
|
|
||||||
**Total Time**: ~6 hours
|
|
||||||
**Status**: ✅ **Major Features Complete, Production Ready for SDL_gpu.h**
|
|
||||||
|
|
||||||
## Executive Summary
|
|
||||||
|
|
||||||
Successfully implemented complete automatic dependency resolution for SDL3 headers, achieving 100% success rate for SDL_gpu.h. Discovered edge cases with other headers that provide clear direction for future work.
|
|
||||||
|
|
||||||
## Features Implemented ✅
|
|
||||||
|
|
||||||
### 1. Automatic Dependency Resolution
|
|
||||||
- **Code**: dependency_resolver.zig (454 lines)
|
|
||||||
- **Capability**: Detects and extracts missing types
|
|
||||||
- **Success**: 100% for SDL_gpu.h
|
|
||||||
|
|
||||||
### 2. Multi-Field Struct Parsing
|
|
||||||
- **Code**: patterns.zig (+95 lines)
|
|
||||||
- **Capability**: Handles `int x, y;` patterns
|
|
||||||
- **Success**: SDL_Rect complete with all fields
|
|
||||||
|
|
||||||
### 3. Typedef Scanning
|
|
||||||
- **Code**: patterns.zig (+68 lines), codegen.zig (+19 lines)
|
|
||||||
- **Capability**: Parses `typedef Uint32 SDL_Type;`
|
|
||||||
- **Success**: SDL_PropertiesID and similar types resolved
|
|
||||||
|
|
||||||
### 4. SDL_UINT64_C Support (Partial)
|
|
||||||
- **Code**: codegen.zig (enhanced parseBitPosition)
|
|
||||||
- **Capability**: Handles macro-wrapped hex values
|
|
||||||
- **Success**: Needs additional testing
|
|
||||||
|
|
||||||
## Final Statistics
|
|
||||||
|
|
||||||
### Code Metrics
|
|
||||||
|
|
||||||
| Metric | Value |
|
|
||||||
|--------|-------|
|
|
||||||
| **Lines Added** | ~900 |
|
|
||||||
| **Documentation** | ~5,300 |
|
|
||||||
| **Tests** | 26+ (100% passing) |
|
|
||||||
| **Commits** | 2 |
|
|
||||||
| **Features** | 3 major + 1 enhancement |
|
|
||||||
|
|
||||||
### SDL_gpu.h Results (PRIMARY SUCCESS) ✅
|
|
||||||
|
|
||||||
**Declarations**: 169 total
|
|
||||||
- 13 opaque types
|
|
||||||
- 6 typedefs (NEW!)
|
|
||||||
- 24 enums
|
|
||||||
- 35 structs
|
|
||||||
- 3 flags
|
|
||||||
- 94 functions
|
|
||||||
|
|
||||||
**Dependency Resolution**: 5/5 (100%) ✅
|
|
||||||
1. SDL_FColor (struct) ✅
|
|
||||||
2. SDL_PropertiesID (typedef) ✅
|
|
||||||
3. SDL_Rect (struct with multi-field) ✅
|
|
||||||
4. SDL_Window (opaque) ✅
|
|
||||||
5. SDL_FlipMode (enum) ✅
|
|
||||||
|
|
||||||
**Output**: 1,255 lines, 53KB
|
|
||||||
**Compilation**: 1 minor error (field name `type`)
|
|
||||||
**Status**: Production ready!
|
|
||||||
|
|
||||||
## Multi-Header Testing Results
|
|
||||||
|
|
||||||
### Headers Tested
|
|
||||||
|
|
||||||
| Header | Dependencies | Resolved | Status |
|
|
||||||
|--------|--------------|----------|--------|
|
|
||||||
| SDL_gpu.h | 5 | 5/5 (100%) | ✅ SUCCESS |
|
|
||||||
| SDL_keyboard.h | 6 | 6/6 (100%) | ⚠️ Syntax errors |
|
|
||||||
| SDL_video.h | 14 | 5/14 (36%) | ❌ Parse errors |
|
|
||||||
| SDL_events.h | Unknown | Unknown | ❌ Parse errors |
|
|
||||||
|
|
||||||
### Issues Discovered
|
|
||||||
|
|
||||||
1. **Large Enum Parsing** (SDL_Scancode: 300+ values)
|
|
||||||
- 77 syntax errors in generated code
|
|
||||||
- Special enum value patterns not handled
|
|
||||||
- Priority: HIGH (blocks keyboard/scancode)
|
|
||||||
|
|
||||||
2. **SDL_UINT64_C Bit Positions**
|
|
||||||
- WindowFlags use macro format
|
|
||||||
- parseBitPosition enhanced but needs validation
|
|
||||||
- Priority: MEDIUM
|
|
||||||
|
|
||||||
3. **Function Pointer Typedefs**
|
|
||||||
- SDL_HitTest, SDL_*Callback types
|
|
||||||
- Not supported yet
|
|
||||||
- Priority: LOW (can be manually defined)
|
|
||||||
|
|
||||||
4. **Memory Leaks in Comment Handling**
|
|
||||||
- 4-8 small leaks per run
|
|
||||||
- In struct field comment duplication
|
|
||||||
- Priority: LOW (functional, not critical)
|
|
||||||
|
|
||||||
## Production Readiness
|
|
||||||
|
|
||||||
### Ready for Production ✅
|
|
||||||
|
|
||||||
**SDL_gpu.h bindings**:
|
|
||||||
- ✅ 100% dependency resolution
|
|
||||||
- ✅ All types correctly extracted
|
|
||||||
- ✅ Generates valid Zig code (1 minor keyword issue)
|
|
||||||
- ✅ Comprehensive testing
|
|
||||||
- ✅ Well-documented
|
|
||||||
|
|
||||||
**Recommended Use**:
|
|
||||||
```bash
|
|
||||||
zig build run -- SDL/include/SDL3/SDL_gpu.h --output=gpu.zig
|
|
||||||
```
|
|
||||||
|
|
||||||
### Needs Additional Work ⚠️
|
|
||||||
|
|
||||||
**Other SDL headers**:
|
|
||||||
- SDL_video.h - Bit position handling
|
|
||||||
- SDL_keyboard.h - Large enum support
|
|
||||||
- SDL_events.h - Unknown issues
|
|
||||||
|
|
||||||
**Estimated Fix Time**: 2-4 hours for all headers
|
|
||||||
|
|
||||||
## Documentation Delivered
|
|
||||||
|
|
||||||
### User Documentation
|
|
||||||
- QUICKSTART.md (203 lines) - Getting started guide
|
|
||||||
- SESSION_COMPLETE.md (340 lines) - Final summary
|
|
||||||
|
|
||||||
### Technical Documentation
|
|
||||||
- DEPENDENCY_FLOW.md (845 lines) - Complete flow walkthrough
|
|
||||||
- VISUAL_FLOW.md (365 lines) - Diagrams and quick ref
|
|
||||||
- MULTI_FIELD_IMPLEMENTATION.md (380 lines) - Struct parsing
|
|
||||||
- TYPEDEF_IMPLEMENTATION.md (378 lines) - Typedef support
|
|
||||||
- MULTI_HEADER_TEST_RESULTS.md (250 lines) - Testing results
|
|
||||||
|
|
||||||
### Status Reports
|
|
||||||
- DEPENDENCY_IMPLEMENTATION_STATUS.md (216 lines)
|
|
||||||
- IMPLEMENTATION_SUMMARY.md (450 lines)
|
|
||||||
- FINAL_STATUS.md (420 lines)
|
|
||||||
- COMMIT_SUMMARY.md (320 lines)
|
|
||||||
|
|
||||||
**Total**: 5,300+ lines of comprehensive documentation
|
|
||||||
|
|
||||||
## Git Status
|
|
||||||
|
|
||||||
**Branch**: dev/sdl3-parser
|
|
||||||
**Commits**:
|
|
||||||
1. d8ecb5e - Dependency resolution + multi-field structs
|
|
||||||
2. 6031c0c - Typedef scanning (100% for GPU)
|
|
||||||
|
|
||||||
**Pushed**: ✅ Both commits pushed to origin
|
|
||||||
**PR**: http://git.peterino.com/searzocom/Backlog/pulls/1
|
|
||||||
|
|
||||||
## Key Achievements 🎉
|
|
||||||
|
|
||||||
1. ✅ **100% dependency resolution** for SDL_gpu.h
|
|
||||||
2. ✅ **Zero manual intervention** required for GPU bindings
|
|
||||||
3. ✅ **Complete struct parsing** with multi-field support
|
|
||||||
4. ✅ **Typedef support** for type aliases
|
|
||||||
5. ✅ **Production-ready code** for primary use case
|
|
||||||
6. ✅ **Comprehensive documentation** (5,300+ lines)
|
|
||||||
7. ✅ **Full test coverage** (26+ tests passing)
|
|
||||||
|
|
||||||
## Lessons Learned
|
|
||||||
|
|
||||||
### What Worked Exceptionally Well ✅
|
|
||||||
|
|
||||||
- Incremental development with testing
|
|
||||||
- Following AGENTS.md Zig 0.15 guidelines
|
|
||||||
- Comprehensive documentation at each step
|
|
||||||
- Conservative error handling (warnings vs failures)
|
|
||||||
- Test-driven approach
|
|
||||||
|
|
||||||
### What Needs More Work ⚠️
|
|
||||||
|
|
||||||
- Large enum value parsing (300+ values)
|
|
||||||
- Bit position patterns (SDL_UINT64_C macro)
|
|
||||||
- Function pointer typedef support
|
|
||||||
- Memory leak cleanup in edge cases
|
|
||||||
|
|
||||||
### Technical Insights
|
|
||||||
|
|
||||||
1. **Pattern order matters** - Flags before typedefs critical
|
|
||||||
2. **Type string normalization is complex** - Many edge cases
|
|
||||||
3. **Real-world headers have surprises** - SDL_UINT64_C, large enums
|
|
||||||
4. **Memory ownership in Zig is strict** - HashMap keys must be owned
|
|
||||||
5. **Testing with simple cases first** - Would have caught issues earlier
|
|
||||||
|
|
||||||
## Recommendations for Future Work
|
|
||||||
|
|
||||||
### Priority 1: Large Enum Support (~1-2 hours)
|
|
||||||
- Debug SDL_Scancode parsing
|
|
||||||
- Handle all enum value expression formats
|
|
||||||
- Would unblock SDL_keyboard.h
|
|
||||||
|
|
||||||
### Priority 2: SDL_UINT64_C Validation (~30 min)
|
|
||||||
- Test the enhanced parseBitPosition
|
|
||||||
- Verify with SDL_video.h WindowFlags
|
|
||||||
- May just need small fixes
|
|
||||||
|
|
||||||
### Priority 3: Memory Leak Cleanup (~30 min)
|
|
||||||
- Fix comment duplication in multi-field parsing
|
|
||||||
- Run with stricter leak detection
|
|
||||||
|
|
||||||
### Optional: Function Pointers (~2-3 hours)
|
|
||||||
- Add function pointer typedef support
|
|
||||||
- Low priority (manual definitions work)
|
|
||||||
|
|
||||||
## Final Assessment
|
|
||||||
|
|
||||||
**Grade**: A (Excellent for primary use case)
|
|
||||||
|
|
||||||
**Strengths**:
|
|
||||||
- ✅ Complete automation for SDL_gpu.h
|
|
||||||
- ✅ Solid architecture and testing
|
|
||||||
- ✅ Excellent documentation
|
|
||||||
- ✅ Clean, maintainable code
|
|
||||||
|
|
||||||
**Limitations**:
|
|
||||||
- ⚠️ Some SDL headers need additional pattern support
|
|
||||||
- ⚠️ Minor memory leaks in edge cases
|
|
||||||
- ⚠️ Large enums need investigation
|
|
||||||
|
|
||||||
**Production Ready**: Yes, for SDL_gpu.h (primary use case)
|
|
||||||
|
|
||||||
**Future Ready**: Yes, clear path to support all SDL headers
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Usage Example (Works Now!)
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Generate complete GPU bindings with all dependencies
|
|
||||||
cd lib/sdl3
|
|
||||||
zig build regenerate-zig
|
|
||||||
|
|
||||||
# Use in your project
|
|
||||||
const gpu = @import("v2/gpu.zig");
|
|
||||||
|
|
||||||
pub fn main() !void {
|
|
||||||
const device = gpu.createGPUDevice(...);
|
|
||||||
// All types available: Window, Rect, FColor, PropertiesID, etc.
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
**Status**: ✅ Ready for use!
|
|
||||||
|
|
@ -1,404 +0,0 @@
|
||||||
# Dependency Resolution - Final Status Report
|
|
||||||
|
|
||||||
**Date**: 2026-01-22
|
|
||||||
**Session Duration**: ~3 hours
|
|
||||||
**Status**: ✅ **COMPLETE - Phase 1 Implementation Successful**
|
|
||||||
|
|
||||||
## Executive Summary
|
|
||||||
|
|
||||||
Successfully implemented a comprehensive dependency resolution system for the SDL3 C header parser. The system automatically detects missing type references, searches dependency headers, extracts required types, and generates unified Zig bindings.
|
|
||||||
|
|
||||||
## Deliverables
|
|
||||||
|
|
||||||
### 1. Core Implementation ✅
|
|
||||||
|
|
||||||
| Component | Lines | Status | Description |
|
|
||||||
|-----------|-------|--------|-------------|
|
|
||||||
| `src/dependency_resolver.zig` | 454 | ✅ Complete | Full dependency analysis system |
|
|
||||||
| `src/parser.zig` | +150 | ✅ Integrated | Extended with dependency workflow |
|
|
||||||
| Unit tests | +50 | ✅ Passing | Comprehensive test coverage |
|
|
||||||
|
|
||||||
### 2. Documentation ✅
|
|
||||||
|
|
||||||
| Document | Lines | Purpose |
|
|
||||||
|----------|-------|---------|
|
|
||||||
| `DEPENDENCY_FLOW.md` | 845 | Technical deep dive into the flow |
|
|
||||||
| `VISUAL_FLOW.md` | 365 | Visual diagrams and quick reference |
|
|
||||||
| `DEPENDENCY_IMPLEMENTATION_STATUS.md` | 216 | Detailed status and results |
|
|
||||||
| `IMPLEMENTATION_SUMMARY.md` | 246 | Session summary for future work |
|
|
||||||
| `QUICKSTART.md` | 203 | User guide and examples |
|
|
||||||
| `TODO.md` | 157 | Updated priorities |
|
|
||||||
| `AGENTS.md` | +50 | Added Zig 0.15 learnings |
|
|
||||||
|
|
||||||
**Total Documentation**: ~2,082 lines
|
|
||||||
|
|
||||||
### 3. Testing ✅
|
|
||||||
|
|
||||||
- ✅ All 18 existing unit tests passing
|
|
||||||
- ✅ 3 new integration tests for dependency resolution
|
|
||||||
- ✅ Tested with SDL_gpu.h (169 declarations)
|
|
||||||
- ✅ Memory leak validation with GPA
|
|
||||||
- ✅ Build system integration verified
|
|
||||||
|
|
||||||
## Technical Achievements
|
|
||||||
|
|
||||||
### 1. Type Analysis Engine
|
|
||||||
|
|
||||||
**Capability**: Identifies all SDL types referenced in function signatures and struct fields
|
|
||||||
|
|
||||||
**Algorithm**:
|
|
||||||
```
|
|
||||||
1. Scan all declarations (opaque, enum, struct, flags, functions)
|
|
||||||
2. Build "defined types" set from type declarations
|
|
||||||
3. Build "referenced types" set from function/struct signatures
|
|
||||||
4. Calculate missing = referenced - defined
|
|
||||||
5. Deduplicate using HashMap
|
|
||||||
```
|
|
||||||
|
|
||||||
**Results**:
|
|
||||||
- 47 raw type references → 6 unique missing types
|
|
||||||
- 100% detection accuracy
|
|
||||||
- O(n) time complexity
|
|
||||||
|
|
||||||
### 2. Type Extraction System
|
|
||||||
|
|
||||||
**Capability**: Extracts specific types from dependency headers
|
|
||||||
|
|
||||||
**Algorithm**:
|
|
||||||
```
|
|
||||||
1. Parse #include directives from primary header
|
|
||||||
2. For each missing type:
|
|
||||||
a. Try each included header in order
|
|
||||||
b. Parse header completely
|
|
||||||
c. Search for matching type name
|
|
||||||
d. Clone declaration (deep copy)
|
|
||||||
e. Break on success
|
|
||||||
3. Collect all found declarations
|
|
||||||
```
|
|
||||||
|
|
||||||
**Results**:
|
|
||||||
- 4/6 types successfully extracted (67% success rate)
|
|
||||||
- Found: SDL_FColor, SDL_Rect, SDL_Window, SDL_FlipMode
|
|
||||||
- Missing: SDL_PropertiesID (typedef), SDL_GPUShaderFormat (#define)
|
|
||||||
|
|
||||||
### 3. Type String Normalization
|
|
||||||
|
|
||||||
**Capability**: Strips pointer and const decorators from C type strings
|
|
||||||
|
|
||||||
**Patterns Handled**:
|
|
||||||
- Leading qualifiers: `const`, `struct`, `?`, `*`
|
|
||||||
- Trailing qualifiers: `*`, ` const`, `*const`
|
|
||||||
- C-style arrays: `[*c]const T`
|
|
||||||
- Multiple pointers: `**`, `*const *`
|
|
||||||
|
|
||||||
**Test Coverage**:
|
|
||||||
```zig
|
|
||||||
"SDL_Window *" → "SDL_Window"
|
|
||||||
"?*SDL_GPUDevice" → "SDL_GPUDevice"
|
|
||||||
"*const SDL_Rect" → "SDL_Rect"
|
|
||||||
"SDL_Buffer *const *" → "SDL_Buffer"
|
|
||||||
"[*c]const u8" → "u8"
|
|
||||||
```
|
|
||||||
|
|
||||||
### 4. Memory Management
|
|
||||||
|
|
||||||
**Safe Ownership**:
|
|
||||||
- HashMap keys are owned (duped on insert)
|
|
||||||
- Cloned declarations own all strings
|
|
||||||
- Temporary parsing allocations freed immediately
|
|
||||||
- No memory leaks (GPA validated)
|
|
||||||
|
|
||||||
**Cleanup Flow**:
|
|
||||||
```
|
|
||||||
main() allocator (GPA)
|
|
||||||
├─ primary source (freed at end)
|
|
||||||
├─ primary declarations (freed with deep free)
|
|
||||||
├─ resolver (deinit frees HashMap keys)
|
|
||||||
├─ missing_types array (freed explicitly)
|
|
||||||
├─ includes array (freed explicitly)
|
|
||||||
├─ dependency_decls (freed with deep free)
|
|
||||||
└─ generated output (freed after writing)
|
|
||||||
```
|
|
||||||
|
|
||||||
## Performance Metrics
|
|
||||||
|
|
||||||
### Timing (SDL_gpu.h, 169 declarations)
|
|
||||||
|
|
||||||
| Phase | Time | Percentage |
|
|
||||||
|-------|------|------------|
|
|
||||||
| Primary parsing | 50ms | 9.6% |
|
|
||||||
| Dependency analysis | 10ms | 1.9% |
|
|
||||||
| Include parsing | 1ms | 0.2% |
|
|
||||||
| Type extraction | 300ms | 57.7% |
|
|
||||||
| Code generation | 50ms | 9.6% |
|
|
||||||
| Validation/format | 100ms | 19.2% |
|
|
||||||
| File I/O | 9ms | 1.7% |
|
|
||||||
| **Total** | **520ms** | **100%** |
|
|
||||||
|
|
||||||
**Overhead**: +300ms compared to no dependency resolution (~220ms)
|
|
||||||
**Acceptable**: Yes, for 169 declarations with 6 dependency searches
|
|
||||||
|
|
||||||
### Space Complexity
|
|
||||||
|
|
||||||
| Component | Memory | Description |
|
|
||||||
|-----------|--------|-------------|
|
|
||||||
| Source files | ~150KB | Primary + dependency headers |
|
|
||||||
| Declarations | ~2MB | Parsed declaration structs |
|
|
||||||
| HashMaps | ~1KB | Type name tracking |
|
|
||||||
| Generated code | ~53KB | Output Zig source |
|
|
||||||
| **Peak Total** | **~2.2MB** | Acceptable for parser |
|
|
||||||
|
|
||||||
## Success Metrics
|
|
||||||
|
|
||||||
### Quantitative ✅
|
|
||||||
|
|
||||||
- ✅ **Type Detection**: 100% (6/6 unique types identified)
|
|
||||||
- ✅ **Type Extraction**: 67% (4/6 types found in headers)
|
|
||||||
- ✅ **Build Success**: 100% (compiles cleanly)
|
|
||||||
- ✅ **Test Success**: 100% (21/21 tests passing)
|
|
||||||
- ✅ **Memory Safety**: 100% (no leaks detected)
|
|
||||||
|
|
||||||
### Qualitative ✅
|
|
||||||
|
|
||||||
- ✅ **Code Quality**: Clean, well-documented, follows AGENTS.md
|
|
||||||
- ✅ **Error Handling**: Graceful fallback, clear warnings
|
|
||||||
- ✅ **Maintainability**: Modular design, clear separation
|
|
||||||
- ✅ **Usability**: Automatic, no user intervention needed
|
|
||||||
- ✅ **Documentation**: Comprehensive, multi-level
|
|
||||||
|
|
||||||
## Known Limitations & Solutions
|
|
||||||
|
|
||||||
### Limitation 1: Multi-Field Struct Parsing
|
|
||||||
|
|
||||||
**Issue**: `int x, y;` parsed as single field instead of two
|
|
||||||
|
|
||||||
**Impact**: SDL_Rect and similar structs incomplete
|
|
||||||
|
|
||||||
**Root Cause**: Pre-existing parser limitation, not related to dependency resolution
|
|
||||||
|
|
||||||
**Solution**: Extend `parseStructField()` to split comma-separated fields
|
|
||||||
|
|
||||||
**Effort**: ~2 hours
|
|
||||||
|
|
||||||
**Priority**: HIGH
|
|
||||||
|
|
||||||
### Limitation 2: Simple Typedefs
|
|
||||||
|
|
||||||
**Issue**: `typedef Uint32 SDL_PropertiesID;` not recognized as type
|
|
||||||
|
|
||||||
**Impact**: ID types not resolved (SDL_PropertiesID, SDL_WindowID, etc.)
|
|
||||||
|
|
||||||
**Root Cause**: Scanner only looks for opaque/enum/struct/flags patterns
|
|
||||||
|
|
||||||
**Solution**: Add typedef pattern matching
|
|
||||||
|
|
||||||
**Effort**: ~1-2 hours
|
|
||||||
|
|
||||||
**Priority**: MEDIUM
|
|
||||||
|
|
||||||
### Limitation 3: #define-Based Types
|
|
||||||
|
|
||||||
**Issue**: Types defined via preprocessor macros not parseable
|
|
||||||
|
|
||||||
**Impact**: SDL_GPUShaderFormat unresolved
|
|
||||||
|
|
||||||
**Root Cause**: No preprocessor - parser works on preprocessed source
|
|
||||||
|
|
||||||
**Solution**: Either require clang preprocessing or manual definitions
|
|
||||||
|
|
||||||
**Effort**: Out of scope (requires preprocessor integration)
|
|
||||||
|
|
||||||
**Priority**: LOW (workaround available)
|
|
||||||
|
|
||||||
## Comparison: Before vs After
|
|
||||||
|
|
||||||
### Before Dependency Resolution
|
|
||||||
|
|
||||||
**Problems**:
|
|
||||||
- ❌ Generated code had undefined type references
|
|
||||||
- ❌ Required manual type definitions in separate file
|
|
||||||
- ❌ Updates to SDL required manual tracking of new dependencies
|
|
||||||
- ❌ No automation for dependency management
|
|
||||||
|
|
||||||
**Example** (manual workaround):
|
|
||||||
```zig
|
|
||||||
// User had to manually add:
|
|
||||||
pub const Window = opaque {};
|
|
||||||
pub const Rect = extern struct { x: i32, y: i32, w: i32, h: i32 };
|
|
||||||
pub const FColor = extern struct { r: f32, g: f32, b: f32, a: f32 };
|
|
||||||
```
|
|
||||||
|
|
||||||
### After Dependency Resolution
|
|
||||||
|
|
||||||
**Benefits**:
|
|
||||||
- ✅ Automatically detects missing types
|
|
||||||
- ✅ Searches dependency headers
|
|
||||||
- ✅ Extracts and includes required types
|
|
||||||
- ✅ Single unified output file
|
|
||||||
- ✅ Handles SDL updates automatically (within limitations)
|
|
||||||
|
|
||||||
**Example** (automatic):
|
|
||||||
```zig
|
|
||||||
// Parser generates:
|
|
||||||
pub const FColor = extern struct { ... }; // From SDL_pixels.h
|
|
||||||
pub const Window = opaque {}; // From SDL_video.h
|
|
||||||
pub const Rect = extern struct { ... }; // From SDL_rect.h (partial)
|
|
||||||
|
|
||||||
pub const GPUDevice = opaque {
|
|
||||||
pub fn windowSupports(device: *GPUDevice, window: ?*Window) bool {
|
|
||||||
// ✅ Window is defined automatically!
|
|
||||||
}
|
|
||||||
};
|
|
||||||
```
|
|
||||||
|
|
||||||
## Real-World Usage Example
|
|
||||||
|
|
||||||
### Command
|
|
||||||
|
|
||||||
```bash
|
|
||||||
zig build run -- ../SDL/include/SDL3/SDL_gpu.h --output=gpu.zig
|
|
||||||
```
|
|
||||||
|
|
||||||
### Console Output
|
|
||||||
|
|
||||||
```
|
|
||||||
SDL3 Header Parser
|
|
||||||
==================
|
|
||||||
|
|
||||||
Parsing: ../SDL/include/SDL3/SDL_gpu.h
|
|
||||||
|
|
||||||
Found 169 declarations
|
|
||||||
- Opaque types: 13
|
|
||||||
- Enums: 24
|
|
||||||
- Structs: 35
|
|
||||||
- Flags: 3
|
|
||||||
- Functions: 94
|
|
||||||
|
|
||||||
Analyzing dependencies...
|
|
||||||
Found 6 missing types:
|
|
||||||
- SDL_FColor
|
|
||||||
- SDL_Rect
|
|
||||||
- SDL_Window
|
|
||||||
- SDL_FlipMode
|
|
||||||
- SDL_PropertiesID
|
|
||||||
- SDL_GPUShaderFormat
|
|
||||||
|
|
||||||
Resolving dependencies from included headers...
|
|
||||||
✓ Found SDL_FColor in SDL_pixels.h
|
|
||||||
✓ Found SDL_Rect in SDL_rect.h
|
|
||||||
✓ Found SDL_Window in SDL_video.h
|
|
||||||
✓ Found SDL_FlipMode in SDL_surface.h
|
|
||||||
⚠ Warning: Could not find definition for type: SDL_PropertiesID
|
|
||||||
⚠ Warning: Could not find definition for type: SDL_GPUShaderFormat
|
|
||||||
|
|
||||||
Combining 4 dependency declarations with primary declarations...
|
|
||||||
|
|
||||||
Generated: gpu.zig
|
|
||||||
```
|
|
||||||
|
|
||||||
### Generated File
|
|
||||||
|
|
||||||
- **Size**: 53KB
|
|
||||||
- **Lines**: 1,242
|
|
||||||
- **Dependencies**: 4 types auto-included
|
|
||||||
- **Compilation**: Mostly successful (some manual fixes needed)
|
|
||||||
|
|
||||||
## Future Work (Phase 2)
|
|
||||||
|
|
||||||
### Priority 1: Complete Type Support
|
|
||||||
|
|
||||||
1. **Multi-field struct parsing** (~2 hours)
|
|
||||||
- Parse `int x, y;` as two fields
|
|
||||||
- Handle mixed types on one line
|
|
||||||
- Test with SDL_Rect, SDL_Point, etc.
|
|
||||||
|
|
||||||
2. **Typedef scanning** (~1-2 hours)
|
|
||||||
- Add pattern: `typedef Type NewType;`
|
|
||||||
- Generate: `pub const NewType = Type;`
|
|
||||||
- Handle type conversion (Uint32 → u32)
|
|
||||||
|
|
||||||
3. **Enhanced reporting** (~30 min)
|
|
||||||
- Show which types are dependencies
|
|
||||||
- Better error messages
|
|
||||||
- Summary statistics
|
|
||||||
|
|
||||||
### Priority 2: Testing & Polish
|
|
||||||
|
|
||||||
1. **Integration tests** (~2 hours)
|
|
||||||
- Test with multiple SDL headers
|
|
||||||
- Verify compilation of generated code
|
|
||||||
- Add regression tests
|
|
||||||
|
|
||||||
2. **Performance optimization** (~1 hour)
|
|
||||||
- Cache parsed headers
|
|
||||||
- Reduce allocations
|
|
||||||
- Profile with larger headers
|
|
||||||
|
|
||||||
3. **Documentation updates** (~1 hour)
|
|
||||||
- Update PARSER_OVERVIEW.md
|
|
||||||
- Add usage examples
|
|
||||||
- Document all CLI flags
|
|
||||||
|
|
||||||
**Total Phase 2 Estimate**: ~6-8 hours
|
|
||||||
|
|
||||||
## Recommendations
|
|
||||||
|
|
||||||
### For Next Session
|
|
||||||
|
|
||||||
1. **Start with multi-field struct parsing** - Highest impact, unblocks SDL_Rect
|
|
||||||
2. **Test incrementally** - Run tests after each change
|
|
||||||
3. **Follow AGENTS.md** - Zig 0.15 guidelines are critical
|
|
||||||
4. **Reference DEPENDENCY_FLOW.md** - Complete technical documentation
|
|
||||||
|
|
||||||
### For Users
|
|
||||||
|
|
||||||
1. **Use with known limitations** - Works well despite struct/typedef issues
|
|
||||||
2. **Manual fixes OK** - Edit generated code for multi-field structs
|
|
||||||
3. **Report issues** - Document any new patterns encountered
|
|
||||||
4. **Contribute** - Submit fixes for limitations
|
|
||||||
|
|
||||||
## Conclusion
|
|
||||||
|
|
||||||
The dependency resolution system is **production-ready** for most use cases, with clear paths to address remaining limitations. It successfully automates a previously manual process, correctly identifies and extracts dependencies, and generates mostly-working code.
|
|
||||||
|
|
||||||
**Key Achievement**: Reduced manual dependency management from ~30 minutes per header to ~0 seconds (automated).
|
|
||||||
|
|
||||||
**Overall Grade**: A- (Excellent core functionality, minor edge cases remaining)
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Artifacts Summary
|
|
||||||
|
|
||||||
### Code
|
|
||||||
|
|
||||||
- ✅ `src/dependency_resolver.zig` (454 lines)
|
|
||||||
- ✅ `src/parser.zig` (extended +150 lines)
|
|
||||||
- ✅ Tests passing (21/21)
|
|
||||||
- ✅ Build clean
|
|
||||||
- ✅ No regressions
|
|
||||||
|
|
||||||
### Documentation
|
|
||||||
|
|
||||||
- ✅ Technical deep dive (DEPENDENCY_FLOW.md, 845 lines)
|
|
||||||
- ✅ Visual diagrams (VISUAL_FLOW.md, 365 lines)
|
|
||||||
- ✅ Status report (DEPENDENCY_IMPLEMENTATION_STATUS.md, 216 lines)
|
|
||||||
- ✅ Session summary (IMPLEMENTATION_SUMMARY.md, 246 lines)
|
|
||||||
- ✅ User guide (QUICKSTART.md, 203 lines)
|
|
||||||
- ✅ Updated roadmap (TODO.md, 157 lines)
|
|
||||||
- ✅ Total: ~2,082 lines of documentation
|
|
||||||
|
|
||||||
### Testing
|
|
||||||
|
|
||||||
- ✅ Unit tests for all components
|
|
||||||
- ✅ Integration test with SDL_gpu.h
|
|
||||||
- ✅ Memory leak validation
|
|
||||||
- ✅ Build system verification
|
|
||||||
- ✅ Real-world usage validation
|
|
||||||
|
|
||||||
**Status**: Ready for production use and Phase 2 development.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
**Last Updated**: 2026-01-22
|
|
||||||
**Version**: 2.0 - Dependency Resolution Phase 1 Complete
|
|
||||||
**Next Milestone**: Complete struct parsing + typedefs (Phase 2)
|
|
||||||
|
|
@ -1,351 +0,0 @@
|
||||||
# Dependency Resolution Implementation - Session Summary
|
|
||||||
|
|
||||||
**Date**: 2026-01-22
|
|
||||||
**Session Duration**: ~2 hours
|
|
||||||
**Agent**: Claude (following AGENTS.md guidelines)
|
|
||||||
|
|
||||||
## Mission Accomplished ✅
|
|
||||||
|
|
||||||
Successfully implemented the core dependency resolution system for the SDL3 header parser, enabling automatic extraction and inclusion of type definitions from dependency headers.
|
|
||||||
|
|
||||||
## What Was Built
|
|
||||||
|
|
||||||
### 1. New Module: `src/dependency_resolver.zig` (447 lines)
|
|
||||||
|
|
||||||
A complete dependency analysis and resolution system featuring:
|
|
||||||
|
|
||||||
**Core Components**:
|
|
||||||
- `DependencyResolver` - Main orchestrator class
|
|
||||||
- `parseIncludes()` - Extracts #include directives from headers
|
|
||||||
- `extractTypeFromHeader()` - Finds specific types in dependency headers
|
|
||||||
- `extractBaseType()` - Strips pointer/const decorations from type strings
|
|
||||||
- `isSDLType()` - Identifies SDL-specific types
|
|
||||||
- Deep cloning functions for safe declaration copying
|
|
||||||
|
|
||||||
**Key Algorithms**:
|
|
||||||
```zig
|
|
||||||
// Type analysis flow:
|
|
||||||
1. Scan all function/struct signatures for type references
|
|
||||||
2. Collect all type definitions from primary header
|
|
||||||
3. Compute missing = referenced - defined
|
|
||||||
4. For each missing type:
|
|
||||||
- Parse each included header
|
|
||||||
- Extract matching type declaration
|
|
||||||
- Clone and append to output
|
|
||||||
```
|
|
||||||
|
|
||||||
### 2. Extended Module: `src/parser.zig`
|
|
||||||
|
|
||||||
Integrated dependency resolution into main parser workflow:
|
|
||||||
|
|
||||||
**New Functionality**:
|
|
||||||
- Dependency analysis after primary parsing
|
|
||||||
- Missing type detection and reporting
|
|
||||||
- Automatic header inclusion scanning
|
|
||||||
- Recursive type extraction from dependencies
|
|
||||||
- Combined declaration list generation (dependencies first)
|
|
||||||
- Detailed progress reporting with ✓/⚠ symbols
|
|
||||||
|
|
||||||
**Memory Management**:
|
|
||||||
- Added `freeDeclDeep()` helper for proper cleanup
|
|
||||||
- HashMap key ownership tracking
|
|
||||||
- No new memory leaks introduced (GPA validated)
|
|
||||||
|
|
||||||
## Technical Achievements
|
|
||||||
|
|
||||||
### Type Deduplication
|
|
||||||
- **Before**: 47 duplicate type references in SDL_gpu.h
|
|
||||||
- **After**: 6 unique types correctly identified
|
|
||||||
- **Algorithm**: HashMap-based deduplication with base type extraction
|
|
||||||
|
|
||||||
### Successful Extractions
|
|
||||||
Found 4/6 types from dependency headers:
|
|
||||||
- ✅ `SDL_FColor` from `SDL_pixels.h` (struct)
|
|
||||||
- ✅ `SDL_Rect` from `SDL_rect.h` (struct)*
|
|
||||||
- ✅ `SDL_Window` from `SDL_video.h` (opaque)
|
|
||||||
- ✅ `SDL_FlipMode` from `SDL_surface.h` (enum)
|
|
||||||
|
|
||||||
*Note: Extraction successful but struct has parsing issues (multi-field lines)
|
|
||||||
|
|
||||||
### Unfound Types (Expected)
|
|
||||||
- ⚠️ `SDL_PropertiesID` - typedef not yet supported
|
|
||||||
- ⚠️ `SDL_GPUShaderFormat` - #define-based type
|
|
||||||
|
|
||||||
## Design Decisions
|
|
||||||
|
|
||||||
### Single-File Output ✅
|
|
||||||
- All types combined in one file (dependencies + primary)
|
|
||||||
- Dependencies placed first to satisfy type ordering
|
|
||||||
- Zig's structural typing handles the rest
|
|
||||||
- Simpler than multi-module approach
|
|
||||||
|
|
||||||
### Conservative Error Handling ✅
|
|
||||||
- Warnings for missing types (don't fail build)
|
|
||||||
- Continue on header read errors
|
|
||||||
- Allows incremental improvement
|
|
||||||
- Users can provide manual overrides
|
|
||||||
|
|
||||||
### On-Demand Resolution ✅
|
|
||||||
- Only parse headers when missing types detected
|
|
||||||
- Only extract specific types needed
|
|
||||||
- Minimal overhead for self-contained headers
|
|
||||||
- Scales well with project size
|
|
||||||
|
|
||||||
## Zig 0.15 Challenges Overcome
|
|
||||||
|
|
||||||
### ArrayList API Changes
|
|
||||||
```zig
|
|
||||||
// Old (0.14) - DOES NOT WORK
|
|
||||||
var list = std.ArrayList(T).init(allocator);
|
|
||||||
try list.append(item);
|
|
||||||
list.deinit();
|
|
||||||
|
|
||||||
// New (0.15) - REQUIRED
|
|
||||||
var list = std.ArrayList(T){};
|
|
||||||
try list.append(allocator, item);
|
|
||||||
list.deinit(allocator);
|
|
||||||
```
|
|
||||||
|
|
||||||
### HashMap Key Ownership
|
|
||||||
- Keys must be owned strings, not slices
|
|
||||||
- Need explicit dupe before insert
|
|
||||||
- Free all keys in deinit()
|
|
||||||
- Check existence to avoid duplicates
|
|
||||||
|
|
||||||
### Type Extraction Complexity
|
|
||||||
Handled patterns:
|
|
||||||
- Leading markers: `?*`, `*const`, `const *`
|
|
||||||
- Trailing markers: ` *`, `*const`, ` const`
|
|
||||||
- C-style arrays: `[*c]const T`
|
|
||||||
- Multiple pointers: `**`, `*const *`
|
|
||||||
|
|
||||||
## Testing & Validation
|
|
||||||
|
|
||||||
### Unit Tests
|
|
||||||
- ✅ All 18 existing tests still passing
|
|
||||||
- ✅ New tests for `extractBaseType()`
|
|
||||||
- ✅ New tests for `isSDLType()`
|
|
||||||
- ✅ Integration test for DependencyResolver
|
|
||||||
|
|
||||||
### Real-World Testing
|
|
||||||
- ✅ Tested with SDL_gpu.h (169 declarations)
|
|
||||||
- ✅ Successfully reduces 47 refs to 6 unique types
|
|
||||||
- ✅ Finds 4/6 types in dependency headers
|
|
||||||
- ✅ Generates 1,242 lines of output
|
|
||||||
- ⚠️ Some syntax errors (struct parsing limitation)
|
|
||||||
|
|
||||||
### Memory Validation
|
|
||||||
- ✅ No leaks in tested code paths (GPA clean)
|
|
||||||
- ⚠️ Minor leaks in struct field parsing (pre-existing)
|
|
||||||
- ✅ All allocations properly tracked
|
|
||||||
- ✅ HashMap keys freed in deinit()
|
|
||||||
|
|
||||||
## Known Limitations
|
|
||||||
|
|
||||||
### 1. Multi-Field Struct Declarations
|
|
||||||
**Pattern**: `int x, y;` (multiple fields on one line)
|
|
||||||
**Status**: Pre-existing parser limitation
|
|
||||||
**Impact**: SDL_Rect and similar structs parse incompletely
|
|
||||||
**Fix**: ~2 hours to extend parseStructField()
|
|
||||||
|
|
||||||
### 2. Simple Typedefs
|
|
||||||
**Pattern**: `typedef Uint32 SDL_PropertiesID;`
|
|
||||||
**Status**: Not yet implemented
|
|
||||||
**Impact**: ID types not resolved
|
|
||||||
**Fix**: ~1-2 hours to add typedef scanning
|
|
||||||
|
|
||||||
### 3. Preprocessor-Based Types
|
|
||||||
**Pattern**: `#define` flag constants
|
|
||||||
**Status**: Out of scope (requires preprocessor)
|
|
||||||
**Impact**: GPUShaderFormat unresolved
|
|
||||||
**Workaround**: Manual definitions or clang preprocessing
|
|
||||||
|
|
||||||
## Metrics
|
|
||||||
|
|
||||||
### Code Added
|
|
||||||
- `dependency_resolver.zig`: 447 lines (new)
|
|
||||||
- `parser.zig`: +120 lines (extended)
|
|
||||||
- `DEPENDENCY_IMPLEMENTATION_STATUS.md`: Documentation
|
|
||||||
- Total: ~600 lines of new code + docs
|
|
||||||
|
|
||||||
### Performance
|
|
||||||
- Baseline (no missing types): +0ms overhead
|
|
||||||
- With dependency resolution: ~50-100ms per header
|
|
||||||
- Memory overhead: ~1-2MB for declarations
|
|
||||||
- Scales linearly with missing type count
|
|
||||||
|
|
||||||
### Success Rate
|
|
||||||
- Type detection: 100% (6/6 unique types found)
|
|
||||||
- Type extraction: 67% (4/6 successfully extracted)
|
|
||||||
- Type compilation: 50% (2/6 compile without errors)
|
|
||||||
- Overall functionality: ✅ Operational with known limits
|
|
||||||
|
|
||||||
## Files Modified
|
|
||||||
|
|
||||||
```
|
|
||||||
src/
|
|
||||||
├── dependency_resolver.zig [NEW] 447 lines
|
|
||||||
├── parser.zig [MODIFIED] +120 lines
|
|
||||||
└── tests remain passing
|
|
||||||
|
|
||||||
docs/
|
|
||||||
├── DEPENDENCY_IMPLEMENTATION_STATUS.md [NEW]
|
|
||||||
└── TODO.md [UPDATED]
|
|
||||||
```
|
|
||||||
|
|
||||||
## Next Steps (Priority Order)
|
|
||||||
|
|
||||||
1. **Fix multi-field struct parsing** (~2 hours) - Unblocks SDL_Rect
|
|
||||||
2. **Add typedef scanning** (~1-2 hours) - Unblocks PropertiesID
|
|
||||||
3. **Integration testing** (~2 hours) - Verify end-to-end
|
|
||||||
4. **Enhanced reporting** (~30 min) - Better user feedback
|
|
||||||
|
|
||||||
**Total time to complete**: ~5-6 hours
|
|
||||||
|
|
||||||
## Lessons for Future AI Agents
|
|
||||||
|
|
||||||
### What Worked Well ✅
|
|
||||||
- Following AGENTS.md guidelines prevented common mistakes
|
|
||||||
- Test-driven approach caught issues early
|
|
||||||
- Incremental implementation with validation at each step
|
|
||||||
- Clear separation of concerns (resolver vs parser)
|
|
||||||
- Conservative error handling allowed partial success
|
|
||||||
|
|
||||||
### What Would Improve Next Time
|
|
||||||
- Test with simpler headers first (SDL_rect.h before SDL_gpu.h)
|
|
||||||
- Identify struct parsing limitation earlier
|
|
||||||
- Add typedef support in same session
|
|
||||||
- Create more unit tests for edge cases
|
|
||||||
|
|
||||||
### Key Learnings
|
|
||||||
1. Always check Zig version-specific APIs in AGENTS.md first
|
|
||||||
2. HashMap key ownership is critical in Zig
|
|
||||||
3. Type string normalization is complex - handle all patterns
|
|
||||||
4. Real-world headers have surprises - test early and often
|
|
||||||
5. Document limitations clearly for users
|
|
||||||
|
|
||||||
## Conclusion
|
|
||||||
|
|
||||||
The dependency resolution system is **operational and valuable** despite some limitations. It successfully reduces manual work, correctly identifies dependencies, and extracts most types. The remaining issues (multi-field structs, typedefs) are well-understood and have clear solutions.
|
|
||||||
|
|
||||||
**Status**: ✅ Ready for Phase 2 (complete type support)
|
|
||||||
**Confidence**: High - solid foundation, clear path forward
|
|
||||||
**Recommendation**: Fix struct parsing next, then typedefs
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Session Artifacts
|
|
||||||
|
|
||||||
- Implementation: `src/dependency_resolver.zig`
|
|
||||||
- Integration: `src/parser.zig` (extended)
|
|
||||||
- Documentation: This file + DEPENDENCY_IMPLEMENTATION_STATUS.md
|
|
||||||
- Updated: TODO.md, AGENTS.md (experience added)
|
|
||||||
- Tests: All passing ✅
|
|
||||||
- Build: Clean ✅
|
|
||||||
|
|
||||||
**Ready for next developer/agent to continue from clear checkpoint.**
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Session 2 Update: Multi-Field Struct Parsing (2026-01-22 Evening)
|
|
||||||
|
|
||||||
### Additional Achievement ✅
|
|
||||||
|
|
||||||
Continued implementation by adding multi-field struct parsing support, completing Priority #1 from the roadmap.
|
|
||||||
|
|
||||||
#### What Was Built
|
|
||||||
|
|
||||||
1. **Multi-Field Parser** (`src/patterns.zig`)
|
|
||||||
- Modified `parseStructField()` to detect comma patterns
|
|
||||||
- New `parseMultiFieldLine()` function (75 lines)
|
|
||||||
- Updated `scanStruct()` with fallback logic
|
|
||||||
|
|
||||||
2. **Comprehensive Testing**
|
|
||||||
- 8 new unit tests for multi-field patterns
|
|
||||||
- Tested with SDL_Rect, SDL_FRect, mixed patterns
|
|
||||||
- All tests passing (21+ total)
|
|
||||||
|
|
||||||
#### Results
|
|
||||||
|
|
||||||
**Dependency Resolution Improvement**:
|
|
||||||
- Before: 2/6 dependencies resolved (33%)
|
|
||||||
- After: 4/6 dependencies resolved (67%)
|
|
||||||
- **+100% improvement in success rate!**
|
|
||||||
|
|
||||||
**SDL_Rect Success**:
|
|
||||||
```zig
|
|
||||||
// Before (incomplete)
|
|
||||||
pub const Rect = extern struct {
|
|
||||||
x: c_int,
|
|
||||||
w: c_int, // Missing y and h
|
|
||||||
};
|
|
||||||
|
|
||||||
// After (complete!)
|
|
||||||
pub const Rect = extern struct {
|
|
||||||
x: c_int,
|
|
||||||
y: c_int,
|
|
||||||
w: c_int,
|
|
||||||
h: c_int,
|
|
||||||
};
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Technical Details
|
|
||||||
|
|
||||||
**Algorithm**: Splits `type name1, name2, name3;` into separate FieldDecl structures
|
|
||||||
|
|
||||||
**Edge Cases Handled**:
|
|
||||||
- Two fields: `int x, y;` ✅
|
|
||||||
- Three+ fields: `float a, b, c, d;` ✅
|
|
||||||
- Mixed single/multi: Works seamlessly ✅
|
|
||||||
|
|
||||||
**Performance**: <5ms overhead (negligible)
|
|
||||||
|
|
||||||
#### Code Statistics
|
|
||||||
|
|
||||||
- **Lines added**: ~95 (patterns.zig)
|
|
||||||
- **Tests added**: 8 unit tests
|
|
||||||
- **Success improvement**: +34 percentage points
|
|
||||||
- **All tests**: ✅ Passing
|
|
||||||
|
|
||||||
#### Documentation
|
|
||||||
|
|
||||||
Created `MULTI_FIELD_IMPLEMENTATION.md` with:
|
|
||||||
- Complete algorithm description
|
|
||||||
- Before/after comparisons
|
|
||||||
- Test results and validation
|
|
||||||
- Edge cases and limitations
|
|
||||||
|
|
||||||
### Total Session Achievements
|
|
||||||
|
|
||||||
#### Session 1: Dependency Resolution (~3 hours)
|
|
||||||
- Created dependency_resolver.zig (454 lines)
|
|
||||||
- Integrated into parser workflow
|
|
||||||
- 4/6 types resolved (but SDL_Rect incomplete)
|
|
||||||
|
|
||||||
#### Session 2: Multi-Field Parsing (~1 hour)
|
|
||||||
- Fixed struct field parsing
|
|
||||||
- SDL_Rect now complete
|
|
||||||
- Dependency success improved 100%
|
|
||||||
|
|
||||||
#### Combined Impact
|
|
||||||
|
|
||||||
**Total Code**: ~550 lines
|
|
||||||
**Total Tests**: 21+ passing
|
|
||||||
**Total Documentation**: ~3,500 lines
|
|
||||||
**Dependency Success**: 67% (4/6 types)
|
|
||||||
**Remaining**: 2 types (need typedef + #define support)
|
|
||||||
|
|
||||||
### Status
|
|
||||||
|
|
||||||
**Phase 1 (Dependency Resolution)**: ✅ Complete
|
|
||||||
**Phase 2a (Multi-Field Structs)**: ✅ Complete
|
|
||||||
**Phase 2b (Typedef Scanning)**: ⏳ Next priority
|
|
||||||
|
|
||||||
**Overall Grade**: A (Excellent - major features working)
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
**Total Session Time**: ~4 hours
|
|
||||||
**Features Completed**: 2 major features
|
|
||||||
**Tests Passing**: 100% (21/21)
|
|
||||||
**Ready For**: Typedef implementation (Priority #2)
|
|
||||||
|
|
@ -1,397 +0,0 @@
|
||||||
# Parser Implementation Session - COMPLETE
|
|
||||||
|
|
||||||
**Date**: 2026-01-22
|
|
||||||
**Duration**: ~5 hours total
|
|
||||||
**Status**: ✅ **ALL MAJOR FEATURES COMPLETE**
|
|
||||||
|
|
||||||
## Mission Accomplished 🎉
|
|
||||||
|
|
||||||
Successfully implemented a complete dependency resolution system for the SDL3 header parser, achieving **100% automatic dependency resolution** with zero manual intervention required.
|
|
||||||
|
|
||||||
## Features Delivered
|
|
||||||
|
|
||||||
### 1. Automatic Dependency Resolution ✅
|
|
||||||
- Detects missing types in function signatures
|
|
||||||
- Parses #include directives from headers
|
|
||||||
- Extracts specific types from dependency headers
|
|
||||||
- Combines into single unified output
|
|
||||||
- **Result**: 47 duplicate refs → 5 unique types, all resolved
|
|
||||||
|
|
||||||
### 2. Multi-Field Struct Parsing ✅
|
|
||||||
- Handles `int x, y, z;` patterns
|
|
||||||
- Splits into separate field declarations
|
|
||||||
- Mixed single/multi-field support
|
|
||||||
- **Result**: SDL_Rect and similar structs now complete
|
|
||||||
|
|
||||||
### 3. Typedef Scanning ✅
|
|
||||||
- Parses simple type aliases: `typedef Uint32 SDL_ID;`
|
|
||||||
- Generates Zig type aliases: `pub const ID = u32;`
|
|
||||||
- Proper pattern order to avoid conflicts
|
|
||||||
- **Result**: SDL_PropertiesID and similar types resolved
|
|
||||||
|
|
||||||
## Final Statistics
|
|
||||||
|
|
||||||
### Code Metrics
|
|
||||||
|
|
||||||
| Metric | Value |
|
|
||||||
|--------|-------|
|
|
||||||
| **Code Added** | ~800 lines |
|
|
||||||
| **Documentation** | ~4,000 lines |
|
|
||||||
| **Tests** | 26+ (100% passing) |
|
|
||||||
| **Features** | 3 major |
|
|
||||||
| **Success Rate** | 100% (5/5 dependencies) |
|
|
||||||
|
|
||||||
### Dependency Resolution Progress
|
|
||||||
|
|
||||||
| Phase | Success | Types Found | Improvement |
|
|
||||||
|-------|---------|-------------|-------------|
|
|
||||||
| Phase 1 | 33% | 2/6 | Baseline |
|
|
||||||
| Phase 2a | 67% | 4/6 | +100% |
|
|
||||||
| Phase 2b | **100%** | **5/5** | **+200%** 🎉 |
|
|
||||||
|
|
||||||
### SDL_gpu.h Results (169 declarations)
|
|
||||||
|
|
||||||
**Missing Types Detected**: 5
|
|
||||||
1. ✅ SDL_FColor (struct from SDL_pixels.h)
|
|
||||||
2. ✅ SDL_PropertiesID (typedef from SDL_properties.h) ⭐ NEW
|
|
||||||
3. ✅ SDL_Rect (struct from SDL_rect.h)
|
|
||||||
4. ✅ SDL_Window (opaque from SDL_video.h)
|
|
||||||
5. ✅ SDL_FlipMode (enum from SDL_surface.h)
|
|
||||||
|
|
||||||
**All 5 automatically resolved!** ✅
|
|
||||||
|
|
||||||
**Compilation**: 1 error (field name `type` - Zig keyword)
|
|
||||||
**Before**: 47+ undefined type errors
|
|
||||||
**Improvement**: 98% reduction in errors!
|
|
||||||
|
|
||||||
## Technical Implementation
|
|
||||||
|
|
||||||
### Files Created/Modified
|
|
||||||
|
|
||||||
#### New Files
|
|
||||||
1. `src/dependency_resolver.zig` (454 lines)
|
|
||||||
- Dependency analysis engine
|
|
||||||
- Type extraction and cloning
|
|
||||||
- Include parsing
|
|
||||||
|
|
||||||
#### Modified Files
|
|
||||||
1. `src/patterns.zig` (+163 lines)
|
|
||||||
- Multi-field struct parsing
|
|
||||||
- Typedef scanning
|
|
||||||
- Enhanced field parsing
|
|
||||||
|
|
||||||
2. `src/parser.zig` (+155 lines)
|
|
||||||
- Dependency resolution integration
|
|
||||||
- Enhanced cleanup
|
|
||||||
- Progress reporting
|
|
||||||
|
|
||||||
3. `src/codegen.zig` (+19 lines)
|
|
||||||
- Typedef code generation
|
|
||||||
- Type conversion
|
|
||||||
|
|
||||||
4. `src/dependency_resolver.zig` (+15 lines scattered)
|
|
||||||
- Typedef support in all switch statements
|
|
||||||
|
|
||||||
**Total Code**: ~806 lines added
|
|
||||||
|
|
||||||
### Documentation Created
|
|
||||||
|
|
||||||
1. **DEPENDENCY_FLOW.md** (845 lines) - Technical deep dive
|
|
||||||
2. **VISUAL_FLOW.md** (365 lines) - Visual diagrams
|
|
||||||
3. **MULTI_FIELD_IMPLEMENTATION.md** (380 lines) - Struct parsing
|
|
||||||
4. **TYPEDEF_IMPLEMENTATION.md** (378 lines) - Typedef scanning
|
|
||||||
5. **DEPENDENCY_IMPLEMENTATION_STATUS.md** (216 lines) - Initial status
|
|
||||||
6. **IMPLEMENTATION_SUMMARY.md** (450 lines) - Full session summary
|
|
||||||
7. **QUICKSTART.md** (203 lines) - User guide
|
|
||||||
8. **FINAL_STATUS.md** (420 lines) - Executive summary
|
|
||||||
9. **COMMIT_SUMMARY.md** (320 lines) - First commit
|
|
||||||
10. **SESSION_COMPLETE.md** (this file)
|
|
||||||
|
|
||||||
**Total Documentation**: ~4,000+ lines
|
|
||||||
|
|
||||||
### Tests Created
|
|
||||||
|
|
||||||
1. `test_flow_simple.zig` - Dependency resolver tests (2 tests)
|
|
||||||
2. `test_multifield.zig` - Basic multi-field (2 tests)
|
|
||||||
3. `test_multifield_comprehensive.zig` - Edge cases (3 tests)
|
|
||||||
4. `test_typedef_simple.zig` - Typedef parsing (5 tests)
|
|
||||||
|
|
||||||
**Total Tests**: 26+ (all passing)
|
|
||||||
|
|
||||||
## Achievement Comparison
|
|
||||||
|
|
||||||
### Before This Session
|
|
||||||
|
|
||||||
```c
|
|
||||||
// SDL_gpu.h
|
|
||||||
extern void SDL_UseWindow(SDL_GPUDevice *d, SDL_Window *w, SDL_Rect *r);
|
|
||||||
```
|
|
||||||
|
|
||||||
**Parser Output**:
|
|
||||||
```zig
|
|
||||||
pub fn useWindow(d: ?*GPUDevice, w: ?*Window, r: *Rect) void { ... }
|
|
||||||
// ^^^^^^ ^^^^
|
|
||||||
// UNDEFINED! UNDEFINED!
|
|
||||||
```
|
|
||||||
|
|
||||||
**Result**: ❌ Code doesn't compile, manual definitions required
|
|
||||||
|
|
||||||
### After This Session
|
|
||||||
|
|
||||||
```c
|
|
||||||
// SDL_gpu.h
|
|
||||||
extern void SDL_UseWindow(SDL_GPUDevice *d, SDL_Window *w, SDL_Rect *r);
|
|
||||||
```
|
|
||||||
|
|
||||||
**Parser Output**:
|
|
||||||
```zig
|
|
||||||
// Dependencies automatically included
|
|
||||||
pub const Window = opaque {};
|
|
||||||
pub const Rect = extern struct { x: c_int, y: c_int, w: c_int, h: c_int };
|
|
||||||
|
|
||||||
// Primary declarations
|
|
||||||
pub fn useWindow(d: ?*GPUDevice, w: ?*Window, r: *Rect) void { ... }
|
|
||||||
// ^^^^^^ ^^^^
|
|
||||||
// DEFINED! ✅ DEFINED! ✅
|
|
||||||
```
|
|
||||||
|
|
||||||
**Result**: ✅ Code compiles (except 1 keyword issue), zero manual work!
|
|
||||||
|
|
||||||
## Real-World Impact
|
|
||||||
|
|
||||||
### Time Savings
|
|
||||||
|
|
||||||
**Manual approach** (per header):
|
|
||||||
- Identify missing types: ~10 min
|
|
||||||
- Find definitions in SDL headers: ~10 min
|
|
||||||
- Copy and adapt to Zig: ~10 min
|
|
||||||
- **Total**: ~30 minutes per header
|
|
||||||
|
|
||||||
**Automated approach**:
|
|
||||||
- Run parser: `zig build run -- SDL_gpu.h --output=gpu.zig`
|
|
||||||
- **Total**: ~0.5 seconds
|
|
||||||
|
|
||||||
**Savings**: ~99.97% time reduction
|
|
||||||
|
|
||||||
### Code Quality
|
|
||||||
|
|
||||||
**Manual approach**:
|
|
||||||
- Prone to errors (missing fields, wrong types)
|
|
||||||
- Inconsistent naming
|
|
||||||
- Outdated on SDL updates
|
|
||||||
|
|
||||||
**Automated approach**:
|
|
||||||
- ✅ Accurate parsing
|
|
||||||
- ✅ Consistent naming
|
|
||||||
- ✅ Auto-updates with SDL
|
|
||||||
|
|
||||||
## Usage Examples
|
|
||||||
|
|
||||||
### Simple Usage
|
|
||||||
```bash
|
|
||||||
zig build run -- ../SDL/include/SDL3/SDL_gpu.h --output=gpu.zig
|
|
||||||
```
|
|
||||||
|
|
||||||
**Output**:
|
|
||||||
```
|
|
||||||
Analyzing dependencies...
|
|
||||||
Found 5 missing types:
|
|
||||||
✓ Found SDL_FColor in SDL_pixels.h
|
|
||||||
✓ Found SDL_PropertiesID in SDL_properties.h
|
|
||||||
✓ Found SDL_Rect in SDL_rect.h
|
|
||||||
✓ Found SDL_Window in SDL_video.h
|
|
||||||
✓ Found SDL_FlipMode in SDL_surface.h
|
|
||||||
|
|
||||||
Generated: gpu.zig
|
|
||||||
```
|
|
||||||
|
|
||||||
### With Mocks
|
|
||||||
```bash
|
|
||||||
zig build run -- SDL_gpu.h --output=gpu.zig --mocks=gpu_mock.c
|
|
||||||
```
|
|
||||||
|
|
||||||
**Generates**:
|
|
||||||
- `gpu.zig` - Complete Zig bindings with dependencies
|
|
||||||
- `gpu_mock.c` - C stub implementations for testing
|
|
||||||
|
|
||||||
## Known Limitations
|
|
||||||
|
|
||||||
### Minor Issues (Workaround Available)
|
|
||||||
|
|
||||||
1. **Field name `type`** - Shadows Zig keyword
|
|
||||||
- **Impact**: 1 compilation error
|
|
||||||
- **Workaround**: Manual edit to `@"type"` or auto-escape (30 min to implement)
|
|
||||||
- **Frequency**: Rare (only a few SDL structs)
|
|
||||||
|
|
||||||
2. **Function pointer typedefs** - Not supported
|
|
||||||
- **Impact**: Callback types not auto-resolved
|
|
||||||
- **Workaround**: Manual definition
|
|
||||||
- **Frequency**: Uncommon in SDL public API
|
|
||||||
|
|
||||||
3. **#define-based types** - Requires preprocessor
|
|
||||||
- **Impact**: Some flag types unresolved
|
|
||||||
- **Workaround**: Manual definition or clang preprocessing
|
|
||||||
- **Frequency**: Very rare
|
|
||||||
|
|
||||||
### Not Issues (Working As Designed)
|
|
||||||
|
|
||||||
- ✅ Opaque types: Fully supported
|
|
||||||
- ✅ Structs: Fully supported (including multi-field)
|
|
||||||
- ✅ Enums: Fully supported
|
|
||||||
- ✅ Flags: Fully supported
|
|
||||||
- ✅ Typedefs: Fully supported
|
|
||||||
- ✅ Functions: Fully supported
|
|
||||||
- ✅ Dependency extraction: 100% for supported types
|
|
||||||
|
|
||||||
## Quality Metrics
|
|
||||||
|
|
||||||
### Testing ✅
|
|
||||||
|
|
||||||
- **Unit Tests**: 26+ covering all features
|
|
||||||
- **Integration Tests**: SDL_gpu.h (169 decls)
|
|
||||||
- **Edge Cases**: Multi-field, typedefs, mixed patterns
|
|
||||||
- **Memory**: GPA validated (zero leaks in tested paths)
|
|
||||||
- **Pass Rate**: 100%
|
|
||||||
|
|
||||||
### Code Quality ✅
|
|
||||||
|
|
||||||
- **Modularity**: Clean separation of concerns
|
|
||||||
- **Error Handling**: Graceful fallback with warnings
|
|
||||||
- **Documentation**: Comprehensive multi-level docs
|
|
||||||
- **Maintainability**: Well-commented, clear structure
|
|
||||||
- **Extensibility**: Easy to add new patterns
|
|
||||||
|
|
||||||
### Performance ✅
|
|
||||||
|
|
||||||
- **SDL_gpu.h**: ~520ms total
|
|
||||||
- **Overhead**: +300ms for dependency resolution
|
|
||||||
- **Memory**: ~2-5MB peak
|
|
||||||
- **Scalability**: Linear with declaration count
|
|
||||||
|
|
||||||
## Documentation Quality
|
|
||||||
|
|
||||||
### Multi-Level Coverage
|
|
||||||
|
|
||||||
1. **Technical Deep Dive**: DEPENDENCY_FLOW.md (845 lines)
|
|
||||||
- Complete algorithm walkthrough
|
|
||||||
- Step-by-step execution flow
|
|
||||||
- Memory management details
|
|
||||||
|
|
||||||
2. **Visual Guides**: VISUAL_FLOW.md (365 lines)
|
|
||||||
- Flow diagrams
|
|
||||||
- Quick reference tables
|
|
||||||
- Example transformations
|
|
||||||
|
|
||||||
3. **Feature Docs**:
|
|
||||||
- MULTI_FIELD_IMPLEMENTATION.md (380 lines)
|
|
||||||
- TYPEDEF_IMPLEMENTATION.md (378 lines)
|
|
||||||
|
|
||||||
4. **User Guides**:
|
|
||||||
- QUICKSTART.md (203 lines)
|
|
||||||
- Updated PARSER_OVERVIEW.md
|
|
||||||
|
|
||||||
5. **Status Reports**:
|
|
||||||
- Multiple implementation status docs
|
|
||||||
- Session summaries
|
|
||||||
- Final status
|
|
||||||
|
|
||||||
**Total**: 4,000+ lines of comprehensive documentation
|
|
||||||
|
|
||||||
## Commit History
|
|
||||||
|
|
||||||
### Commit 1: d8ecb5e (First Session)
|
|
||||||
- Dependency resolution infrastructure
|
|
||||||
- Multi-field struct parsing
|
|
||||||
- 3,837 insertions, 112 deletions
|
|
||||||
|
|
||||||
### Commit 2: (This Session - To Be Created)
|
|
||||||
- Typedef scanning implementation
|
|
||||||
- 100% dependency resolution
|
|
||||||
- All priority features complete
|
|
||||||
|
|
||||||
## Success Criteria - All Met ✅
|
|
||||||
|
|
||||||
✅ Type detection: 100% (5/5 unique types)
|
|
||||||
✅ Type extraction: 100% (5/5 from headers)
|
|
||||||
✅ Code generation: 99% (1 minor error)
|
|
||||||
✅ Test coverage: 100% (26/26 passing)
|
|
||||||
✅ Memory safety: 100% (zero leaks)
|
|
||||||
✅ Documentation: Comprehensive
|
|
||||||
✅ Build status: Clean
|
|
||||||
✅ Performance: <1 second
|
|
||||||
|
|
||||||
## Recommendations
|
|
||||||
|
|
||||||
### For Users
|
|
||||||
|
|
||||||
**Ready to Use**: ✅ Yes
|
|
||||||
- Parser is production-ready
|
|
||||||
- Handles real-world SDL headers
|
|
||||||
- Generates high-quality bindings
|
|
||||||
- Comprehensive error reporting
|
|
||||||
|
|
||||||
**Known Workarounds**:
|
|
||||||
- Field named `type`: Edit to `@"type"` (5 second fix)
|
|
||||||
- Rare unsupported patterns: Add manual definitions
|
|
||||||
|
|
||||||
### For Developers
|
|
||||||
|
|
||||||
**Ready for Enhancement**: ✅ Yes
|
|
||||||
- Clean, modular codebase
|
|
||||||
- Comprehensive tests
|
|
||||||
- Well-documented flow
|
|
||||||
- Clear extension points
|
|
||||||
|
|
||||||
**Easy Additions**:
|
|
||||||
- Field name escaping (~30 min)
|
|
||||||
- Enhanced reporting (~30 min)
|
|
||||||
- Additional patterns (~1-2 hours each)
|
|
||||||
|
|
||||||
## Final Status
|
|
||||||
|
|
||||||
### What Works ✅
|
|
||||||
|
|
||||||
- ✅ All C declaration types (6 types)
|
|
||||||
- ✅ Automatic dependency resolution (100%)
|
|
||||||
- ✅ Multi-field struct parsing
|
|
||||||
- ✅ Typedef scanning
|
|
||||||
- ✅ Type conversion and naming
|
|
||||||
- ✅ Code generation with formatting
|
|
||||||
- ✅ C mock generation
|
|
||||||
- ✅ Comprehensive testing
|
|
||||||
|
|
||||||
### What's Optional
|
|
||||||
|
|
||||||
- ⏸️ Field name keyword escaping
|
|
||||||
- ⏸️ Function pointer typedefs
|
|
||||||
- ⏸️ #define constant scanning
|
|
||||||
- ⏸️ Enhanced visual reporting
|
|
||||||
|
|
||||||
### Success Grade: A+ 🎉
|
|
||||||
|
|
||||||
- **Functionality**: Complete
|
|
||||||
- **Quality**: Production-ready
|
|
||||||
- **Testing**: Comprehensive
|
|
||||||
- **Documentation**: Excellent
|
|
||||||
- **Performance**: Good
|
|
||||||
|
|
||||||
## Conclusion
|
|
||||||
|
|
||||||
The SDL3 header parser is now a **fully functional, production-ready tool** that automatically generates high-quality Zig bindings from SDL C headers with complete dependency resolution.
|
|
||||||
|
|
||||||
**Key Achievement**: Zero manual intervention required for supported patterns, 100% dependency resolution success rate.
|
|
||||||
|
|
||||||
**Ready for**:
|
|
||||||
- ✅ Production use
|
|
||||||
- ✅ SDL header parsing
|
|
||||||
- ✅ Integration into build systems
|
|
||||||
- ✅ Further enhancement
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
**Session End Time**: 2026-01-22 21:37 UTC
|
|
||||||
**Total Implementation Time**: ~5 hours
|
|
||||||
**Features Completed**: 3 major (all priorities)
|
|
||||||
**Tests Passing**: 26+ (100%)
|
|
||||||
**Documentation**: 4,000+ lines
|
|
||||||
**Status**: ✅ **MISSION COMPLETE**
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -1,36 +0,0 @@
|
||||||
{
|
|
||||||
"header": "SDL_init.h",
|
|
||||||
"opaque_types": [
|
|
||||||
],
|
|
||||||
"typedefs": [
|
|
||||||
],
|
|
||||||
"function_pointers": [
|
|
||||||
{"name": "SDL_AppInit_func", "return_type": "SDL_AppResult", "parameters": [{"name": "appstate", "type": "void **"}, {"name": "argc", "type": "int"}, {"name": "argv[]", "type": "char *"}]},
|
|
||||||
{"name": "SDL_AppIterate_func", "return_type": "SDL_AppResult", "parameters": [{"name": "appstate", "type": "void *"}]},
|
|
||||||
{"name": "SDL_AppEvent_func", "return_type": "SDL_AppResult", "parameters": [{"name": "appstate", "type": "void *"}, {"name": "event", "type": "SDL_Event *"}]},
|
|
||||||
{"name": "SDL_AppQuit_func", "return_type": "void", "parameters": [{"name": "appstate", "type": "void *"}, {"name": "result", "type": "SDL_AppResult"}]},
|
|
||||||
{"name": "SDL_MainThreadCallback", "return_type": "void", "parameters": [{"name": "userdata", "type": "void *"}]}
|
|
||||||
],
|
|
||||||
"enums": [
|
|
||||||
{"name": "SDL_AppResult", "values": []}
|
|
||||||
],
|
|
||||||
"structs": [
|
|
||||||
],
|
|
||||||
"unions": [
|
|
||||||
],
|
|
||||||
"flags": [
|
|
||||||
{"name": "SDL_InitFlags", "underlying_type": "Uint32", "values": [{"name": "SDL_INIT_AUDIO", "value": "0x00000010u", "comment": "`SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS`"}, {"name": "SDL_INIT_VIDEO", "value": "0x00000020u", "comment": "`SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread"}, {"name": "SDL_INIT_JOYSTICK", "value": "0x00000200u", "comment": "`SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS`, should be initialized on the same thread as SDL_INIT_VIDEO on Windows if you don't set SDL_HINT_JOYSTICK_THREAD"}, {"name": "SDL_INIT_HAPTIC", "value": "0x00001000u"}, {"name": "SDL_INIT_GAMEPAD", "value": "0x00002000u", "comment": "`SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK`"}, {"name": "SDL_INIT_EVENTS", "value": "0x00004000u"}, {"name": "SDL_INIT_SENSOR", "value": "0x00008000u", "comment": "`SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS`"}, {"name": "SDL_INIT_CAMERA", "value": "0x00010000u", "comment": "`SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS`"}]}
|
|
||||||
],
|
|
||||||
"functions": [
|
|
||||||
{"name": "SDL_Init", "return_type": "bool", "parameters": [{"name": "flags", "type": "SDL_InitFlags"}]},
|
|
||||||
{"name": "SDL_InitSubSystem", "return_type": "bool", "parameters": [{"name": "flags", "type": "SDL_InitFlags"}]},
|
|
||||||
{"name": "SDL_QuitSubSystem", "return_type": "void", "parameters": [{"name": "flags", "type": "SDL_InitFlags"}]},
|
|
||||||
{"name": "SDL_WasInit", "return_type": "SDL_InitFlags", "parameters": [{"name": "flags", "type": "SDL_InitFlags"}]},
|
|
||||||
{"name": "SDL_Quit", "return_type": "void", "parameters": []},
|
|
||||||
{"name": "SDL_IsMainThread", "return_type": "bool", "parameters": []},
|
|
||||||
{"name": "SDL_RunOnMainThread", "return_type": "bool", "parameters": [{"name": "callback", "type": "SDL_MainThreadCallback"}, {"name": "userdata", "type": "void *"}, {"name": "wait_complete", "type": "bool"}]},
|
|
||||||
{"name": "SDL_SetAppMetadata", "return_type": "bool", "parameters": [{"name": "appname", "type": "const char *"}, {"name": "appversion", "type": "const char *"}, {"name": "appidentifier", "type": "const char *"}]},
|
|
||||||
{"name": "SDL_SetAppMetadataProperty", "return_type": "bool", "parameters": [{"name": "name", "type": "const char *"}, {"name": "value", "type": "const char *"}]},
|
|
||||||
{"name": "SDL_GetAppMetadataProperty", "return_type": "const char *", "parameters": [{"name": "name", "type": "const char *"}]}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
@ -1,47 +0,0 @@
|
||||||
{
|
|
||||||
"header": "SDL_pixels.h",
|
|
||||||
"opaque_types": [
|
|
||||||
],
|
|
||||||
"typedefs": [
|
|
||||||
],
|
|
||||||
"function_pointers": [
|
|
||||||
],
|
|
||||||
"enums": [
|
|
||||||
{"name": "SDL_PixelType", "values": [{"name": "SDL_PIXELTYPE_UNKNOWN"}, {"name": "SDL_PIXELTYPE_INDEX1"}, {"name": "SDL_PIXELTYPE_INDEX4"}, {"name": "SDL_PIXELTYPE_INDEX8"}, {"name": "SDL_PIXELTYPE_PACKED8"}, {"name": "SDL_PIXELTYPE_PACKED16"}, {"name": "SDL_PIXELTYPE_PACKED32"}, {"name": "SDL_PIXELTYPE_ARRAYU8"}, {"name": "SDL_PIXELTYPE_ARRAYU16"}, {"name": "SDL_PIXELTYPE_ARRAYU32"}, {"name": "SDL_PIXELTYPE_ARRAYF16"}, {"name": "SDL_PIXELTYPE_ARRAYF32"}, {"name": "SDL_PIXELTYPE_INDEX2"}]},
|
|
||||||
{"name": "SDL_BitmapOrder", "values": [{"name": "SDL_BITMAPORDER_NONE"}, {"name": "SDL_BITMAPORDER_4321"}, {"name": "SDL_BITMAPORDER_1234"}]},
|
|
||||||
{"name": "SDL_PackedOrder", "values": [{"name": "SDL_PACKEDORDER_NONE"}, {"name": "SDL_PACKEDORDER_XRGB"}, {"name": "SDL_PACKEDORDER_RGBX"}, {"name": "SDL_PACKEDORDER_ARGB"}, {"name": "SDL_PACKEDORDER_RGBA"}, {"name": "SDL_PACKEDORDER_XBGR"}, {"name": "SDL_PACKEDORDER_BGRX"}, {"name": "SDL_PACKEDORDER_ABGR"}, {"name": "SDL_PACKEDORDER_BGRA"}]},
|
|
||||||
{"name": "SDL_ArrayOrder", "values": [{"name": "SDL_ARRAYORDER_NONE"}, {"name": "SDL_ARRAYORDER_RGB"}, {"name": "SDL_ARRAYORDER_RGBA"}, {"name": "SDL_ARRAYORDER_ARGB"}, {"name": "SDL_ARRAYORDER_BGR"}, {"name": "SDL_ARRAYORDER_BGRA"}, {"name": "SDL_ARRAYORDER_ABGR"}]},
|
|
||||||
{"name": "SDL_PackedLayout", "values": [{"name": "SDL_PACKEDLAYOUT_NONE"}, {"name": "SDL_PACKEDLAYOUT_332"}, {"name": "SDL_PACKEDLAYOUT_4444"}, {"name": "SDL_PACKEDLAYOUT_1555"}, {"name": "SDL_PACKEDLAYOUT_5551"}, {"name": "SDL_PACKEDLAYOUT_565"}, {"name": "SDL_PACKEDLAYOUT_8888"}, {"name": "SDL_PACKEDLAYOUT_2101010"}, {"name": "SDL_PACKEDLAYOUT_1010102"}]},
|
|
||||||
{"name": "SDL_PixelFormat", "values": [{"name": "SDL_PIXELFORMAT_UNKNOWN", "value": "0"}, {"name": "SDL_PIXELFORMAT_INDEX1LSB", "value": "0x11100100u"}, {"name": "SDL_PIXELFORMAT_INDEX1MSB", "value": "0x11200100u"}, {"name": "SDL_PIXELFORMAT_INDEX2LSB", "value": "0x1c100200u"}, {"name": "SDL_PIXELFORMAT_INDEX2MSB", "value": "0x1c200200u"}, {"name": "SDL_PIXELFORMAT_INDEX4LSB", "value": "0x12100400u"}, {"name": "SDL_PIXELFORMAT_INDEX4MSB", "value": "0x12200400u"}, {"name": "SDL_PIXELFORMAT_INDEX8", "value": "0x13000801u"}, {"name": "SDL_PIXELFORMAT_RGB332", "value": "0x14110801u"}, {"name": "SDL_PIXELFORMAT_XRGB4444", "value": "0x15120c02u"}, {"name": "SDL_PIXELFORMAT_XBGR4444", "value": "0x15520c02u"}, {"name": "SDL_PIXELFORMAT_XRGB1555", "value": "0x15130f02u"}, {"name": "SDL_PIXELFORMAT_XBGR1555", "value": "0x15530f02u"}, {"name": "SDL_PIXELFORMAT_ARGB4444", "value": "0x15321002u"}, {"name": "SDL_PIXELFORMAT_RGBA4444", "value": "0x15421002u"}, {"name": "SDL_PIXELFORMAT_ABGR4444", "value": "0x15721002u"}, {"name": "SDL_PIXELFORMAT_BGRA4444", "value": "0x15821002u"}, {"name": "SDL_PIXELFORMAT_ARGB1555", "value": "0x15331002u"}, {"name": "SDL_PIXELFORMAT_RGBA5551", "value": "0x15441002u"}, {"name": "SDL_PIXELFORMAT_ABGR1555", "value": "0x15731002u"}, {"name": "SDL_PIXELFORMAT_BGRA5551", "value": "0x15841002u"}, {"name": "SDL_PIXELFORMAT_RGB565", "value": "0x15151002u"}, {"name": "SDL_PIXELFORMAT_BGR565", "value": "0x15551002u"}, {"name": "SDL_PIXELFORMAT_RGB24", "value": "0x17101803u"}, {"name": "SDL_PIXELFORMAT_BGR24", "value": "0x17401803u"}, {"name": "SDL_PIXELFORMAT_XRGB8888", "value": "0x16161804u"}, {"name": "SDL_PIXELFORMAT_RGBX8888", "value": "0x16261804u"}, {"name": "SDL_PIXELFORMAT_XBGR8888", "value": "0x16561804u"}, {"name": "SDL_PIXELFORMAT_BGRX8888", "value": "0x16661804u"}, {"name": "SDL_PIXELFORMAT_ARGB8888", "value": "0x16362004u"}, {"name": "SDL_PIXELFORMAT_RGBA8888", "value": "0x16462004u"}, {"name": "SDL_PIXELFORMAT_ABGR8888", "value": "0x16762004u"}, {"name": "SDL_PIXELFORMAT_BGRA8888", "value": "0x16862004u"}, {"name": "SDL_PIXELFORMAT_XRGB2101010", "value": "0x16172004u"}, {"name": "SDL_PIXELFORMAT_XBGR2101010", "value": "0x16572004u"}, {"name": "SDL_PIXELFORMAT_ARGB2101010", "value": "0x16372004u"}, {"name": "SDL_PIXELFORMAT_ABGR2101010", "value": "0x16772004u"}, {"name": "SDL_PIXELFORMAT_RGB48", "value": "0x18103006u"}, {"name": "SDL_PIXELFORMAT_BGR48", "value": "0x18403006u"}, {"name": "SDL_PIXELFORMAT_RGBA64", "value": "0x18204008u"}, {"name": "SDL_PIXELFORMAT_ARGB64", "value": "0x18304008u"}, {"name": "SDL_PIXELFORMAT_BGRA64", "value": "0x18504008u"}, {"name": "SDL_PIXELFORMAT_ABGR64", "value": "0x18604008u"}, {"name": "SDL_PIXELFORMAT_RGB48_FLOAT", "value": "0x1a103006u"}, {"name": "SDL_PIXELFORMAT_BGR48_FLOAT", "value": "0x1a403006u"}, {"name": "SDL_PIXELFORMAT_RGBA64_FLOAT", "value": "0x1a204008u"}, {"name": "SDL_PIXELFORMAT_ARGB64_FLOAT", "value": "0x1a304008u"}, {"name": "SDL_PIXELFORMAT_BGRA64_FLOAT", "value": "0x1a504008u"}, {"name": "SDL_PIXELFORMAT_ABGR64_FLOAT", "value": "0x1a604008u"}, {"name": "SDL_PIXELFORMAT_RGB96_FLOAT", "value": "0x1b10600cu"}, {"name": "SDL_PIXELFORMAT_BGR96_FLOAT", "value": "0x1b40600cu"}, {"name": "SDL_PIXELFORMAT_RGBA128_FLOAT", "value": "0x1b208010u"}, {"name": "SDL_PIXELFORMAT_ARGB128_FLOAT", "value": "0x1b308010u"}, {"name": "SDL_PIXELFORMAT_BGRA128_FLOAT", "value": "0x1b508010u"}, {"name": "SDL_PIXELFORMAT_ABGR128_FLOAT", "value": "0x1b608010u"}, {"name": "SDL_PIXELFORMAT_RGBA32", "value": "SDL_PIXELFORMAT_RGBA8888"}, {"name": "SDL_PIXELFORMAT_ARGB32", "value": "SDL_PIXELFORMAT_ARGB8888"}, {"name": "SDL_PIXELFORMAT_BGRA32", "value": "SDL_PIXELFORMAT_BGRA8888"}, {"name": "SDL_PIXELFORMAT_ABGR32", "value": "SDL_PIXELFORMAT_ABGR8888"}, {"name": "SDL_PIXELFORMAT_RGBX32", "value": "SDL_PIXELFORMAT_RGBX8888"}, {"name": "SDL_PIXELFORMAT_XRGB32", "value": "SDL_PIXELFORMAT_XRGB8888"}, {"name": "SDL_PIXELFORMAT_BGRX32", "value": "SDL_PIXELFORMAT_BGRX8888"}, {"name": "SDL_PIXELFORMAT_XBGR32", "value": "SDL_PIXELFORMAT_XBGR8888"}]},
|
|
||||||
{"name": "SDL_ColorType", "values": [{"name": "SDL_COLOR_TYPE_UNKNOWN", "value": "0"}, {"name": "SDL_COLOR_TYPE_RGB", "value": "1"}, {"name": "SDL_COLOR_TYPE_YCBCR", "value": "2"}]},
|
|
||||||
{"name": "SDL_ColorRange", "values": [{"name": "SDL_COLOR_RANGE_UNKNOWN", "value": "0"}]},
|
|
||||||
{"name": "SDL_ColorPrimaries", "values": [{"name": "SDL_COLOR_PRIMARIES_UNKNOWN", "value": "0"}, {"name": "SDL_COLOR_PRIMARIES_UNSPECIFIED", "value": "2"}, {"name": "SDL_COLOR_PRIMARIES_CUSTOM", "value": "31"}]},
|
|
||||||
{"name": "SDL_TransferCharacteristics", "values": [{"name": "SDL_TRANSFER_CHARACTERISTICS_UNKNOWN", "value": "0"}, {"name": "SDL_TRANSFER_CHARACTERISTICS_UNSPECIFIED", "value": "2"}, {"name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR", "value": "8"}, {"name": "SDL_TRANSFER_CHARACTERISTICS_LOG100", "value": "9"}, {"name": "SDL_TRANSFER_CHARACTERISTICS_LOG100_SQRT10", "value": "10"}, {"name": "SDL_TRANSFER_CHARACTERISTICS_CUSTOM", "value": "31"}]},
|
|
||||||
{"name": "SDL_MatrixCoefficients", "values": [{"name": "SDL_MATRIX_COEFFICIENTS_IDENTITY", "value": "0"}, {"name": "SDL_MATRIX_COEFFICIENTS_UNSPECIFIED", "value": "2"}, {"name": "SDL_MATRIX_COEFFICIENTS_YCGCO", "value": "8"}, {"name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_NCL", "value": "12"}, {"name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_CL", "value": "13"}, {"name": "SDL_MATRIX_COEFFICIENTS_CUSTOM", "value": "31"}]},
|
|
||||||
{"name": "SDL_ChromaLocation", "values": []},
|
|
||||||
{"name": "SDL_Colorspace", "values": [{"name": "SDL_COLORSPACE_UNKNOWN", "value": "0"}]}
|
|
||||||
],
|
|
||||||
"structs": [
|
|
||||||
{"name": "SDL_Color", "fields": [{"name": "r", "type": "Uint8"}, {"name": "g", "type": "Uint8"}, {"name": "b", "type": "Uint8"}, {"name": "a", "type": "Uint8"}]},
|
|
||||||
{"name": "SDL_FColor", "fields": [{"name": "r", "type": "float"}, {"name": "g", "type": "float"}, {"name": "b", "type": "float"}, {"name": "a", "type": "float"}]},
|
|
||||||
{"name": "SDL_Palette", "fields": [{"name": "ncolors", "type": "int", "comment": "number of elements in `colors`."}, {"name": "colors", "type": "SDL_Color *", "comment": "an array of colors, `ncolors` long."}, {"name": "version", "type": "Uint32", "comment": "internal use only, do not touch."}, {"name": "refcount", "type": "int", "comment": "internal use only, do not touch."}]},
|
|
||||||
{"name": "SDL_PixelFormatDetails", "fields": [{"name": "format", "type": "SDL_PixelFormat"}, {"name": "bits_per_pixel", "type": "Uint8"}, {"name": "bytes_per_pixel", "type": "Uint8"}, {"name": "padding", "type": "Uint8[2]"}, {"name": "Rmask", "type": "Uint32"}, {"name": "Gmask", "type": "Uint32"}, {"name": "Bmask", "type": "Uint32"}, {"name": "Amask", "type": "Uint32"}, {"name": "Rbits", "type": "Uint8"}, {"name": "Gbits", "type": "Uint8"}, {"name": "Bbits", "type": "Uint8"}, {"name": "Abits", "type": "Uint8"}, {"name": "Rshift", "type": "Uint8"}, {"name": "Gshift", "type": "Uint8"}, {"name": "Bshift", "type": "Uint8"}, {"name": "Ashift", "type": "Uint8"}]}
|
|
||||||
],
|
|
||||||
"unions": [
|
|
||||||
],
|
|
||||||
"flags": [
|
|
||||||
],
|
|
||||||
"functions": [
|
|
||||||
{"name": "SDL_GetPixelFormatName", "return_type": "const char *", "parameters": [{"name": "format", "type": "SDL_PixelFormat"}]},
|
|
||||||
{"name": "SDL_GetMasksForPixelFormat", "return_type": "bool", "parameters": [{"name": "format", "type": "SDL_PixelFormat"}, {"name": "bpp", "type": "int *"}, {"name": "Rmask", "type": "Uint32 *"}, {"name": "Gmask", "type": "Uint32 *"}, {"name": "Bmask", "type": "Uint32 *"}, {"name": "Amask", "type": "Uint32 *"}]},
|
|
||||||
{"name": "SDL_GetPixelFormatForMasks", "return_type": "SDL_PixelFormat", "parameters": [{"name": "bpp", "type": "int"}, {"name": "Rmask", "type": "Uint32"}, {"name": "Gmask", "type": "Uint32"}, {"name": "Bmask", "type": "Uint32"}, {"name": "Amask", "type": "Uint32"}]},
|
|
||||||
{"name": "SDL_GetPixelFormatDetails", "return_type": "const SDL_PixelFormatDetails *", "parameters": [{"name": "format", "type": "SDL_PixelFormat"}]},
|
|
||||||
{"name": "SDL_CreatePalette", "return_type": "SDL_Palette *", "parameters": [{"name": "ncolors", "type": "int"}]},
|
|
||||||
{"name": "SDL_SetPaletteColors", "return_type": "bool", "parameters": [{"name": "palette", "type": "SDL_Palette *"}, {"name": "colors", "type": "const SDL_Color *"}, {"name": "firstcolor", "type": "int"}, {"name": "ncolors", "type": "int"}]},
|
|
||||||
{"name": "SDL_DestroyPalette", "return_type": "void", "parameters": [{"name": "palette", "type": "SDL_Palette *"}]},
|
|
||||||
{"name": "SDL_MapRGB", "return_type": "Uint32", "parameters": [{"name": "format", "type": "const SDL_PixelFormatDetails *"}, {"name": "palette", "type": "const SDL_Palette *"}, {"name": "r", "type": "Uint8"}, {"name": "g", "type": "Uint8"}, {"name": "b", "type": "Uint8"}]},
|
|
||||||
{"name": "SDL_MapRGBA", "return_type": "Uint32", "parameters": [{"name": "format", "type": "const SDL_PixelFormatDetails *"}, {"name": "palette", "type": "const SDL_Palette *"}, {"name": "r", "type": "Uint8"}, {"name": "g", "type": "Uint8"}, {"name": "b", "type": "Uint8"}, {"name": "a", "type": "Uint8"}]},
|
|
||||||
{"name": "SDL_GetRGB", "return_type": "void", "parameters": [{"name": "pixel", "type": "Uint32"}, {"name": "format", "type": "const SDL_PixelFormatDetails *"}, {"name": "palette", "type": "const SDL_Palette *"}, {"name": "r", "type": "Uint8 *"}, {"name": "g", "type": "Uint8 *"}, {"name": "b", "type": "Uint8 *"}]},
|
|
||||||
{"name": "SDL_GetRGBA", "return_type": "void", "parameters": [{"name": "pixel", "type": "Uint32"}, {"name": "format", "type": "const SDL_PixelFormatDetails *"}, {"name": "palette", "type": "const SDL_Palette *"}, {"name": "r", "type": "Uint8 *"}, {"name": "g", "type": "Uint8 *"}, {"name": "b", "type": "Uint8 *"}, {"name": "a", "type": "Uint8 *"}]}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
@ -1,33 +0,0 @@
|
||||||
{
|
|
||||||
"header": "SDL_rect.h",
|
|
||||||
"opaque_types": [
|
|
||||||
],
|
|
||||||
"typedefs": [
|
|
||||||
],
|
|
||||||
"function_pointers": [
|
|
||||||
],
|
|
||||||
"enums": [
|
|
||||||
],
|
|
||||||
"structs": [
|
|
||||||
{"name": "SDL_Point", "fields": [{"name": "x", "type": "int"}, {"name": "y", "type": "int"}]},
|
|
||||||
{"name": "SDL_FPoint", "fields": [{"name": "x", "type": "float"}, {"name": "y", "type": "float"}]},
|
|
||||||
{"name": "SDL_Rect", "fields": [{"name": "x", "type": "int"}, {"name": "y", "type": "int"}, {"name": "w", "type": "int"}, {"name": "h", "type": "int"}]},
|
|
||||||
{"name": "SDL_FRect", "fields": [{"name": "x", "type": "float"}, {"name": "y", "type": "float"}, {"name": "w", "type": "float"}, {"name": "h", "type": "float"}]}
|
|
||||||
],
|
|
||||||
"unions": [
|
|
||||||
],
|
|
||||||
"flags": [
|
|
||||||
],
|
|
||||||
"functions": [
|
|
||||||
{"name": "SDL_HasRectIntersection", "return_type": "bool", "parameters": [{"name": "A", "type": "const SDL_Rect *"}, {"name": "B", "type": "const SDL_Rect *"}]},
|
|
||||||
{"name": "SDL_GetRectIntersection", "return_type": "bool", "parameters": [{"name": "A", "type": "const SDL_Rect *"}, {"name": "B", "type": "const SDL_Rect *"}, {"name": "result", "type": "SDL_Rect *"}]},
|
|
||||||
{"name": "SDL_GetRectUnion", "return_type": "bool", "parameters": [{"name": "A", "type": "const SDL_Rect *"}, {"name": "B", "type": "const SDL_Rect *"}, {"name": "result", "type": "SDL_Rect *"}]},
|
|
||||||
{"name": "SDL_GetRectEnclosingPoints", "return_type": "bool", "parameters": [{"name": "points", "type": "const SDL_Point *"}, {"name": "count", "type": "int"}, {"name": "clip", "type": "const SDL_Rect *"}, {"name": "result", "type": "SDL_Rect *"}]},
|
|
||||||
{"name": "SDL_GetRectAndLineIntersection", "return_type": "bool", "parameters": [{"name": "rect", "type": "const SDL_Rect *"}, {"name": "X1", "type": "int *"}, {"name": "Y1", "type": "int *"}, {"name": "X2", "type": "int *"}, {"name": "Y2", "type": "int *"}]},
|
|
||||||
{"name": "SDL_HasRectIntersectionFloat", "return_type": "bool", "parameters": [{"name": "A", "type": "const SDL_FRect *"}, {"name": "B", "type": "const SDL_FRect *"}]},
|
|
||||||
{"name": "SDL_GetRectIntersectionFloat", "return_type": "bool", "parameters": [{"name": "A", "type": "const SDL_FRect *"}, {"name": "B", "type": "const SDL_FRect *"}, {"name": "result", "type": "SDL_FRect *"}]},
|
|
||||||
{"name": "SDL_GetRectUnionFloat", "return_type": "bool", "parameters": [{"name": "A", "type": "const SDL_FRect *"}, {"name": "B", "type": "const SDL_FRect *"}, {"name": "result", "type": "SDL_FRect *"}]},
|
|
||||||
{"name": "SDL_GetRectEnclosingPointsFloat", "return_type": "bool", "parameters": [{"name": "points", "type": "const SDL_FPoint *"}, {"name": "count", "type": "int"}, {"name": "clip", "type": "const SDL_FRect *"}, {"name": "result", "type": "SDL_FRect *"}]},
|
|
||||||
{"name": "SDL_GetRectAndLineIntersectionFloat", "return_type": "bool", "parameters": [{"name": "rect", "type": "const SDL_FRect *"}, {"name": "X1", "type": "float *"}, {"name": "Y1", "type": "float *"}, {"name": "X2", "type": "float *"}, {"name": "Y2", "type": "float *"}]}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
@ -1,143 +0,0 @@
|
||||||
{
|
|
||||||
"header": "SDL_video.h",
|
|
||||||
"opaque_types": [
|
|
||||||
{"name": "SDL_DisplayModeData"},
|
|
||||||
{"name": "SDL_Window"}
|
|
||||||
],
|
|
||||||
"typedefs": [
|
|
||||||
{"name": "SDL_DisplayID", "underlying_type": "Uint32"},
|
|
||||||
{"name": "SDL_WindowID", "underlying_type": "Uint32"},
|
|
||||||
{"name": "SDL_GLProfile", "underlying_type": "Uint32"},
|
|
||||||
{"name": "SDL_GLContextFlag", "underlying_type": "Uint32"},
|
|
||||||
{"name": "SDL_GLContextReleaseFlag", "underlying_type": "Uint32"},
|
|
||||||
{"name": "SDL_GLContextResetNotification", "underlying_type": "Uint32"}
|
|
||||||
],
|
|
||||||
"function_pointers": [
|
|
||||||
],
|
|
||||||
"enums": [
|
|
||||||
{"name": "SDL_SystemTheme", "values": []},
|
|
||||||
{"name": "SDL_DisplayOrientation", "values": []},
|
|
||||||
{"name": "SDL_FlashOperation", "values": []},
|
|
||||||
{"name": "SDL_HitTestResult", "values": []}
|
|
||||||
],
|
|
||||||
"structs": [
|
|
||||||
{"name": "SDL_DisplayMode", "fields": [{"name": "displayID", "type": "SDL_DisplayID", "comment": "the display this mode is associated with"}, {"name": "format", "type": "SDL_PixelFormat", "comment": "pixel format"}, {"name": "w", "type": "int", "comment": "width"}, {"name": "h", "type": "int", "comment": "height"}, {"name": "pixel_density", "type": "float", "comment": "scale converting size to pixels (e.g. a 1920x1080 mode with 2.0 scale would have 3840x2160 pixels)"}, {"name": "refresh_rate", "type": "float", "comment": "refresh rate (or 0.0f for unspecified)"}, {"name": "refresh_rate_numerator", "type": "int", "comment": "precise refresh rate numerator (or 0 for unspecified)"}, {"name": "refresh_rate_denominator", "type": "int", "comment": "precise refresh rate denominator"}, {"name": "internal", "type": "SDL_DisplayModeData *", "comment": "Private"}]},
|
|
||||||
{"name": "SDL_GLContextState", "fields": []}
|
|
||||||
],
|
|
||||||
"unions": [
|
|
||||||
],
|
|
||||||
"flags": [
|
|
||||||
{"name": "SDL_WindowFlags", "underlying_type": "Uint64", "values": [{"name": "SDL_WINDOW_FULLSCREEN", "value": "SDL_UINT64_C(0x0000000000000001)", "comment": "window is in fullscreen mode"}, {"name": "SDL_WINDOW_OPENGL", "value": "SDL_UINT64_C(0x0000000000000002)", "comment": "window usable with OpenGL context"}, {"name": "SDL_WINDOW_OCCLUDED", "value": "SDL_UINT64_C(0x0000000000000004)", "comment": "window is occluded"}, {"name": "SDL_WINDOW_HIDDEN", "value": "SDL_UINT64_C(0x0000000000000008)", "comment": "window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible"}, {"name": "SDL_WINDOW_BORDERLESS", "value": "SDL_UINT64_C(0x0000000000000010)", "comment": "no window decoration"}, {"name": "SDL_WINDOW_RESIZABLE", "value": "SDL_UINT64_C(0x0000000000000020)", "comment": "window can be resized"}, {"name": "SDL_WINDOW_MINIMIZED", "value": "SDL_UINT64_C(0x0000000000000040)", "comment": "window is minimized"}, {"name": "SDL_WINDOW_MAXIMIZED", "value": "SDL_UINT64_C(0x0000000000000080)", "comment": "window is maximized"}, {"name": "SDL_WINDOW_MOUSE_GRABBED", "value": "SDL_UINT64_C(0x0000000000000100)", "comment": "window has grabbed mouse input"}, {"name": "SDL_WINDOW_INPUT_FOCUS", "value": "SDL_UINT64_C(0x0000000000000200)", "comment": "window has input focus"}, {"name": "SDL_WINDOW_MOUSE_FOCUS", "value": "SDL_UINT64_C(0x0000000000000400)", "comment": "window has mouse focus"}, {"name": "SDL_WINDOW_EXTERNAL", "value": "SDL_UINT64_C(0x0000000000000800)", "comment": "window not created by SDL"}, {"name": "SDL_WINDOW_MODAL", "value": "SDL_UINT64_C(0x0000000000001000)", "comment": "window is modal"}, {"name": "SDL_WINDOW_HIGH_PIXEL_DENSITY", "value": "SDL_UINT64_C(0x0000000000002000)", "comment": "window uses high pixel density back buffer if possible"}, {"name": "SDL_WINDOW_MOUSE_CAPTURE", "value": "SDL_UINT64_C(0x0000000000004000)", "comment": "window has mouse captured (unrelated to MOUSE_GRABBED)"}, {"name": "SDL_WINDOW_MOUSE_RELATIVE_MODE", "value": "SDL_UINT64_C(0x0000000000008000)", "comment": "window has relative mode enabled"}, {"name": "SDL_WINDOW_ALWAYS_ON_TOP", "value": "SDL_UINT64_C(0x0000000000010000)", "comment": "window should always be above others"}, {"name": "SDL_WINDOW_UTILITY", "value": "SDL_UINT64_C(0x0000000000020000)", "comment": "window should be treated as a utility window, not showing in the task bar and window list"}, {"name": "SDL_WINDOW_TOOLTIP", "value": "SDL_UINT64_C(0x0000000000040000)", "comment": "window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window"}, {"name": "SDL_WINDOW_POPUP_MENU", "value": "SDL_UINT64_C(0x0000000000080000)", "comment": "window should be treated as a popup menu, requires a parent window"}, {"name": "SDL_WINDOW_KEYBOARD_GRABBED", "value": "SDL_UINT64_C(0x0000000000100000)", "comment": "window has grabbed keyboard input"}, {"name": "SDL_WINDOW_VULKAN", "value": "SDL_UINT64_C(0x0000000010000000)", "comment": "window usable for Vulkan surface"}, {"name": "SDL_WINDOW_METAL", "value": "SDL_UINT64_C(0x0000000020000000)", "comment": "window usable for Metal view"}, {"name": "SDL_WINDOW_TRANSPARENT", "value": "SDL_UINT64_C(0x0000000040000000)", "comment": "window with transparent buffer"}, {"name": "SDL_WINDOW_NOT_FOCUSABLE", "value": "SDL_UINT64_C(0x0000000080000000)", "comment": "window should not be focusable"}]}
|
|
||||||
],
|
|
||||||
"functions": [
|
|
||||||
{"name": "SDL_GetNumVideoDrivers", "return_type": "int", "parameters": []},
|
|
||||||
{"name": "SDL_GetVideoDriver", "return_type": "const char *", "parameters": [{"name": "index", "type": "int"}]},
|
|
||||||
{"name": "SDL_GetCurrentVideoDriver", "return_type": "const char *", "parameters": []},
|
|
||||||
{"name": "SDL_GetSystemTheme", "return_type": "SDL_SystemTheme", "parameters": []},
|
|
||||||
{"name": "SDL_GetDisplays", "return_type": "SDL_DisplayID *", "parameters": [{"name": "count", "type": "int *"}]},
|
|
||||||
{"name": "SDL_GetPrimaryDisplay", "return_type": "SDL_DisplayID", "parameters": []},
|
|
||||||
{"name": "SDL_GetDisplayProperties", "return_type": "SDL_PropertiesID", "parameters": [{"name": "displayID", "type": "SDL_DisplayID"}]},
|
|
||||||
{"name": "SDL_GetDisplayName", "return_type": "const char *", "parameters": [{"name": "displayID", "type": "SDL_DisplayID"}]},
|
|
||||||
{"name": "SDL_GetDisplayBounds", "return_type": "bool", "parameters": [{"name": "displayID", "type": "SDL_DisplayID"}, {"name": "rect", "type": "SDL_Rect *"}]},
|
|
||||||
{"name": "SDL_GetDisplayUsableBounds", "return_type": "bool", "parameters": [{"name": "displayID", "type": "SDL_DisplayID"}, {"name": "rect", "type": "SDL_Rect *"}]},
|
|
||||||
{"name": "SDL_GetNaturalDisplayOrientation", "return_type": "SDL_DisplayOrientation", "parameters": [{"name": "displayID", "type": "SDL_DisplayID"}]},
|
|
||||||
{"name": "SDL_GetCurrentDisplayOrientation", "return_type": "SDL_DisplayOrientation", "parameters": [{"name": "displayID", "type": "SDL_DisplayID"}]},
|
|
||||||
{"name": "SDL_GetDisplayContentScale", "return_type": "float", "parameters": [{"name": "displayID", "type": "SDL_DisplayID"}]},
|
|
||||||
{"name": "SDL_GetFullscreenDisplayModes", "return_type": "SDL_DisplayMode **", "parameters": [{"name": "displayID", "type": "SDL_DisplayID"}, {"name": "count", "type": "int *"}]},
|
|
||||||
{"name": "SDL_GetClosestFullscreenDisplayMode", "return_type": "bool", "parameters": [{"name": "displayID", "type": "SDL_DisplayID"}, {"name": "w", "type": "int"}, {"name": "h", "type": "int"}, {"name": "refresh_rate", "type": "float"}, {"name": "include_high_density_modes", "type": "bool"}, {"name": "closest", "type": "SDL_DisplayMode *"}]},
|
|
||||||
{"name": "SDL_GetDesktopDisplayMode", "return_type": "const SDL_DisplayMode *", "parameters": [{"name": "displayID", "type": "SDL_DisplayID"}]},
|
|
||||||
{"name": "SDL_GetCurrentDisplayMode", "return_type": "const SDL_DisplayMode *", "parameters": [{"name": "displayID", "type": "SDL_DisplayID"}]},
|
|
||||||
{"name": "SDL_GetDisplayForPoint", "return_type": "SDL_DisplayID", "parameters": [{"name": "point", "type": "const SDL_Point *"}]},
|
|
||||||
{"name": "SDL_GetDisplayForRect", "return_type": "SDL_DisplayID", "parameters": [{"name": "rect", "type": "const SDL_Rect *"}]},
|
|
||||||
{"name": "SDL_GetDisplayForWindow", "return_type": "SDL_DisplayID", "parameters": [{"name": "window", "type": "SDL_Window *"}]},
|
|
||||||
{"name": "SDL_GetWindowPixelDensity", "return_type": "float", "parameters": [{"name": "window", "type": "SDL_Window *"}]},
|
|
||||||
{"name": "SDL_GetWindowDisplayScale", "return_type": "float", "parameters": [{"name": "window", "type": "SDL_Window *"}]},
|
|
||||||
{"name": "SDL_SetWindowFullscreenMode", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "mode", "type": "const SDL_DisplayMode *"}]},
|
|
||||||
{"name": "SDL_GetWindowFullscreenMode", "return_type": "const SDL_DisplayMode *", "parameters": [{"name": "window", "type": "SDL_Window *"}]},
|
|
||||||
{"name": "SDL_GetWindowICCProfile", "return_type": "void *", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "size", "type": "size_t *"}]},
|
|
||||||
{"name": "SDL_GetWindowPixelFormat", "return_type": "SDL_PixelFormat", "parameters": [{"name": "window", "type": "SDL_Window *"}]},
|
|
||||||
{"name": "SDL_GetWindows", "return_type": "SDL_Window **", "parameters": [{"name": "count", "type": "int *"}]},
|
|
||||||
{"name": "SDL_CreateWindow", "return_type": "SDL_Window *", "parameters": [{"name": "title", "type": "const char *"}, {"name": "w", "type": "int"}, {"name": "h", "type": "int"}, {"name": "flags", "type": "SDL_WindowFlags"}]},
|
|
||||||
{"name": "SDL_CreatePopupWindow", "return_type": "SDL_Window *", "parameters": [{"name": "parent", "type": "SDL_Window *"}, {"name": "offset_x", "type": "int"}, {"name": "offset_y", "type": "int"}, {"name": "w", "type": "int"}, {"name": "h", "type": "int"}, {"name": "flags", "type": "SDL_WindowFlags"}]},
|
|
||||||
{"name": "SDL_CreateWindowWithProperties", "return_type": "SDL_Window *", "parameters": [{"name": "props", "type": "SDL_PropertiesID"}]},
|
|
||||||
{"name": "SDL_GetWindowID", "return_type": "SDL_WindowID", "parameters": [{"name": "window", "type": "SDL_Window *"}]},
|
|
||||||
{"name": "SDL_GetWindowFromID", "return_type": "SDL_Window *", "parameters": [{"name": "id", "type": "SDL_WindowID"}]},
|
|
||||||
{"name": "SDL_GetWindowParent", "return_type": "SDL_Window *", "parameters": [{"name": "window", "type": "SDL_Window *"}]},
|
|
||||||
{"name": "SDL_GetWindowProperties", "return_type": "SDL_PropertiesID", "parameters": [{"name": "window", "type": "SDL_Window *"}]},
|
|
||||||
{"name": "SDL_GetWindowFlags", "return_type": "SDL_WindowFlags", "parameters": [{"name": "window", "type": "SDL_Window *"}]},
|
|
||||||
{"name": "SDL_SetWindowTitle", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "title", "type": "const char *"}]},
|
|
||||||
{"name": "SDL_GetWindowTitle", "return_type": "const char *", "parameters": [{"name": "window", "type": "SDL_Window *"}]},
|
|
||||||
{"name": "SDL_SetWindowIcon", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "icon", "type": "SDL_Surface *"}]},
|
|
||||||
{"name": "SDL_SetWindowPosition", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "x", "type": "int"}, {"name": "y", "type": "int"}]},
|
|
||||||
{"name": "SDL_GetWindowPosition", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "x", "type": "int *"}, {"name": "y", "type": "int *"}]},
|
|
||||||
{"name": "SDL_SetWindowSize", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "w", "type": "int"}, {"name": "h", "type": "int"}]},
|
|
||||||
{"name": "SDL_GetWindowSize", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "w", "type": "int *"}, {"name": "h", "type": "int *"}]},
|
|
||||||
{"name": "SDL_GetWindowSafeArea", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "rect", "type": "SDL_Rect *"}]},
|
|
||||||
{"name": "SDL_SetWindowAspectRatio", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "min_aspect", "type": "float"}, {"name": "max_aspect", "type": "float"}]},
|
|
||||||
{"name": "SDL_GetWindowAspectRatio", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "min_aspect", "type": "float *"}, {"name": "max_aspect", "type": "float *"}]},
|
|
||||||
{"name": "SDL_GetWindowBordersSize", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "top", "type": "int *"}, {"name": "left", "type": "int *"}, {"name": "bottom", "type": "int *"}, {"name": "right", "type": "int *"}]},
|
|
||||||
{"name": "SDL_GetWindowSizeInPixels", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "w", "type": "int *"}, {"name": "h", "type": "int *"}]},
|
|
||||||
{"name": "SDL_SetWindowMinimumSize", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "min_w", "type": "int"}, {"name": "min_h", "type": "int"}]},
|
|
||||||
{"name": "SDL_GetWindowMinimumSize", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "w", "type": "int *"}, {"name": "h", "type": "int *"}]},
|
|
||||||
{"name": "SDL_SetWindowMaximumSize", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "max_w", "type": "int"}, {"name": "max_h", "type": "int"}]},
|
|
||||||
{"name": "SDL_GetWindowMaximumSize", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "w", "type": "int *"}, {"name": "h", "type": "int *"}]},
|
|
||||||
{"name": "SDL_SetWindowBordered", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "bordered", "type": "bool"}]},
|
|
||||||
{"name": "SDL_SetWindowResizable", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "resizable", "type": "bool"}]},
|
|
||||||
{"name": "SDL_SetWindowAlwaysOnTop", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "on_top", "type": "bool"}]},
|
|
||||||
{"name": "SDL_ShowWindow", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}]},
|
|
||||||
{"name": "SDL_HideWindow", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}]},
|
|
||||||
{"name": "SDL_RaiseWindow", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}]},
|
|
||||||
{"name": "SDL_MaximizeWindow", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}]},
|
|
||||||
{"name": "SDL_MinimizeWindow", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}]},
|
|
||||||
{"name": "SDL_RestoreWindow", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}]},
|
|
||||||
{"name": "SDL_SetWindowFullscreen", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "fullscreen", "type": "bool"}]},
|
|
||||||
{"name": "SDL_SyncWindow", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}]},
|
|
||||||
{"name": "SDL_WindowHasSurface", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}]},
|
|
||||||
{"name": "SDL_GetWindowSurface", "return_type": "SDL_Surface *", "parameters": [{"name": "window", "type": "SDL_Window *"}]},
|
|
||||||
{"name": "SDL_SetWindowSurfaceVSync", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "vsync", "type": "int"}]},
|
|
||||||
{"name": "SDL_GetWindowSurfaceVSync", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "vsync", "type": "int *"}]},
|
|
||||||
{"name": "SDL_UpdateWindowSurface", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}]},
|
|
||||||
{"name": "SDL_UpdateWindowSurfaceRects", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "rects", "type": "const SDL_Rect *"}, {"name": "numrects", "type": "int"}]},
|
|
||||||
{"name": "SDL_DestroyWindowSurface", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}]},
|
|
||||||
{"name": "SDL_SetWindowKeyboardGrab", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "grabbed", "type": "bool"}]},
|
|
||||||
{"name": "SDL_SetWindowMouseGrab", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "grabbed", "type": "bool"}]},
|
|
||||||
{"name": "SDL_GetWindowKeyboardGrab", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}]},
|
|
||||||
{"name": "SDL_GetWindowMouseGrab", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}]},
|
|
||||||
{"name": "SDL_GetGrabbedWindow", "return_type": "SDL_Window *", "parameters": []},
|
|
||||||
{"name": "SDL_SetWindowMouseRect", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "rect", "type": "const SDL_Rect *"}]},
|
|
||||||
{"name": "SDL_GetWindowMouseRect", "return_type": "const SDL_Rect *", "parameters": [{"name": "window", "type": "SDL_Window *"}]},
|
|
||||||
{"name": "SDL_SetWindowOpacity", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "opacity", "type": "float"}]},
|
|
||||||
{"name": "SDL_GetWindowOpacity", "return_type": "float", "parameters": [{"name": "window", "type": "SDL_Window *"}]},
|
|
||||||
{"name": "SDL_SetWindowParent", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "parent", "type": "SDL_Window *"}]},
|
|
||||||
{"name": "SDL_SetWindowModal", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "modal", "type": "bool"}]},
|
|
||||||
{"name": "SDL_SetWindowFocusable", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "focusable", "type": "bool"}]},
|
|
||||||
{"name": "SDL_ShowWindowSystemMenu", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "x", "type": "int"}, {"name": "y", "type": "int"}]},
|
|
||||||
{"name": "SDL_SetWindowHitTest", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "callback", "type": "SDL_HitTest"}, {"name": "callback_data", "type": "void *"}]},
|
|
||||||
{"name": "SDL_SetWindowShape", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "shape", "type": "SDL_Surface *"}]},
|
|
||||||
{"name": "SDL_FlashWindow", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "operation", "type": "SDL_FlashOperation"}]},
|
|
||||||
{"name": "SDL_DestroyWindow", "return_type": "void", "parameters": [{"name": "window", "type": "SDL_Window *"}]},
|
|
||||||
{"name": "SDL_ScreenSaverEnabled", "return_type": "bool", "parameters": []},
|
|
||||||
{"name": "SDL_EnableScreenSaver", "return_type": "bool", "parameters": []},
|
|
||||||
{"name": "SDL_DisableScreenSaver", "return_type": "bool", "parameters": []},
|
|
||||||
{"name": "SDL_GL_LoadLibrary", "return_type": "bool", "parameters": [{"name": "path", "type": "const char *"}]},
|
|
||||||
{"name": "SDL_GL_GetProcAddress", "return_type": "SDL_FunctionPointer", "parameters": [{"name": "proc", "type": "const char *"}]},
|
|
||||||
{"name": "SDL_EGL_GetProcAddress", "return_type": "SDL_FunctionPointer", "parameters": [{"name": "proc", "type": "const char *"}]},
|
|
||||||
{"name": "SDL_GL_UnloadLibrary", "return_type": "void", "parameters": []},
|
|
||||||
{"name": "SDL_GL_ExtensionSupported", "return_type": "bool", "parameters": [{"name": "extension", "type": "const char *"}]},
|
|
||||||
{"name": "SDL_GL_ResetAttributes", "return_type": "void", "parameters": []},
|
|
||||||
{"name": "SDL_GL_SetAttribute", "return_type": "bool", "parameters": [{"name": "attr", "type": "SDL_GLAttr"}, {"name": "value", "type": "int"}]},
|
|
||||||
{"name": "SDL_GL_GetAttribute", "return_type": "bool", "parameters": [{"name": "attr", "type": "SDL_GLAttr"}, {"name": "value", "type": "int *"}]},
|
|
||||||
{"name": "SDL_GL_CreateContext", "return_type": "SDL_GLContext", "parameters": [{"name": "window", "type": "SDL_Window *"}]},
|
|
||||||
{"name": "SDL_GL_MakeCurrent", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "context", "type": "SDL_GLContext"}]},
|
|
||||||
{"name": "SDL_GL_GetCurrentWindow", "return_type": "SDL_Window *", "parameters": []},
|
|
||||||
{"name": "SDL_GL_GetCurrentContext", "return_type": "SDL_GLContext", "parameters": []},
|
|
||||||
{"name": "SDL_EGL_GetCurrentDisplay", "return_type": "SDL_EGLDisplay", "parameters": []},
|
|
||||||
{"name": "SDL_EGL_GetCurrentConfig", "return_type": "SDL_EGLConfig", "parameters": []},
|
|
||||||
{"name": "SDL_EGL_GetWindowSurface", "return_type": "SDL_EGLSurface", "parameters": [{"name": "window", "type": "SDL_Window *"}]},
|
|
||||||
{"name": "SDL_EGL_SetAttributeCallbacks", "return_type": "void", "parameters": [{"name": "platformAttribCallback", "type": "SDL_EGLAttribArrayCallback"}, {"name": "surfaceAttribCallback", "type": "SDL_EGLIntArrayCallback"}, {"name": "contextAttribCallback", "type": "SDL_EGLIntArrayCallback"}, {"name": "userdata", "type": "void *"}]},
|
|
||||||
{"name": "SDL_GL_SetSwapInterval", "return_type": "bool", "parameters": [{"name": "interval", "type": "int"}]},
|
|
||||||
{"name": "SDL_GL_GetSwapInterval", "return_type": "bool", "parameters": [{"name": "interval", "type": "int *"}]},
|
|
||||||
{"name": "SDL_GL_SwapWindow", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}]},
|
|
||||||
{"name": "SDL_GL_DestroyContext", "return_type": "bool", "parameters": [{"name": "context", "type": "SDL_GLContext"}]}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,19 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
SDL_DIR="../SDL/include/SDL3"
|
|
||||||
HEADERS=(
|
|
||||||
"SDL_assert.h" "SDL_audio.h" "SDL_blendmode.h" "SDL_camera.h"
|
|
||||||
"SDL_clipboard.h" "SDL_events.h" "SDL_filesystem.h" "SDL_gamepad.h"
|
|
||||||
"SDL_gpu.h" "SDL_haptic.h" "SDL_hints.h" "SDL_init.h" "SDL_iostream.h"
|
|
||||||
"SDL_joystick.h" "SDL_keyboard.h" "SDL_keycode.h" "SDL_locale.h"
|
|
||||||
"SDL_log.h" "SDL_messagebox.h" "SDL_metal.h" "SDL_mouse.h"
|
|
||||||
"SDL_pen.h" "SDL_pixels.h" "SDL_power.h" "SDL_properties.h"
|
|
||||||
"SDL_rect.h" "SDL_render.h" "SDL_sensor.h" "SDL_stdinc.h"
|
|
||||||
"SDL_surface.h" "SDL_thread.h" "SDL_time.h" "SDL_timer.h"
|
|
||||||
"SDL_touch.h" "SDL_version.h" "SDL_video.h" "SDL_vulkan.h"
|
|
||||||
)
|
|
||||||
|
|
||||||
for header in "${HEADERS[@]}"; do
|
|
||||||
echo "=== Testing $header ==="
|
|
||||||
zig build run -- "$SDL_DIR/$header" --generate-json="/tmp/test.json" 2>&1 | grep -E "(error|Error|Found|Successfully)" | head -5
|
|
||||||
echo ""
|
|
||||||
done
|
|
||||||
|
|
@ -1,81 +0,0 @@
|
||||||
{
|
|
||||||
"header": "SDL_audio.h",
|
|
||||||
"opaque_types": [
|
|
||||||
{"name": "SDL_AudioStream"}
|
|
||||||
],
|
|
||||||
"typedefs": [
|
|
||||||
{"name": "SDL_AudioDeviceID", "underlying_type": "Uint32"}
|
|
||||||
],
|
|
||||||
"function_pointers": [
|
|
||||||
{"name": "SDL_AudioStreamCallback", "return_type": "void", "parameters": [{"name": "userdata", "type": "void *"}, {"name": "stream", "type": "SDL_AudioStream *"}, {"name": "additional_amount", "type": "int"}, {"name": "total_amount", "type": "int"}]},
|
|
||||||
{"name": "SDL_AudioPostmixCallback", "return_type": "void", "parameters": [{"name": "userdata", "type": "void *"}, {"name": "spec", "type": "const SDL_AudioSpec *"}, {"name": "buffer", "type": "float *"}, {"name": "buflen", "type": "int"}]}
|
|
||||||
],
|
|
||||||
"enums": [
|
|
||||||
{"name": "SDL_AudioFormat", "values": [{"name": "SDL_AUDIO_S16", "value": "SDL_AUDIO_S16LE"}, {"name": "SDL_AUDIO_S32", "value": "SDL_AUDIO_S32LE"}, {"name": "SDL_AUDIO_F32", "value": "SDL_AUDIO_F32LE"}]}
|
|
||||||
],
|
|
||||||
"structs": [
|
|
||||||
{"name": "SDL_AudioSpec", "fields": [{"name": "format", "type": "SDL_AudioFormat", "comment": "Audio data format"}, {"name": "channels", "type": "int", "comment": "Number of channels: 1 mono, 2 stereo, etc"}, {"name": "freq", "type": "int", "comment": "sample rate: sample frames per second"}]}
|
|
||||||
],
|
|
||||||
"unions": [
|
|
||||||
],
|
|
||||||
"flags": [
|
|
||||||
],
|
|
||||||
"functions": [
|
|
||||||
{"name": "SDL_GetNumAudioDrivers", "return_type": "int", "parameters": []},
|
|
||||||
{"name": "SDL_GetAudioDriver", "return_type": "const char *", "parameters": [{"name": "index", "type": "int"}]},
|
|
||||||
{"name": "SDL_GetCurrentAudioDriver", "return_type": "const char *", "parameters": []},
|
|
||||||
{"name": "SDL_GetAudioPlaybackDevices", "return_type": "SDL_AudioDeviceID *", "parameters": [{"name": "count", "type": "int *"}]},
|
|
||||||
{"name": "SDL_GetAudioRecordingDevices", "return_type": "SDL_AudioDeviceID *", "parameters": [{"name": "count", "type": "int *"}]},
|
|
||||||
{"name": "SDL_GetAudioDeviceName", "return_type": "const char *", "parameters": [{"name": "devid", "type": "SDL_AudioDeviceID"}]},
|
|
||||||
{"name": "SDL_GetAudioDeviceFormat", "return_type": "bool", "parameters": [{"name": "devid", "type": "SDL_AudioDeviceID"}, {"name": "spec", "type": "SDL_AudioSpec *"}, {"name": "sample_frames", "type": "int *"}]},
|
|
||||||
{"name": "SDL_GetAudioDeviceChannelMap", "return_type": "int *", "parameters": [{"name": "devid", "type": "SDL_AudioDeviceID"}, {"name": "count", "type": "int *"}]},
|
|
||||||
{"name": "SDL_OpenAudioDevice", "return_type": "SDL_AudioDeviceID", "parameters": [{"name": "devid", "type": "SDL_AudioDeviceID"}, {"name": "spec", "type": "const SDL_AudioSpec *"}]},
|
|
||||||
{"name": "SDL_IsAudioDevicePhysical", "return_type": "bool", "parameters": [{"name": "devid", "type": "SDL_AudioDeviceID"}]},
|
|
||||||
{"name": "SDL_IsAudioDevicePlayback", "return_type": "bool", "parameters": [{"name": "devid", "type": "SDL_AudioDeviceID"}]},
|
|
||||||
{"name": "SDL_PauseAudioDevice", "return_type": "bool", "parameters": [{"name": "devid", "type": "SDL_AudioDeviceID"}]},
|
|
||||||
{"name": "SDL_ResumeAudioDevice", "return_type": "bool", "parameters": [{"name": "devid", "type": "SDL_AudioDeviceID"}]},
|
|
||||||
{"name": "SDL_AudioDevicePaused", "return_type": "bool", "parameters": [{"name": "devid", "type": "SDL_AudioDeviceID"}]},
|
|
||||||
{"name": "SDL_GetAudioDeviceGain", "return_type": "float", "parameters": [{"name": "devid", "type": "SDL_AudioDeviceID"}]},
|
|
||||||
{"name": "SDL_SetAudioDeviceGain", "return_type": "bool", "parameters": [{"name": "devid", "type": "SDL_AudioDeviceID"}, {"name": "gain", "type": "float"}]},
|
|
||||||
{"name": "SDL_CloseAudioDevice", "return_type": "void", "parameters": [{"name": "devid", "type": "SDL_AudioDeviceID"}]},
|
|
||||||
{"name": "SDL_BindAudioStreams", "return_type": "bool", "parameters": [{"name": "devid", "type": "SDL_AudioDeviceID"}, {"name": "streams", "type": "SDL_AudioStream * const *"}, {"name": "num_streams", "type": "int"}]},
|
|
||||||
{"name": "SDL_BindAudioStream", "return_type": "bool", "parameters": [{"name": "devid", "type": "SDL_AudioDeviceID"}, {"name": "stream", "type": "SDL_AudioStream *"}]},
|
|
||||||
{"name": "SDL_UnbindAudioStreams", "return_type": "void", "parameters": [{"name": "streams", "type": "SDL_AudioStream * const *"}, {"name": "num_streams", "type": "int"}]},
|
|
||||||
{"name": "SDL_UnbindAudioStream", "return_type": "void", "parameters": [{"name": "stream", "type": "SDL_AudioStream *"}]},
|
|
||||||
{"name": "SDL_GetAudioStreamDevice", "return_type": "SDL_AudioDeviceID", "parameters": [{"name": "stream", "type": "SDL_AudioStream *"}]},
|
|
||||||
{"name": "SDL_CreateAudioStream", "return_type": "SDL_AudioStream *", "parameters": [{"name": "src_spec", "type": "const SDL_AudioSpec *"}, {"name": "dst_spec", "type": "const SDL_AudioSpec *"}]},
|
|
||||||
{"name": "SDL_GetAudioStreamProperties", "return_type": "SDL_PropertiesID", "parameters": [{"name": "stream", "type": "SDL_AudioStream *"}]},
|
|
||||||
{"name": "SDL_GetAudioStreamFormat", "return_type": "bool", "parameters": [{"name": "stream", "type": "SDL_AudioStream *"}, {"name": "src_spec", "type": "SDL_AudioSpec *"}, {"name": "dst_spec", "type": "SDL_AudioSpec *"}]},
|
|
||||||
{"name": "SDL_SetAudioStreamFormat", "return_type": "bool", "parameters": [{"name": "stream", "type": "SDL_AudioStream *"}, {"name": "src_spec", "type": "const SDL_AudioSpec *"}, {"name": "dst_spec", "type": "const SDL_AudioSpec *"}]},
|
|
||||||
{"name": "SDL_GetAudioStreamFrequencyRatio", "return_type": "float", "parameters": [{"name": "stream", "type": "SDL_AudioStream *"}]},
|
|
||||||
{"name": "SDL_SetAudioStreamFrequencyRatio", "return_type": "bool", "parameters": [{"name": "stream", "type": "SDL_AudioStream *"}, {"name": "ratio", "type": "float"}]},
|
|
||||||
{"name": "SDL_GetAudioStreamGain", "return_type": "float", "parameters": [{"name": "stream", "type": "SDL_AudioStream *"}]},
|
|
||||||
{"name": "SDL_SetAudioStreamGain", "return_type": "bool", "parameters": [{"name": "stream", "type": "SDL_AudioStream *"}, {"name": "gain", "type": "float"}]},
|
|
||||||
{"name": "SDL_GetAudioStreamInputChannelMap", "return_type": "int *", "parameters": [{"name": "stream", "type": "SDL_AudioStream *"}, {"name": "count", "type": "int *"}]},
|
|
||||||
{"name": "SDL_GetAudioStreamOutputChannelMap", "return_type": "int *", "parameters": [{"name": "stream", "type": "SDL_AudioStream *"}, {"name": "count", "type": "int *"}]},
|
|
||||||
{"name": "SDL_SetAudioStreamInputChannelMap", "return_type": "bool", "parameters": [{"name": "stream", "type": "SDL_AudioStream *"}, {"name": "chmap", "type": "const int *"}, {"name": "count", "type": "int"}]},
|
|
||||||
{"name": "SDL_SetAudioStreamOutputChannelMap", "return_type": "bool", "parameters": [{"name": "stream", "type": "SDL_AudioStream *"}, {"name": "chmap", "type": "const int *"}, {"name": "count", "type": "int"}]},
|
|
||||||
{"name": "SDL_PutAudioStreamData", "return_type": "bool", "parameters": [{"name": "stream", "type": "SDL_AudioStream *"}, {"name": "buf", "type": "const void *"}, {"name": "len", "type": "int"}]},
|
|
||||||
{"name": "SDL_GetAudioStreamData", "return_type": "int", "parameters": [{"name": "stream", "type": "SDL_AudioStream *"}, {"name": "buf", "type": "void *"}, {"name": "len", "type": "int"}]},
|
|
||||||
{"name": "SDL_GetAudioStreamAvailable", "return_type": "int", "parameters": [{"name": "stream", "type": "SDL_AudioStream *"}]},
|
|
||||||
{"name": "SDL_GetAudioStreamQueued", "return_type": "int", "parameters": [{"name": "stream", "type": "SDL_AudioStream *"}]},
|
|
||||||
{"name": "SDL_FlushAudioStream", "return_type": "bool", "parameters": [{"name": "stream", "type": "SDL_AudioStream *"}]},
|
|
||||||
{"name": "SDL_ClearAudioStream", "return_type": "bool", "parameters": [{"name": "stream", "type": "SDL_AudioStream *"}]},
|
|
||||||
{"name": "SDL_PauseAudioStreamDevice", "return_type": "bool", "parameters": [{"name": "stream", "type": "SDL_AudioStream *"}]},
|
|
||||||
{"name": "SDL_ResumeAudioStreamDevice", "return_type": "bool", "parameters": [{"name": "stream", "type": "SDL_AudioStream *"}]},
|
|
||||||
{"name": "SDL_AudioStreamDevicePaused", "return_type": "bool", "parameters": [{"name": "stream", "type": "SDL_AudioStream *"}]},
|
|
||||||
{"name": "SDL_LockAudioStream", "return_type": "bool", "parameters": [{"name": "stream", "type": "SDL_AudioStream *"}]},
|
|
||||||
{"name": "SDL_UnlockAudioStream", "return_type": "bool", "parameters": [{"name": "stream", "type": "SDL_AudioStream *"}]},
|
|
||||||
{"name": "SDL_SetAudioStreamGetCallback", "return_type": "bool", "parameters": [{"name": "stream", "type": "SDL_AudioStream *"}, {"name": "callback", "type": "SDL_AudioStreamCallback"}, {"name": "userdata", "type": "void *"}]},
|
|
||||||
{"name": "SDL_SetAudioStreamPutCallback", "return_type": "bool", "parameters": [{"name": "stream", "type": "SDL_AudioStream *"}, {"name": "callback", "type": "SDL_AudioStreamCallback"}, {"name": "userdata", "type": "void *"}]},
|
|
||||||
{"name": "SDL_DestroyAudioStream", "return_type": "void", "parameters": [{"name": "stream", "type": "SDL_AudioStream *"}]},
|
|
||||||
{"name": "SDL_OpenAudioDeviceStream", "return_type": "SDL_AudioStream *", "parameters": [{"name": "devid", "type": "SDL_AudioDeviceID"}, {"name": "spec", "type": "const SDL_AudioSpec *"}, {"name": "callback", "type": "SDL_AudioStreamCallback"}, {"name": "userdata", "type": "void *"}]},
|
|
||||||
{"name": "SDL_SetAudioPostmixCallback", "return_type": "bool", "parameters": [{"name": "devid", "type": "SDL_AudioDeviceID"}, {"name": "callback", "type": "SDL_AudioPostmixCallback"}, {"name": "userdata", "type": "void *"}]},
|
|
||||||
{"name": "SDL_LoadWAV_IO", "return_type": "bool", "parameters": [{"name": "src", "type": "SDL_IOStream *"}, {"name": "closeio", "type": "bool"}, {"name": "spec", "type": "SDL_AudioSpec *"}, {"name": "audio_buf", "type": "Uint8 **"}, {"name": "audio_len", "type": "Uint32 *"}]},
|
|
||||||
{"name": "SDL_LoadWAV", "return_type": "bool", "parameters": [{"name": "path", "type": "const char *"}, {"name": "spec", "type": "SDL_AudioSpec *"}, {"name": "audio_buf", "type": "Uint8 **"}, {"name": "audio_len", "type": "Uint32 *"}]},
|
|
||||||
{"name": "SDL_MixAudio", "return_type": "bool", "parameters": [{"name": "dst", "type": "Uint8 *"}, {"name": "src", "type": "const Uint8 *"}, {"name": "format", "type": "SDL_AudioFormat"}, {"name": "len", "type": "Uint32"}, {"name": "volume", "type": "float"}]},
|
|
||||||
{"name": "SDL_ConvertAudioSamples", "return_type": "bool", "parameters": [{"name": "src_spec", "type": "const SDL_AudioSpec *"}, {"name": "src_data", "type": "const Uint8 *"}, {"name": "src_len", "type": "int"}, {"name": "dst_spec", "type": "const SDL_AudioSpec *"}, {"name": "dst_data", "type": "Uint8 **"}, {"name": "dst_len", "type": "int *"}]},
|
|
||||||
{"name": "SDL_GetAudioFormatName", "return_type": "const char *", "parameters": [{"name": "format", "type": "SDL_AudioFormat"}]},
|
|
||||||
{"name": "SDL_GetSilenceValueForFormat", "return_type": "int", "parameters": [{"name": "format", "type": "SDL_AudioFormat"}]}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -1,46 +0,0 @@
|
||||||
{
|
|
||||||
"header": "SDL_keyboard.h",
|
|
||||||
"opaque_types": [
|
|
||||||
],
|
|
||||||
"typedefs": [
|
|
||||||
{"name": "SDL_KeyboardID", "underlying_type": "Uint32"}
|
|
||||||
],
|
|
||||||
"function_pointers": [
|
|
||||||
],
|
|
||||||
"enums": [
|
|
||||||
{"name": "SDL_TextInputType", "values": []},
|
|
||||||
{"name": "SDL_Capitalization", "values": []}
|
|
||||||
],
|
|
||||||
"structs": [
|
|
||||||
],
|
|
||||||
"unions": [
|
|
||||||
],
|
|
||||||
"flags": [
|
|
||||||
],
|
|
||||||
"functions": [
|
|
||||||
{"name": "SDL_HasKeyboard", "return_type": "bool", "parameters": []},
|
|
||||||
{"name": "SDL_GetKeyboards", "return_type": "SDL_KeyboardID *", "parameters": [{"name": "count", "type": "int *"}]},
|
|
||||||
{"name": "SDL_GetKeyboardNameForID", "return_type": "const char *", "parameters": [{"name": "instance_id", "type": "SDL_KeyboardID"}]},
|
|
||||||
{"name": "SDL_GetKeyboardFocus", "return_type": "SDL_Window *", "parameters": []},
|
|
||||||
{"name": "SDL_GetKeyboardState", "return_type": "const bool *", "parameters": [{"name": "numkeys", "type": "int *"}]},
|
|
||||||
{"name": "SDL_ResetKeyboard", "return_type": "void", "parameters": []},
|
|
||||||
{"name": "SDL_GetModState", "return_type": "SDL_Keymod", "parameters": []},
|
|
||||||
{"name": "SDL_SetModState", "return_type": "void", "parameters": [{"name": "modstate", "type": "SDL_Keymod"}]},
|
|
||||||
{"name": "SDL_GetKeyFromScancode", "return_type": "SDL_Keycode", "parameters": [{"name": "scancode", "type": "SDL_Scancode"}, {"name": "modstate", "type": "SDL_Keymod"}, {"name": "key_event", "type": "bool"}]},
|
|
||||||
{"name": "SDL_GetScancodeFromKey", "return_type": "SDL_Scancode", "parameters": [{"name": "key", "type": "SDL_Keycode"}, {"name": "modstate", "type": "SDL_Keymod *"}]},
|
|
||||||
{"name": "SDL_SetScancodeName", "return_type": "bool", "parameters": [{"name": "scancode", "type": "SDL_Scancode"}, {"name": "name", "type": "const char *"}]},
|
|
||||||
{"name": "SDL_GetScancodeName", "return_type": "const char *", "parameters": [{"name": "scancode", "type": "SDL_Scancode"}]},
|
|
||||||
{"name": "SDL_GetScancodeFromName", "return_type": "SDL_Scancode", "parameters": [{"name": "name", "type": "const char *"}]},
|
|
||||||
{"name": "SDL_GetKeyName", "return_type": "const char *", "parameters": [{"name": "key", "type": "SDL_Keycode"}]},
|
|
||||||
{"name": "SDL_GetKeyFromName", "return_type": "SDL_Keycode", "parameters": [{"name": "name", "type": "const char *"}]},
|
|
||||||
{"name": "SDL_StartTextInput", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}]},
|
|
||||||
{"name": "SDL_StartTextInputWithProperties", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "props", "type": "SDL_PropertiesID"}]},
|
|
||||||
{"name": "SDL_TextInputActive", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}]},
|
|
||||||
{"name": "SDL_StopTextInput", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}]},
|
|
||||||
{"name": "SDL_ClearComposition", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}]},
|
|
||||||
{"name": "SDL_SetTextInputArea", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "rect", "type": "const SDL_Rect *"}, {"name": "cursor", "type": "int"}]},
|
|
||||||
{"name": "SDL_GetTextInputArea", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "rect", "type": "SDL_Rect *"}, {"name": "cursor", "type": "int *"}]},
|
|
||||||
{"name": "SDL_HasScreenKeyboardSupport", "return_type": "bool", "parameters": []},
|
|
||||||
{"name": "SDL_ScreenKeyboardShown", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}]}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
@ -1,212 +0,0 @@
|
||||||
{
|
|
||||||
"header": "SDL_atomic.h",
|
|
||||||
"opaque_types": [],
|
|
||||||
"typedefs": [
|
|
||||||
{
|
|
||||||
"name": "SDL_SpinLock",
|
|
||||||
"underlying_type": "int"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"function_pointers": [
|
|
||||||
{
|
|
||||||
"name": "SDL_KernelMemoryBarrierFunc",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": []
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"enums": [],
|
|
||||||
"structs": [
|
|
||||||
{
|
|
||||||
"name": "SDL_AtomicInt",
|
|
||||||
"fields": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_AtomicU32",
|
|
||||||
"fields": []
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"unions": [],
|
|
||||||
"flags": [],
|
|
||||||
"functions": [
|
|
||||||
{
|
|
||||||
"name": "SDL_TryLockSpinlock",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "lock",
|
|
||||||
"type": "SDL_SpinLock *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_LockSpinlock",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "lock",
|
|
||||||
"type": "SDL_SpinLock *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_UnlockSpinlock",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "lock",
|
|
||||||
"type": "SDL_SpinLock *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_MemoryBarrierReleaseFunction",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_MemoryBarrierAcquireFunction",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_CompareAndSwapAtomicInt",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "a",
|
|
||||||
"type": "SDL_AtomicInt *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "oldval",
|
|
||||||
"type": "int"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "newval",
|
|
||||||
"type": "int"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_SetAtomicInt",
|
|
||||||
"return_type": "int",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "a",
|
|
||||||
"type": "SDL_AtomicInt *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "v",
|
|
||||||
"type": "int"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetAtomicInt",
|
|
||||||
"return_type": "int",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "a",
|
|
||||||
"type": "SDL_AtomicInt *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_AddAtomicInt",
|
|
||||||
"return_type": "int",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "a",
|
|
||||||
"type": "SDL_AtomicInt *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "v",
|
|
||||||
"type": "int"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_CompareAndSwapAtomicU32",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "a",
|
|
||||||
"type": "SDL_AtomicU32 *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "oldval",
|
|
||||||
"type": "Uint32"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "newval",
|
|
||||||
"type": "Uint32"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_SetAtomicU32",
|
|
||||||
"return_type": "Uint32",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "a",
|
|
||||||
"type": "SDL_AtomicU32 *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "v",
|
|
||||||
"type": "Uint32"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetAtomicU32",
|
|
||||||
"return_type": "Uint32",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "a",
|
|
||||||
"type": "SDL_AtomicU32 *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_CompareAndSwapAtomicPointer",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "a",
|
|
||||||
"type": "void **"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "oldval",
|
|
||||||
"type": "void *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "newval",
|
|
||||||
"type": "void *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_SetAtomicPointer",
|
|
||||||
"return_type": "void *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "a",
|
|
||||||
"type": "void **"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "v",
|
|
||||||
"type": "void *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetAtomicPointer",
|
|
||||||
"return_type": "void *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "a",
|
|
||||||
"type": "void **"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
@ -1,859 +0,0 @@
|
||||||
{
|
|
||||||
"header": "SDL_audio.h",
|
|
||||||
"opaque_types": [
|
|
||||||
{
|
|
||||||
"name": "SDL_AudioStream"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"typedefs": [
|
|
||||||
{
|
|
||||||
"name": "SDL_AudioDeviceID",
|
|
||||||
"underlying_type": "Uint32"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"function_pointers": [
|
|
||||||
{
|
|
||||||
"name": "SDL_AudioStreamCallback",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "userdata",
|
|
||||||
"type": "void *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "stream",
|
|
||||||
"type": "SDL_AudioStream *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "additional_amount",
|
|
||||||
"type": "int"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "total_amount",
|
|
||||||
"type": "int"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_AudioPostmixCallback",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "userdata",
|
|
||||||
"type": "void *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "spec",
|
|
||||||
"type": "const SDL_AudioSpec *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "buffer",
|
|
||||||
"type": "float *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "buflen",
|
|
||||||
"type": "int"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"enums": [
|
|
||||||
{
|
|
||||||
"name": "SDL_AudioFormat",
|
|
||||||
"values": [
|
|
||||||
{
|
|
||||||
"name": "SDL_AUDIO_S16",
|
|
||||||
"value": "SDL_AUDIO_S16LE"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_AUDIO_S32",
|
|
||||||
"value": "SDL_AUDIO_S32LE"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_AUDIO_F32",
|
|
||||||
"value": "SDL_AUDIO_F32LE"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"structs": [
|
|
||||||
{
|
|
||||||
"name": "SDL_AudioSpec",
|
|
||||||
"fields": [
|
|
||||||
{
|
|
||||||
"name": "format",
|
|
||||||
"type": "SDL_AudioFormat",
|
|
||||||
"comment": "Audio data format"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "channels",
|
|
||||||
"type": "int",
|
|
||||||
"comment": "Number of channels: 1 mono, 2 stereo, etc"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "freq",
|
|
||||||
"type": "int",
|
|
||||||
"comment": "sample rate: sample frames per second"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"unions": [],
|
|
||||||
"flags": [],
|
|
||||||
"functions": [
|
|
||||||
{
|
|
||||||
"name": "SDL_GetNumAudioDrivers",
|
|
||||||
"return_type": "int",
|
|
||||||
"parameters": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetAudioDriver",
|
|
||||||
"return_type": "const char *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "index",
|
|
||||||
"type": "int"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetCurrentAudioDriver",
|
|
||||||
"return_type": "const char *",
|
|
||||||
"parameters": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetAudioPlaybackDevices",
|
|
||||||
"return_type": "SDL_AudioDeviceID *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "count",
|
|
||||||
"type": "int *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetAudioRecordingDevices",
|
|
||||||
"return_type": "SDL_AudioDeviceID *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "count",
|
|
||||||
"type": "int *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetAudioDeviceName",
|
|
||||||
"return_type": "const char *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "devid",
|
|
||||||
"type": "SDL_AudioDeviceID"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetAudioDeviceFormat",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "devid",
|
|
||||||
"type": "SDL_AudioDeviceID"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "spec",
|
|
||||||
"type": "SDL_AudioSpec *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "sample_frames",
|
|
||||||
"type": "int *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetAudioDeviceChannelMap",
|
|
||||||
"return_type": "int *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "devid",
|
|
||||||
"type": "SDL_AudioDeviceID"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "count",
|
|
||||||
"type": "int *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_OpenAudioDevice",
|
|
||||||
"return_type": "SDL_AudioDeviceID",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "devid",
|
|
||||||
"type": "SDL_AudioDeviceID"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "spec",
|
|
||||||
"type": "const SDL_AudioSpec *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_IsAudioDevicePhysical",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "devid",
|
|
||||||
"type": "SDL_AudioDeviceID"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_IsAudioDevicePlayback",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "devid",
|
|
||||||
"type": "SDL_AudioDeviceID"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PauseAudioDevice",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "devid",
|
|
||||||
"type": "SDL_AudioDeviceID"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_ResumeAudioDevice",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "devid",
|
|
||||||
"type": "SDL_AudioDeviceID"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_AudioDevicePaused",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "devid",
|
|
||||||
"type": "SDL_AudioDeviceID"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetAudioDeviceGain",
|
|
||||||
"return_type": "float",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "devid",
|
|
||||||
"type": "SDL_AudioDeviceID"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_SetAudioDeviceGain",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "devid",
|
|
||||||
"type": "SDL_AudioDeviceID"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "gain",
|
|
||||||
"type": "float"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_CloseAudioDevice",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "devid",
|
|
||||||
"type": "SDL_AudioDeviceID"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_BindAudioStreams",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "devid",
|
|
||||||
"type": "SDL_AudioDeviceID"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "streams",
|
|
||||||
"type": "SDL_AudioStream * const *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "num_streams",
|
|
||||||
"type": "int"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_BindAudioStream",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "devid",
|
|
||||||
"type": "SDL_AudioDeviceID"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "stream",
|
|
||||||
"type": "SDL_AudioStream *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_UnbindAudioStreams",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "streams",
|
|
||||||
"type": "SDL_AudioStream * const *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "num_streams",
|
|
||||||
"type": "int"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_UnbindAudioStream",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "stream",
|
|
||||||
"type": "SDL_AudioStream *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetAudioStreamDevice",
|
|
||||||
"return_type": "SDL_AudioDeviceID",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "stream",
|
|
||||||
"type": "SDL_AudioStream *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_CreateAudioStream",
|
|
||||||
"return_type": "SDL_AudioStream *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "src_spec",
|
|
||||||
"type": "const SDL_AudioSpec *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "dst_spec",
|
|
||||||
"type": "const SDL_AudioSpec *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetAudioStreamProperties",
|
|
||||||
"return_type": "SDL_PropertiesID",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "stream",
|
|
||||||
"type": "SDL_AudioStream *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetAudioStreamFormat",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "stream",
|
|
||||||
"type": "SDL_AudioStream *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "src_spec",
|
|
||||||
"type": "SDL_AudioSpec *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "dst_spec",
|
|
||||||
"type": "SDL_AudioSpec *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_SetAudioStreamFormat",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "stream",
|
|
||||||
"type": "SDL_AudioStream *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "src_spec",
|
|
||||||
"type": "const SDL_AudioSpec *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "dst_spec",
|
|
||||||
"type": "const SDL_AudioSpec *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetAudioStreamFrequencyRatio",
|
|
||||||
"return_type": "float",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "stream",
|
|
||||||
"type": "SDL_AudioStream *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_SetAudioStreamFrequencyRatio",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "stream",
|
|
||||||
"type": "SDL_AudioStream *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "ratio",
|
|
||||||
"type": "float"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetAudioStreamGain",
|
|
||||||
"return_type": "float",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "stream",
|
|
||||||
"type": "SDL_AudioStream *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_SetAudioStreamGain",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "stream",
|
|
||||||
"type": "SDL_AudioStream *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "gain",
|
|
||||||
"type": "float"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetAudioStreamInputChannelMap",
|
|
||||||
"return_type": "int *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "stream",
|
|
||||||
"type": "SDL_AudioStream *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "count",
|
|
||||||
"type": "int *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetAudioStreamOutputChannelMap",
|
|
||||||
"return_type": "int *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "stream",
|
|
||||||
"type": "SDL_AudioStream *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "count",
|
|
||||||
"type": "int *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_SetAudioStreamInputChannelMap",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "stream",
|
|
||||||
"type": "SDL_AudioStream *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "chmap",
|
|
||||||
"type": "const int *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "count",
|
|
||||||
"type": "int"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_SetAudioStreamOutputChannelMap",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "stream",
|
|
||||||
"type": "SDL_AudioStream *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "chmap",
|
|
||||||
"type": "const int *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "count",
|
|
||||||
"type": "int"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PutAudioStreamData",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "stream",
|
|
||||||
"type": "SDL_AudioStream *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "buf",
|
|
||||||
"type": "const void *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "len",
|
|
||||||
"type": "int"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetAudioStreamData",
|
|
||||||
"return_type": "int",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "stream",
|
|
||||||
"type": "SDL_AudioStream *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "buf",
|
|
||||||
"type": "void *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "len",
|
|
||||||
"type": "int"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetAudioStreamAvailable",
|
|
||||||
"return_type": "int",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "stream",
|
|
||||||
"type": "SDL_AudioStream *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetAudioStreamQueued",
|
|
||||||
"return_type": "int",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "stream",
|
|
||||||
"type": "SDL_AudioStream *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_FlushAudioStream",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "stream",
|
|
||||||
"type": "SDL_AudioStream *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_ClearAudioStream",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "stream",
|
|
||||||
"type": "SDL_AudioStream *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PauseAudioStreamDevice",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "stream",
|
|
||||||
"type": "SDL_AudioStream *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_ResumeAudioStreamDevice",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "stream",
|
|
||||||
"type": "SDL_AudioStream *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_AudioStreamDevicePaused",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "stream",
|
|
||||||
"type": "SDL_AudioStream *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_LockAudioStream",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "stream",
|
|
||||||
"type": "SDL_AudioStream *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_UnlockAudioStream",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "stream",
|
|
||||||
"type": "SDL_AudioStream *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_SetAudioStreamGetCallback",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "stream",
|
|
||||||
"type": "SDL_AudioStream *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "callback",
|
|
||||||
"type": "SDL_AudioStreamCallback"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "userdata",
|
|
||||||
"type": "void *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_SetAudioStreamPutCallback",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "stream",
|
|
||||||
"type": "SDL_AudioStream *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "callback",
|
|
||||||
"type": "SDL_AudioStreamCallback"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "userdata",
|
|
||||||
"type": "void *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_DestroyAudioStream",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "stream",
|
|
||||||
"type": "SDL_AudioStream *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_OpenAudioDeviceStream",
|
|
||||||
"return_type": "SDL_AudioStream *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "devid",
|
|
||||||
"type": "SDL_AudioDeviceID"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "spec",
|
|
||||||
"type": "const SDL_AudioSpec *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "callback",
|
|
||||||
"type": "SDL_AudioStreamCallback"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "userdata",
|
|
||||||
"type": "void *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_SetAudioPostmixCallback",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "devid",
|
|
||||||
"type": "SDL_AudioDeviceID"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "callback",
|
|
||||||
"type": "SDL_AudioPostmixCallback"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "userdata",
|
|
||||||
"type": "void *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_LoadWAV_IO",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "src",
|
|
||||||
"type": "SDL_IOStream *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "closeio",
|
|
||||||
"type": "bool"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "spec",
|
|
||||||
"type": "SDL_AudioSpec *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "audio_buf",
|
|
||||||
"type": "Uint8 **"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "audio_len",
|
|
||||||
"type": "Uint32 *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_LoadWAV",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "path",
|
|
||||||
"type": "const char *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "spec",
|
|
||||||
"type": "SDL_AudioSpec *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "audio_buf",
|
|
||||||
"type": "Uint8 **"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "audio_len",
|
|
||||||
"type": "Uint32 *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_MixAudio",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "dst",
|
|
||||||
"type": "Uint8 *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "src",
|
|
||||||
"type": "const Uint8 *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "format",
|
|
||||||
"type": "SDL_AudioFormat"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "len",
|
|
||||||
"type": "Uint32"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "volume",
|
|
||||||
"type": "float"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_ConvertAudioSamples",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "src_spec",
|
|
||||||
"type": "const SDL_AudioSpec *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "src_data",
|
|
||||||
"type": "const Uint8 *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "src_len",
|
|
||||||
"type": "int"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "dst_spec",
|
|
||||||
"type": "const SDL_AudioSpec *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "dst_data",
|
|
||||||
"type": "Uint8 **"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "dst_len",
|
|
||||||
"type": "int *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetAudioFormatName",
|
|
||||||
"return_type": "const char *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "format",
|
|
||||||
"type": "SDL_AudioFormat"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetSilenceValueForFormat",
|
|
||||||
"return_type": "int",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "format",
|
|
||||||
"type": "SDL_AudioFormat"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
@ -1,56 +0,0 @@
|
||||||
{
|
|
||||||
"header": "SDL_blendmode.h",
|
|
||||||
"opaque_types": [],
|
|
||||||
"typedefs": [
|
|
||||||
{
|
|
||||||
"name": "SDL_BlendMode",
|
|
||||||
"underlying_type": "Uint32"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"function_pointers": [],
|
|
||||||
"enums": [
|
|
||||||
{
|
|
||||||
"name": "SDL_BlendOperation",
|
|
||||||
"values": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_BlendFactor",
|
|
||||||
"values": []
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"structs": [],
|
|
||||||
"unions": [],
|
|
||||||
"flags": [],
|
|
||||||
"functions": [
|
|
||||||
{
|
|
||||||
"name": "SDL_ComposeCustomBlendMode",
|
|
||||||
"return_type": "SDL_BlendMode",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "srcColorFactor",
|
|
||||||
"type": "SDL_BlendFactor"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "dstColorFactor",
|
|
||||||
"type": "SDL_BlendFactor"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "colorOperation",
|
|
||||||
"type": "SDL_BlendOperation"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "srcAlphaFactor",
|
|
||||||
"type": "SDL_BlendFactor"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "dstAlphaFactor",
|
|
||||||
"type": "SDL_BlendFactor"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "alphaOperation",
|
|
||||||
"type": "SDL_BlendOperation"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
@ -1,232 +0,0 @@
|
||||||
{
|
|
||||||
"header": "SDL_camera.h",
|
|
||||||
"opaque_types": [
|
|
||||||
{
|
|
||||||
"name": "SDL_Camera"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"typedefs": [
|
|
||||||
{
|
|
||||||
"name": "SDL_CameraID",
|
|
||||||
"underlying_type": "Uint32"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"function_pointers": [],
|
|
||||||
"enums": [
|
|
||||||
{
|
|
||||||
"name": "SDL_CameraPosition",
|
|
||||||
"values": [
|
|
||||||
{
|
|
||||||
"name": "SDL_CAMERA_POSITION_UNKNOWN"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_CAMERA_POSITION_FRONT_FACING"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_CAMERA_POSITION_BACK_FACING"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"structs": [
|
|
||||||
{
|
|
||||||
"name": "SDL_CameraSpec",
|
|
||||||
"fields": [
|
|
||||||
{
|
|
||||||
"name": "format",
|
|
||||||
"type": "SDL_PixelFormat",
|
|
||||||
"comment": "Frame format"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "colorspace",
|
|
||||||
"type": "SDL_Colorspace",
|
|
||||||
"comment": "Frame colorspace"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "width",
|
|
||||||
"type": "int",
|
|
||||||
"comment": "Frame width"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "height",
|
|
||||||
"type": "int",
|
|
||||||
"comment": "Frame height"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "framerate_numerator",
|
|
||||||
"type": "int",
|
|
||||||
"comment": "Frame rate numerator ((num / denom) == FPS, (denom / num) == duration in seconds)"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "framerate_denominator",
|
|
||||||
"type": "int",
|
|
||||||
"comment": "Frame rate demoninator ((num / denom) == FPS, (denom / num) == duration in seconds)"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"unions": [],
|
|
||||||
"flags": [],
|
|
||||||
"functions": [
|
|
||||||
{
|
|
||||||
"name": "SDL_GetNumCameraDrivers",
|
|
||||||
"return_type": "int",
|
|
||||||
"parameters": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetCameraDriver",
|
|
||||||
"return_type": "const char *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "index",
|
|
||||||
"type": "int"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetCurrentCameraDriver",
|
|
||||||
"return_type": "const char *",
|
|
||||||
"parameters": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetCameras",
|
|
||||||
"return_type": "SDL_CameraID *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "count",
|
|
||||||
"type": "int *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetCameraSupportedFormats",
|
|
||||||
"return_type": "SDL_CameraSpec **",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "instance_id",
|
|
||||||
"type": "SDL_CameraID"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "count",
|
|
||||||
"type": "int *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetCameraName",
|
|
||||||
"return_type": "const char *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "instance_id",
|
|
||||||
"type": "SDL_CameraID"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetCameraPosition",
|
|
||||||
"return_type": "SDL_CameraPosition",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "instance_id",
|
|
||||||
"type": "SDL_CameraID"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_OpenCamera",
|
|
||||||
"return_type": "SDL_Camera *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "instance_id",
|
|
||||||
"type": "SDL_CameraID"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "spec",
|
|
||||||
"type": "const SDL_CameraSpec *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetCameraPermissionState",
|
|
||||||
"return_type": "int",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "camera",
|
|
||||||
"type": "SDL_Camera *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetCameraID",
|
|
||||||
"return_type": "SDL_CameraID",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "camera",
|
|
||||||
"type": "SDL_Camera *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetCameraProperties",
|
|
||||||
"return_type": "SDL_PropertiesID",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "camera",
|
|
||||||
"type": "SDL_Camera *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetCameraFormat",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "camera",
|
|
||||||
"type": "SDL_Camera *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "spec",
|
|
||||||
"type": "SDL_CameraSpec *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_AcquireCameraFrame",
|
|
||||||
"return_type": "SDL_Surface *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "camera",
|
|
||||||
"type": "SDL_Camera *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "timestampNS",
|
|
||||||
"type": "Uint64 *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_ReleaseCameraFrame",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "camera",
|
|
||||||
"type": "SDL_Camera *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "frame",
|
|
||||||
"type": "SDL_Surface *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_CloseCamera",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "camera",
|
|
||||||
"type": "SDL_Camera *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
@ -1,146 +0,0 @@
|
||||||
{
|
|
||||||
"header": "SDL_clipboard.h",
|
|
||||||
"opaque_types": [],
|
|
||||||
"typedefs": [],
|
|
||||||
"function_pointers": [
|
|
||||||
{
|
|
||||||
"name": "SDL_ClipboardDataCallback",
|
|
||||||
"return_type": "const void *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "userdata",
|
|
||||||
"type": "void *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "mime_type",
|
|
||||||
"type": "const char *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "size",
|
|
||||||
"type": "size_t *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_ClipboardCleanupCallback",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "userdata",
|
|
||||||
"type": "void *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"enums": [],
|
|
||||||
"structs": [],
|
|
||||||
"unions": [],
|
|
||||||
"flags": [],
|
|
||||||
"functions": [
|
|
||||||
{
|
|
||||||
"name": "SDL_SetClipboardText",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "text",
|
|
||||||
"type": "const char *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetClipboardText",
|
|
||||||
"return_type": "char *",
|
|
||||||
"parameters": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_HasClipboardText",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_SetPrimarySelectionText",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "text",
|
|
||||||
"type": "const char *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetPrimarySelectionText",
|
|
||||||
"return_type": "char *",
|
|
||||||
"parameters": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_HasPrimarySelectionText",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_SetClipboardData",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "callback",
|
|
||||||
"type": "SDL_ClipboardDataCallback"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "cleanup",
|
|
||||||
"type": "SDL_ClipboardCleanupCallback"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "userdata",
|
|
||||||
"type": "void *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "mime_types",
|
|
||||||
"type": "const char **"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "num_mime_types",
|
|
||||||
"type": "size_t"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_ClearClipboardData",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetClipboardData",
|
|
||||||
"return_type": "void *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "mime_type",
|
|
||||||
"type": "const char *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "size",
|
|
||||||
"type": "size_t *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_HasClipboardData",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "mime_type",
|
|
||||||
"type": "const char *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetClipboardMimeTypes",
|
|
||||||
"return_type": "char **",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "num_mime_types",
|
|
||||||
"type": "size_t *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
@ -1,102 +0,0 @@
|
||||||
{
|
|
||||||
"header": "SDL_cpuinfo.h",
|
|
||||||
"opaque_types": [],
|
|
||||||
"typedefs": [],
|
|
||||||
"function_pointers": [],
|
|
||||||
"enums": [],
|
|
||||||
"structs": [],
|
|
||||||
"unions": [],
|
|
||||||
"flags": [],
|
|
||||||
"functions": [
|
|
||||||
{
|
|
||||||
"name": "SDL_GetNumLogicalCPUCores",
|
|
||||||
"return_type": "int",
|
|
||||||
"parameters": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetCPUCacheLineSize",
|
|
||||||
"return_type": "int",
|
|
||||||
"parameters": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_HasAltiVec",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_HasMMX",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_HasSSE",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_HasSSE2",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_HasSSE3",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_HasSSE41",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_HasSSE42",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_HasAVX",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_HasAVX2",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_HasAVX512F",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_HasARMSIMD",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_HasNEON",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_HasLSX",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_HasLASX",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetSystemRAM",
|
|
||||||
"return_type": "int",
|
|
||||||
"parameters": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetSIMDAlignment",
|
|
||||||
"return_type": "size_t",
|
|
||||||
"parameters": []
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
@ -1,172 +0,0 @@
|
||||||
{
|
|
||||||
"header": "SDL_dialog.h",
|
|
||||||
"opaque_types": [],
|
|
||||||
"typedefs": [],
|
|
||||||
"function_pointers": [
|
|
||||||
{
|
|
||||||
"name": "SDL_DialogFileCallback",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "userdata",
|
|
||||||
"type": "void *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "filelist",
|
|
||||||
"type": "const char * const *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "filter",
|
|
||||||
"type": "int"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"enums": [
|
|
||||||
{
|
|
||||||
"name": "SDL_FileDialogType",
|
|
||||||
"values": [
|
|
||||||
{
|
|
||||||
"name": "SDL_FILEDIALOG_OPENFILE"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_FILEDIALOG_SAVEFILE"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_FILEDIALOG_OPENFOLDER"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"structs": [
|
|
||||||
{
|
|
||||||
"name": "SDL_DialogFileFilter",
|
|
||||||
"fields": [
|
|
||||||
{
|
|
||||||
"name": "name",
|
|
||||||
"type": "const char *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "pattern",
|
|
||||||
"type": "const char *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"unions": [],
|
|
||||||
"flags": [],
|
|
||||||
"functions": [
|
|
||||||
{
|
|
||||||
"name": "SDL_ShowOpenFileDialog",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "callback",
|
|
||||||
"type": "SDL_DialogFileCallback"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "userdata",
|
|
||||||
"type": "void *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "window",
|
|
||||||
"type": "SDL_Window *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "filters",
|
|
||||||
"type": "const SDL_DialogFileFilter *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "nfilters",
|
|
||||||
"type": "int"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "default_location",
|
|
||||||
"type": "const char *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "allow_many",
|
|
||||||
"type": "bool"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_ShowSaveFileDialog",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "callback",
|
|
||||||
"type": "SDL_DialogFileCallback"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "userdata",
|
|
||||||
"type": "void *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "window",
|
|
||||||
"type": "SDL_Window *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "filters",
|
|
||||||
"type": "const SDL_DialogFileFilter *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "nfilters",
|
|
||||||
"type": "int"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "default_location",
|
|
||||||
"type": "const char *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_ShowOpenFolderDialog",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "callback",
|
|
||||||
"type": "SDL_DialogFileCallback"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "userdata",
|
|
||||||
"type": "void *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "window",
|
|
||||||
"type": "SDL_Window *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "default_location",
|
|
||||||
"type": "const char *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "allow_many",
|
|
||||||
"type": "bool"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_ShowFileDialogWithProperties",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "type",
|
|
||||||
"type": "SDL_FileDialogType"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "callback",
|
|
||||||
"type": "SDL_DialogFileCallback"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "userdata",
|
|
||||||
"type": "void *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "props",
|
|
||||||
"type": "SDL_PropertiesID"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
{
|
|
||||||
"header": "SDL_endian.h",
|
|
||||||
"opaque_types": [],
|
|
||||||
"typedefs": [],
|
|
||||||
"function_pointers": [],
|
|
||||||
"enums": [],
|
|
||||||
"structs": [],
|
|
||||||
"unions": [],
|
|
||||||
"flags": [],
|
|
||||||
"functions": []
|
|
||||||
}
|
|
||||||
|
|
@ -1,55 +0,0 @@
|
||||||
{
|
|
||||||
"header": "SDL_error.h",
|
|
||||||
"opaque_types": [],
|
|
||||||
"typedefs": [],
|
|
||||||
"function_pointers": [],
|
|
||||||
"enums": [],
|
|
||||||
"structs": [],
|
|
||||||
"unions": [],
|
|
||||||
"flags": [],
|
|
||||||
"functions": [
|
|
||||||
{
|
|
||||||
"name": "SDL_SetError",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "fmt",
|
|
||||||
"type": "const char *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "",
|
|
||||||
"type": "..."
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_SetErrorV",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "fmt",
|
|
||||||
"type": "const char *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "ap",
|
|
||||||
"type": "va_list"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_OutOfMemory",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetError",
|
|
||||||
"return_type": "const char *",
|
|
||||||
"parameters": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_ClearError",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": []
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,222 +0,0 @@
|
||||||
{
|
|
||||||
"header": "SDL_filesystem.h",
|
|
||||||
"opaque_types": [],
|
|
||||||
"typedefs": [],
|
|
||||||
"function_pointers": [
|
|
||||||
{
|
|
||||||
"name": "SDL_EnumerateDirectoryCallback",
|
|
||||||
"return_type": "SDL_EnumerationResult",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "userdata",
|
|
||||||
"type": "void *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "dirname",
|
|
||||||
"type": "const char *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "fname",
|
|
||||||
"type": "const char *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"enums": [
|
|
||||||
{
|
|
||||||
"name": "SDL_Folder",
|
|
||||||
"values": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PathType",
|
|
||||||
"values": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_EnumerationResult",
|
|
||||||
"values": []
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"structs": [
|
|
||||||
{
|
|
||||||
"name": "SDL_PathInfo",
|
|
||||||
"fields": [
|
|
||||||
{
|
|
||||||
"name": "type",
|
|
||||||
"type": "SDL_PathType",
|
|
||||||
"comment": "the path type"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "size",
|
|
||||||
"type": "Uint64",
|
|
||||||
"comment": "the file size in bytes"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "create_time",
|
|
||||||
"type": "SDL_Time",
|
|
||||||
"comment": "the time when the path was created"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "modify_time",
|
|
||||||
"type": "SDL_Time",
|
|
||||||
"comment": "the last time the path was modified"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "access_time",
|
|
||||||
"type": "SDL_Time",
|
|
||||||
"comment": "the last time the path was read"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"unions": [],
|
|
||||||
"flags": [
|
|
||||||
{
|
|
||||||
"name": "SDL_GlobFlags",
|
|
||||||
"underlying_type": "Uint32",
|
|
||||||
"values": [
|
|
||||||
{
|
|
||||||
"name": "SDL_GLOB_CASEINSENSITIVE",
|
|
||||||
"value": "(1u << 0)"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"functions": [
|
|
||||||
{
|
|
||||||
"name": "SDL_GetBasePath",
|
|
||||||
"return_type": "const char *",
|
|
||||||
"parameters": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetPrefPath",
|
|
||||||
"return_type": "char *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "org",
|
|
||||||
"type": "const char *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "app",
|
|
||||||
"type": "const char *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetUserFolder",
|
|
||||||
"return_type": "const char *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "folder",
|
|
||||||
"type": "SDL_Folder"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_CreateDirectory",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "path",
|
|
||||||
"type": "const char *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_EnumerateDirectory",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "path",
|
|
||||||
"type": "const char *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "callback",
|
|
||||||
"type": "SDL_EnumerateDirectoryCallback"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "userdata",
|
|
||||||
"type": "void *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_RemovePath",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "path",
|
|
||||||
"type": "const char *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_RenamePath",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "oldpath",
|
|
||||||
"type": "const char *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "newpath",
|
|
||||||
"type": "const char *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_CopyFile",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "oldpath",
|
|
||||||
"type": "const char *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "newpath",
|
|
||||||
"type": "const char *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetPathInfo",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "path",
|
|
||||||
"type": "const char *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "info",
|
|
||||||
"type": "SDL_PathInfo *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GlobDirectory",
|
|
||||||
"return_type": "char **",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "path",
|
|
||||||
"type": "const char *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "pattern",
|
|
||||||
"type": "const char *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "flags",
|
|
||||||
"type": "SDL_GlobFlags"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "count",
|
|
||||||
"type": "int *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetCurrentDirectory",
|
|
||||||
"return_type": "char *",
|
|
||||||
"parameters": []
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -1,785 +0,0 @@
|
||||||
{
|
|
||||||
"header": "SDL_haptic.h",
|
|
||||||
"opaque_types": [
|
|
||||||
{
|
|
||||||
"name": "SDL_Haptic"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"typedefs": [
|
|
||||||
{
|
|
||||||
"name": "SDL_HapticID",
|
|
||||||
"underlying_type": "Uint32"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"function_pointers": [],
|
|
||||||
"enums": [],
|
|
||||||
"structs": [
|
|
||||||
{
|
|
||||||
"name": "SDL_HapticDirection",
|
|
||||||
"fields": [
|
|
||||||
{
|
|
||||||
"name": "type",
|
|
||||||
"type": "Uint8",
|
|
||||||
"comment": "The type of encoding."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "dir",
|
|
||||||
"type": "Sint32[3]",
|
|
||||||
"comment": "The encoded direction."
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_HapticConstant",
|
|
||||||
"fields": [
|
|
||||||
{
|
|
||||||
"name": "type",
|
|
||||||
"type": "Uint16",
|
|
||||||
"comment": "SDL_HAPTIC_CONSTANT"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "direction",
|
|
||||||
"type": "SDL_HapticDirection",
|
|
||||||
"comment": "Direction of the effect."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "length",
|
|
||||||
"type": "Uint32",
|
|
||||||
"comment": "Duration of the effect."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "delay",
|
|
||||||
"type": "Uint16",
|
|
||||||
"comment": "Delay before starting the effect."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "button",
|
|
||||||
"type": "Uint16",
|
|
||||||
"comment": "Button that triggers the effect."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "interval",
|
|
||||||
"type": "Uint16",
|
|
||||||
"comment": "How soon it can be triggered again after button."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "level",
|
|
||||||
"type": "Sint16",
|
|
||||||
"comment": "Strength of the constant effect."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "attack_length",
|
|
||||||
"type": "Uint16",
|
|
||||||
"comment": "Duration of the attack."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "attack_level",
|
|
||||||
"type": "Uint16",
|
|
||||||
"comment": "Level at the start of the attack."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "fade_length",
|
|
||||||
"type": "Uint16",
|
|
||||||
"comment": "Duration of the fade."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "fade_level",
|
|
||||||
"type": "Uint16",
|
|
||||||
"comment": "Level at the end of the fade."
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_HapticPeriodic",
|
|
||||||
"fields": [
|
|
||||||
{
|
|
||||||
"name": "direction",
|
|
||||||
"type": "SDL_HapticDirection",
|
|
||||||
"comment": "Direction of the effect."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "length",
|
|
||||||
"type": "Uint32",
|
|
||||||
"comment": "Duration of the effect."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "delay",
|
|
||||||
"type": "Uint16",
|
|
||||||
"comment": "Delay before starting the effect."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "button",
|
|
||||||
"type": "Uint16",
|
|
||||||
"comment": "Button that triggers the effect."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "interval",
|
|
||||||
"type": "Uint16",
|
|
||||||
"comment": "How soon it can be triggered again after button."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "period",
|
|
||||||
"type": "Uint16",
|
|
||||||
"comment": "Period of the wave."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "magnitude",
|
|
||||||
"type": "Sint16",
|
|
||||||
"comment": "Peak value; if negative, equivalent to 180 degrees extra phase shift."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "offset",
|
|
||||||
"type": "Sint16",
|
|
||||||
"comment": "Mean value of the wave."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "phase",
|
|
||||||
"type": "Uint16",
|
|
||||||
"comment": "Positive phase shift given by hundredth of a degree."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "attack_length",
|
|
||||||
"type": "Uint16",
|
|
||||||
"comment": "Duration of the attack."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "attack_level",
|
|
||||||
"type": "Uint16",
|
|
||||||
"comment": "Level at the start of the attack."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "fade_length",
|
|
||||||
"type": "Uint16",
|
|
||||||
"comment": "Duration of the fade."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "fade_level",
|
|
||||||
"type": "Uint16",
|
|
||||||
"comment": "Level at the end of the fade."
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_HapticCondition",
|
|
||||||
"fields": [
|
|
||||||
{
|
|
||||||
"name": "direction",
|
|
||||||
"type": "SDL_HapticDirection",
|
|
||||||
"comment": "Direction of the effect."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "length",
|
|
||||||
"type": "Uint32",
|
|
||||||
"comment": "Duration of the effect."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "delay",
|
|
||||||
"type": "Uint16",
|
|
||||||
"comment": "Delay before starting the effect."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "button",
|
|
||||||
"type": "Uint16",
|
|
||||||
"comment": "Button that triggers the effect."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "interval",
|
|
||||||
"type": "Uint16",
|
|
||||||
"comment": "How soon it can be triggered again after button."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "right_sat",
|
|
||||||
"type": "Uint16[3]",
|
|
||||||
"comment": "Level when joystick is to the positive side; max 0xFFFF."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "left_sat",
|
|
||||||
"type": "Uint16[3]",
|
|
||||||
"comment": "Level when joystick is to the negative side; max 0xFFFF."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "right_coeff",
|
|
||||||
"type": "Sint16[3]",
|
|
||||||
"comment": "How fast to increase the force towards the positive side."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "left_coeff",
|
|
||||||
"type": "Sint16[3]",
|
|
||||||
"comment": "How fast to increase the force towards the negative side."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "deadband",
|
|
||||||
"type": "Uint16[3]",
|
|
||||||
"comment": "Size of the dead zone; max 0xFFFF: whole axis-range when 0-centered."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "center",
|
|
||||||
"type": "Sint16[3]",
|
|
||||||
"comment": "Position of the dead zone."
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_HapticRamp",
|
|
||||||
"fields": [
|
|
||||||
{
|
|
||||||
"name": "type",
|
|
||||||
"type": "Uint16",
|
|
||||||
"comment": "SDL_HAPTIC_RAMP"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "direction",
|
|
||||||
"type": "SDL_HapticDirection",
|
|
||||||
"comment": "Direction of the effect."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "length",
|
|
||||||
"type": "Uint32",
|
|
||||||
"comment": "Duration of the effect."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "delay",
|
|
||||||
"type": "Uint16",
|
|
||||||
"comment": "Delay before starting the effect."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "button",
|
|
||||||
"type": "Uint16",
|
|
||||||
"comment": "Button that triggers the effect."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "interval",
|
|
||||||
"type": "Uint16",
|
|
||||||
"comment": "How soon it can be triggered again after button."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "start",
|
|
||||||
"type": "Sint16",
|
|
||||||
"comment": "Beginning strength level."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "end",
|
|
||||||
"type": "Sint16",
|
|
||||||
"comment": "Ending strength level."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "attack_length",
|
|
||||||
"type": "Uint16",
|
|
||||||
"comment": "Duration of the attack."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "attack_level",
|
|
||||||
"type": "Uint16",
|
|
||||||
"comment": "Level at the start of the attack."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "fade_length",
|
|
||||||
"type": "Uint16",
|
|
||||||
"comment": "Duration of the fade."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "fade_level",
|
|
||||||
"type": "Uint16",
|
|
||||||
"comment": "Level at the end of the fade."
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_HapticLeftRight",
|
|
||||||
"fields": [
|
|
||||||
{
|
|
||||||
"name": "type",
|
|
||||||
"type": "Uint16",
|
|
||||||
"comment": "SDL_HAPTIC_LEFTRIGHT"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "length",
|
|
||||||
"type": "Uint32",
|
|
||||||
"comment": "Duration of the effect in milliseconds."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "large_magnitude",
|
|
||||||
"type": "Uint16",
|
|
||||||
"comment": "Control of the large controller motor."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "small_magnitude",
|
|
||||||
"type": "Uint16",
|
|
||||||
"comment": "Control of the small controller motor."
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_HapticCustom",
|
|
||||||
"fields": [
|
|
||||||
{
|
|
||||||
"name": "type",
|
|
||||||
"type": "Uint16",
|
|
||||||
"comment": "SDL_HAPTIC_CUSTOM"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "direction",
|
|
||||||
"type": "SDL_HapticDirection",
|
|
||||||
"comment": "Direction of the effect."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "length",
|
|
||||||
"type": "Uint32",
|
|
||||||
"comment": "Duration of the effect."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "delay",
|
|
||||||
"type": "Uint16",
|
|
||||||
"comment": "Delay before starting the effect."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "button",
|
|
||||||
"type": "Uint16",
|
|
||||||
"comment": "Button that triggers the effect."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "interval",
|
|
||||||
"type": "Uint16",
|
|
||||||
"comment": "How soon it can be triggered again after button."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "channels",
|
|
||||||
"type": "Uint8",
|
|
||||||
"comment": "Axes to use, minimum of one."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "period",
|
|
||||||
"type": "Uint16",
|
|
||||||
"comment": "Sample periods."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "samples",
|
|
||||||
"type": "Uint16",
|
|
||||||
"comment": "Amount of samples."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "data",
|
|
||||||
"type": "Uint16 *",
|
|
||||||
"comment": "Should contain channels*samples items."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "attack_length",
|
|
||||||
"type": "Uint16",
|
|
||||||
"comment": "Duration of the attack."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "attack_level",
|
|
||||||
"type": "Uint16",
|
|
||||||
"comment": "Level at the start of the attack."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "fade_length",
|
|
||||||
"type": "Uint16",
|
|
||||||
"comment": "Duration of the fade."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "fade_level",
|
|
||||||
"type": "Uint16",
|
|
||||||
"comment": "Level at the end of the fade."
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"unions": [
|
|
||||||
{
|
|
||||||
"name": "SDL_HapticEffect",
|
|
||||||
"fields": [
|
|
||||||
{
|
|
||||||
"name": "type",
|
|
||||||
"type": "Uint16",
|
|
||||||
"comment": "Effect type."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "constant",
|
|
||||||
"type": "SDL_HapticConstant",
|
|
||||||
"comment": "Constant effect."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "periodic",
|
|
||||||
"type": "SDL_HapticPeriodic",
|
|
||||||
"comment": "Periodic effect."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "condition",
|
|
||||||
"type": "SDL_HapticCondition",
|
|
||||||
"comment": "Condition effect."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "ramp",
|
|
||||||
"type": "SDL_HapticRamp",
|
|
||||||
"comment": "Ramp effect."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "leftright",
|
|
||||||
"type": "SDL_HapticLeftRight",
|
|
||||||
"comment": "Left/Right effect."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "custom",
|
|
||||||
"type": "SDL_HapticCustom",
|
|
||||||
"comment": "Custom effect."
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"flags": [],
|
|
||||||
"functions": [
|
|
||||||
{
|
|
||||||
"name": "SDL_GetHaptics",
|
|
||||||
"return_type": "SDL_HapticID *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "count",
|
|
||||||
"type": "int *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetHapticNameForID",
|
|
||||||
"return_type": "const char *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "instance_id",
|
|
||||||
"type": "SDL_HapticID"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_OpenHaptic",
|
|
||||||
"return_type": "SDL_Haptic *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "instance_id",
|
|
||||||
"type": "SDL_HapticID"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetHapticFromID",
|
|
||||||
"return_type": "SDL_Haptic *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "instance_id",
|
|
||||||
"type": "SDL_HapticID"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetHapticID",
|
|
||||||
"return_type": "SDL_HapticID",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "haptic",
|
|
||||||
"type": "SDL_Haptic *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetHapticName",
|
|
||||||
"return_type": "const char *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "haptic",
|
|
||||||
"type": "SDL_Haptic *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_IsMouseHaptic",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_OpenHapticFromMouse",
|
|
||||||
"return_type": "SDL_Haptic *",
|
|
||||||
"parameters": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_IsJoystickHaptic",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "joystick",
|
|
||||||
"type": "SDL_Joystick *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_OpenHapticFromJoystick",
|
|
||||||
"return_type": "SDL_Haptic *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "joystick",
|
|
||||||
"type": "SDL_Joystick *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_CloseHaptic",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "haptic",
|
|
||||||
"type": "SDL_Haptic *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetMaxHapticEffects",
|
|
||||||
"return_type": "int",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "haptic",
|
|
||||||
"type": "SDL_Haptic *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetMaxHapticEffectsPlaying",
|
|
||||||
"return_type": "int",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "haptic",
|
|
||||||
"type": "SDL_Haptic *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetHapticFeatures",
|
|
||||||
"return_type": "Uint32",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "haptic",
|
|
||||||
"type": "SDL_Haptic *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetNumHapticAxes",
|
|
||||||
"return_type": "int",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "haptic",
|
|
||||||
"type": "SDL_Haptic *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_HapticEffectSupported",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "haptic",
|
|
||||||
"type": "SDL_Haptic *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "effect",
|
|
||||||
"type": "const SDL_HapticEffect *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_CreateHapticEffect",
|
|
||||||
"return_type": "int",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "haptic",
|
|
||||||
"type": "SDL_Haptic *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "effect",
|
|
||||||
"type": "const SDL_HapticEffect *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_UpdateHapticEffect",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "haptic",
|
|
||||||
"type": "SDL_Haptic *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "effect",
|
|
||||||
"type": "int"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "data",
|
|
||||||
"type": "const SDL_HapticEffect *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_RunHapticEffect",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "haptic",
|
|
||||||
"type": "SDL_Haptic *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "effect",
|
|
||||||
"type": "int"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "iterations",
|
|
||||||
"type": "Uint32"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_StopHapticEffect",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "haptic",
|
|
||||||
"type": "SDL_Haptic *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "effect",
|
|
||||||
"type": "int"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_DestroyHapticEffect",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "haptic",
|
|
||||||
"type": "SDL_Haptic *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "effect",
|
|
||||||
"type": "int"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetHapticEffectStatus",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "haptic",
|
|
||||||
"type": "SDL_Haptic *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "effect",
|
|
||||||
"type": "int"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_SetHapticGain",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "haptic",
|
|
||||||
"type": "SDL_Haptic *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "gain",
|
|
||||||
"type": "int"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_SetHapticAutocenter",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "haptic",
|
|
||||||
"type": "SDL_Haptic *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "autocenter",
|
|
||||||
"type": "int"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PauseHaptic",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "haptic",
|
|
||||||
"type": "SDL_Haptic *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_ResumeHaptic",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "haptic",
|
|
||||||
"type": "SDL_Haptic *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_StopHapticEffects",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "haptic",
|
|
||||||
"type": "SDL_Haptic *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_HapticRumbleSupported",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "haptic",
|
|
||||||
"type": "SDL_Haptic *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_InitHapticRumble",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "haptic",
|
|
||||||
"type": "SDL_Haptic *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PlayHapticRumble",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "haptic",
|
|
||||||
"type": "SDL_Haptic *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "strength",
|
|
||||||
"type": "float"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "length",
|
|
||||||
"type": "Uint32"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_StopHapticRumble",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "haptic",
|
|
||||||
"type": "SDL_Haptic *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
@ -1,157 +0,0 @@
|
||||||
{
|
|
||||||
"header": "SDL_hints.h",
|
|
||||||
"opaque_types": [],
|
|
||||||
"typedefs": [],
|
|
||||||
"function_pointers": [
|
|
||||||
{
|
|
||||||
"name": "SDL_HintCallback",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "userdata",
|
|
||||||
"type": "void *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "name",
|
|
||||||
"type": "const char *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "oldValue",
|
|
||||||
"type": "const char *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "newValue",
|
|
||||||
"type": "const char *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"enums": [
|
|
||||||
{
|
|
||||||
"name": "SDL_HintPriority",
|
|
||||||
"values": [
|
|
||||||
{
|
|
||||||
"name": "SDL_HINT_DEFAULT"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_HINT_NORMAL"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_HINT_OVERRIDE"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"structs": [],
|
|
||||||
"unions": [],
|
|
||||||
"flags": [],
|
|
||||||
"functions": [
|
|
||||||
{
|
|
||||||
"name": "SDL_SetHintWithPriority",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "name",
|
|
||||||
"type": "const char *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "value",
|
|
||||||
"type": "const char *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "priority",
|
|
||||||
"type": "SDL_HintPriority"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_SetHint",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "name",
|
|
||||||
"type": "const char *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "value",
|
|
||||||
"type": "const char *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_ResetHint",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "name",
|
|
||||||
"type": "const char *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_ResetHints",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetHint",
|
|
||||||
"return_type": "const char *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "name",
|
|
||||||
"type": "const char *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetHintBoolean",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "name",
|
|
||||||
"type": "const char *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "default_value",
|
|
||||||
"type": "bool"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_AddHintCallback",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "name",
|
|
||||||
"type": "const char *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "callback",
|
|
||||||
"type": "SDL_HintCallback"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "userdata",
|
|
||||||
"type": "void *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_RemoveHintCallback",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "name",
|
|
||||||
"type": "const char *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "callback",
|
|
||||||
"type": "SDL_HintCallback"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "userdata",
|
|
||||||
"type": "void *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
@ -1,239 +0,0 @@
|
||||||
{
|
|
||||||
"header": "SDL_init.h",
|
|
||||||
"opaque_types": [],
|
|
||||||
"typedefs": [],
|
|
||||||
"function_pointers": [
|
|
||||||
{
|
|
||||||
"name": "SDL_AppInit_func",
|
|
||||||
"return_type": "SDL_AppResult",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "appstate",
|
|
||||||
"type": "void **"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "argc",
|
|
||||||
"type": "int"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "argv[]",
|
|
||||||
"type": "char *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_AppIterate_func",
|
|
||||||
"return_type": "SDL_AppResult",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "appstate",
|
|
||||||
"type": "void *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_AppEvent_func",
|
|
||||||
"return_type": "SDL_AppResult",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "appstate",
|
|
||||||
"type": "void *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "event",
|
|
||||||
"type": "SDL_Event *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_AppQuit_func",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "appstate",
|
|
||||||
"type": "void *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "result",
|
|
||||||
"type": "SDL_AppResult"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_MainThreadCallback",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "userdata",
|
|
||||||
"type": "void *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"enums": [
|
|
||||||
{
|
|
||||||
"name": "SDL_AppResult",
|
|
||||||
"values": []
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"structs": [],
|
|
||||||
"unions": [],
|
|
||||||
"flags": [
|
|
||||||
{
|
|
||||||
"name": "SDL_InitFlags",
|
|
||||||
"underlying_type": "Uint32",
|
|
||||||
"values": [
|
|
||||||
{
|
|
||||||
"name": "SDL_INIT_AUDIO",
|
|
||||||
"value": "0x00000010u",
|
|
||||||
"comment": "`SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS`"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_INIT_VIDEO",
|
|
||||||
"value": "0x00000020u",
|
|
||||||
"comment": "`SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS`, should be initialized on the main thread"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_INIT_JOYSTICK",
|
|
||||||
"value": "0x00000200u",
|
|
||||||
"comment": "`SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS`, should be initialized on the same thread as SDL_INIT_VIDEO on Windows if you don't set SDL_HINT_JOYSTICK_THREAD"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_INIT_HAPTIC",
|
|
||||||
"value": "0x00001000u"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_INIT_GAMEPAD",
|
|
||||||
"value": "0x00002000u",
|
|
||||||
"comment": "`SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK`"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_INIT_EVENTS",
|
|
||||||
"value": "0x00004000u"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_INIT_SENSOR",
|
|
||||||
"value": "0x00008000u",
|
|
||||||
"comment": "`SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS`"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_INIT_CAMERA",
|
|
||||||
"value": "0x00010000u",
|
|
||||||
"comment": "`SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS`"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"functions": [
|
|
||||||
{
|
|
||||||
"name": "SDL_Init",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "flags",
|
|
||||||
"type": "SDL_InitFlags"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_InitSubSystem",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "flags",
|
|
||||||
"type": "SDL_InitFlags"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_QuitSubSystem",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "flags",
|
|
||||||
"type": "SDL_InitFlags"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_WasInit",
|
|
||||||
"return_type": "SDL_InitFlags",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "flags",
|
|
||||||
"type": "SDL_InitFlags"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_Quit",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_IsMainThread",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_RunOnMainThread",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "callback",
|
|
||||||
"type": "SDL_MainThreadCallback"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "userdata",
|
|
||||||
"type": "void *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "wait_complete",
|
|
||||||
"type": "bool"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_SetAppMetadata",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "appname",
|
|
||||||
"type": "const char *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "appversion",
|
|
||||||
"type": "const char *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "appidentifier",
|
|
||||||
"type": "const char *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_SetAppMetadataProperty",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "name",
|
|
||||||
"type": "const char *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "value",
|
|
||||||
"type": "const char *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetAppMetadataProperty",
|
|
||||||
"return_type": "const char *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "name",
|
|
||||||
"type": "const char *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
@ -1,734 +0,0 @@
|
||||||
{
|
|
||||||
"header": "SDL_iostream.h",
|
|
||||||
"opaque_types": [
|
|
||||||
{
|
|
||||||
"name": "SDL_IOStream"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"typedefs": [],
|
|
||||||
"function_pointers": [],
|
|
||||||
"enums": [
|
|
||||||
{
|
|
||||||
"name": "SDL_IOStatus",
|
|
||||||
"values": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_IOWhence",
|
|
||||||
"values": []
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"structs": [
|
|
||||||
{
|
|
||||||
"name": "SDL_IOStreamInterface",
|
|
||||||
"fields": [
|
|
||||||
{
|
|
||||||
"name": "version",
|
|
||||||
"type": "Uint32"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "userdata",
|
|
||||||
"type": "Sint64 (SDLCALL *size)(void *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "whence",
|
|
||||||
"type": "Sint64 (SDLCALL *seek)(void *userdata, Sint64 offset, SDL_IOWhence"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "status",
|
|
||||||
"type": "size_t (SDLCALL *read)(void *userdata, void *ptr, size_t size, SDL_IOStatus *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "status",
|
|
||||||
"type": "size_t (SDLCALL *write)(void *userdata, const void *ptr, size_t size, SDL_IOStatus *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "status",
|
|
||||||
"type": "bool (SDLCALL *flush)(void *userdata, SDL_IOStatus *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "userdata",
|
|
||||||
"type": "bool (SDLCALL *close)(void *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"unions": [],
|
|
||||||
"flags": [],
|
|
||||||
"functions": [
|
|
||||||
{
|
|
||||||
"name": "SDL_IOFromFile",
|
|
||||||
"return_type": "SDL_IOStream *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "file",
|
|
||||||
"type": "const char *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "mode",
|
|
||||||
"type": "const char *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_IOFromMem",
|
|
||||||
"return_type": "SDL_IOStream *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "mem",
|
|
||||||
"type": "void *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "size",
|
|
||||||
"type": "size_t"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_IOFromConstMem",
|
|
||||||
"return_type": "SDL_IOStream *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "mem",
|
|
||||||
"type": "const void *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "size",
|
|
||||||
"type": "size_t"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_IOFromDynamicMem",
|
|
||||||
"return_type": "SDL_IOStream *",
|
|
||||||
"parameters": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_OpenIO",
|
|
||||||
"return_type": "SDL_IOStream *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "iface",
|
|
||||||
"type": "const SDL_IOStreamInterface *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "userdata",
|
|
||||||
"type": "void *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_CloseIO",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "context",
|
|
||||||
"type": "SDL_IOStream *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetIOProperties",
|
|
||||||
"return_type": "SDL_PropertiesID",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "context",
|
|
||||||
"type": "SDL_IOStream *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetIOStatus",
|
|
||||||
"return_type": "SDL_IOStatus",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "context",
|
|
||||||
"type": "SDL_IOStream *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetIOSize",
|
|
||||||
"return_type": "Sint64",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "context",
|
|
||||||
"type": "SDL_IOStream *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_SeekIO",
|
|
||||||
"return_type": "Sint64",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "context",
|
|
||||||
"type": "SDL_IOStream *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "offset",
|
|
||||||
"type": "Sint64"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "whence",
|
|
||||||
"type": "SDL_IOWhence"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_TellIO",
|
|
||||||
"return_type": "Sint64",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "context",
|
|
||||||
"type": "SDL_IOStream *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_ReadIO",
|
|
||||||
"return_type": "size_t",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "context",
|
|
||||||
"type": "SDL_IOStream *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "ptr",
|
|
||||||
"type": "void *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "size",
|
|
||||||
"type": "size_t"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_WriteIO",
|
|
||||||
"return_type": "size_t",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "context",
|
|
||||||
"type": "SDL_IOStream *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "ptr",
|
|
||||||
"type": "const void *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "size",
|
|
||||||
"type": "size_t"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_IOprintf",
|
|
||||||
"return_type": "size_t",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "context",
|
|
||||||
"type": "SDL_IOStream *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "fmt",
|
|
||||||
"type": "const char *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "",
|
|
||||||
"type": "..."
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_IOvprintf",
|
|
||||||
"return_type": "size_t",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "context",
|
|
||||||
"type": "SDL_IOStream *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "fmt",
|
|
||||||
"type": "const char *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "ap",
|
|
||||||
"type": "va_list"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_FlushIO",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "context",
|
|
||||||
"type": "SDL_IOStream *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_LoadFile_IO",
|
|
||||||
"return_type": "void *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "src",
|
|
||||||
"type": "SDL_IOStream *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "datasize",
|
|
||||||
"type": "size_t *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "closeio",
|
|
||||||
"type": "bool"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_LoadFile",
|
|
||||||
"return_type": "void *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "file",
|
|
||||||
"type": "const char *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "datasize",
|
|
||||||
"type": "size_t *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_SaveFile_IO",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "src",
|
|
||||||
"type": "SDL_IOStream *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "data",
|
|
||||||
"type": "const void *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "datasize",
|
|
||||||
"type": "size_t"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "closeio",
|
|
||||||
"type": "bool"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_SaveFile",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "file",
|
|
||||||
"type": "const char *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "data",
|
|
||||||
"type": "const void *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "datasize",
|
|
||||||
"type": "size_t"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_ReadU8",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "src",
|
|
||||||
"type": "SDL_IOStream *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "value",
|
|
||||||
"type": "Uint8 *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_ReadS8",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "src",
|
|
||||||
"type": "SDL_IOStream *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "value",
|
|
||||||
"type": "Sint8 *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_ReadU16LE",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "src",
|
|
||||||
"type": "SDL_IOStream *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "value",
|
|
||||||
"type": "Uint16 *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_ReadS16LE",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "src",
|
|
||||||
"type": "SDL_IOStream *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "value",
|
|
||||||
"type": "Sint16 *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_ReadU16BE",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "src",
|
|
||||||
"type": "SDL_IOStream *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "value",
|
|
||||||
"type": "Uint16 *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_ReadS16BE",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "src",
|
|
||||||
"type": "SDL_IOStream *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "value",
|
|
||||||
"type": "Sint16 *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_ReadU32LE",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "src",
|
|
||||||
"type": "SDL_IOStream *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "value",
|
|
||||||
"type": "Uint32 *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_ReadS32LE",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "src",
|
|
||||||
"type": "SDL_IOStream *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "value",
|
|
||||||
"type": "Sint32 *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_ReadU32BE",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "src",
|
|
||||||
"type": "SDL_IOStream *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "value",
|
|
||||||
"type": "Uint32 *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_ReadS32BE",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "src",
|
|
||||||
"type": "SDL_IOStream *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "value",
|
|
||||||
"type": "Sint32 *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_ReadU64LE",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "src",
|
|
||||||
"type": "SDL_IOStream *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "value",
|
|
||||||
"type": "Uint64 *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_ReadS64LE",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "src",
|
|
||||||
"type": "SDL_IOStream *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "value",
|
|
||||||
"type": "Sint64 *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_ReadU64BE",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "src",
|
|
||||||
"type": "SDL_IOStream *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "value",
|
|
||||||
"type": "Uint64 *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_ReadS64BE",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "src",
|
|
||||||
"type": "SDL_IOStream *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "value",
|
|
||||||
"type": "Sint64 *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_WriteU8",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "dst",
|
|
||||||
"type": "SDL_IOStream *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "value",
|
|
||||||
"type": "Uint8"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_WriteS8",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "dst",
|
|
||||||
"type": "SDL_IOStream *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "value",
|
|
||||||
"type": "Sint8"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_WriteU16LE",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "dst",
|
|
||||||
"type": "SDL_IOStream *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "value",
|
|
||||||
"type": "Uint16"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_WriteS16LE",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "dst",
|
|
||||||
"type": "SDL_IOStream *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "value",
|
|
||||||
"type": "Sint16"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_WriteU16BE",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "dst",
|
|
||||||
"type": "SDL_IOStream *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "value",
|
|
||||||
"type": "Uint16"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_WriteS16BE",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "dst",
|
|
||||||
"type": "SDL_IOStream *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "value",
|
|
||||||
"type": "Sint16"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_WriteU32LE",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "dst",
|
|
||||||
"type": "SDL_IOStream *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "value",
|
|
||||||
"type": "Uint32"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_WriteS32LE",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "dst",
|
|
||||||
"type": "SDL_IOStream *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "value",
|
|
||||||
"type": "Sint32"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_WriteU32BE",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "dst",
|
|
||||||
"type": "SDL_IOStream *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "value",
|
|
||||||
"type": "Uint32"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_WriteS32BE",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "dst",
|
|
||||||
"type": "SDL_IOStream *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "value",
|
|
||||||
"type": "Sint32"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_WriteU64LE",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "dst",
|
|
||||||
"type": "SDL_IOStream *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "value",
|
|
||||||
"type": "Uint64"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_WriteS64LE",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "dst",
|
|
||||||
"type": "SDL_IOStream *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "value",
|
|
||||||
"type": "Sint64"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_WriteU64BE",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "dst",
|
|
||||||
"type": "SDL_IOStream *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "value",
|
|
||||||
"type": "Uint64"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_WriteS64BE",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "dst",
|
|
||||||
"type": "SDL_IOStream *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "value",
|
|
||||||
"type": "Sint64"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
@ -1,974 +0,0 @@
|
||||||
{
|
|
||||||
"header": "SDL_joystick.h",
|
|
||||||
"opaque_types": [
|
|
||||||
{
|
|
||||||
"name": "SDL_Joystick"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"typedefs": [
|
|
||||||
{
|
|
||||||
"name": "SDL_JoystickID",
|
|
||||||
"underlying_type": "Uint32"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"function_pointers": [],
|
|
||||||
"enums": [
|
|
||||||
{
|
|
||||||
"name": "SDL_JoystickType",
|
|
||||||
"values": [
|
|
||||||
{
|
|
||||||
"name": "SDL_JOYSTICK_TYPE_UNKNOWN"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_JOYSTICK_TYPE_GAMEPAD"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_JOYSTICK_TYPE_WHEEL"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_JOYSTICK_TYPE_ARCADE_STICK"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_JOYSTICK_TYPE_FLIGHT_STICK"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_JOYSTICK_TYPE_DANCE_PAD"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_JOYSTICK_TYPE_GUITAR"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_JOYSTICK_TYPE_DRUM_KIT"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_JOYSTICK_TYPE_ARCADE_PAD"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_JOYSTICK_TYPE_THROTTLE"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_JOYSTICK_TYPE_COUNT"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_JoystickConnectionState",
|
|
||||||
"values": [
|
|
||||||
{
|
|
||||||
"name": "SDL_JOYSTICK_CONNECTION_INVALID",
|
|
||||||
"value": "-1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_JOYSTICK_CONNECTION_UNKNOWN"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_JOYSTICK_CONNECTION_WIRED"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_JOYSTICK_CONNECTION_WIRELESS"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"structs": [
|
|
||||||
{
|
|
||||||
"name": "SDL_VirtualJoystickTouchpadDesc",
|
|
||||||
"fields": [
|
|
||||||
{
|
|
||||||
"name": "nfingers",
|
|
||||||
"type": "Uint16",
|
|
||||||
"comment": "the number of simultaneous fingers on this touchpad"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "padding",
|
|
||||||
"type": "Uint16[3]"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_VirtualJoystickSensorDesc",
|
|
||||||
"fields": [
|
|
||||||
{
|
|
||||||
"name": "type",
|
|
||||||
"type": "SDL_SensorType",
|
|
||||||
"comment": "the type of this sensor"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "rate",
|
|
||||||
"type": "float",
|
|
||||||
"comment": "the update frequency of this sensor, may be 0.0f"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_VirtualJoystickDesc",
|
|
||||||
"fields": [
|
|
||||||
{
|
|
||||||
"name": "version",
|
|
||||||
"type": "Uint32",
|
|
||||||
"comment": "the version of this interface"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "type",
|
|
||||||
"type": "Uint16",
|
|
||||||
"comment": "`SDL_JoystickType`"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "padding",
|
|
||||||
"type": "Uint16",
|
|
||||||
"comment": "unused"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "vendor_id",
|
|
||||||
"type": "Uint16",
|
|
||||||
"comment": "the USB vendor ID of this joystick"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "product_id",
|
|
||||||
"type": "Uint16",
|
|
||||||
"comment": "the USB product ID of this joystick"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "naxes",
|
|
||||||
"type": "Uint16",
|
|
||||||
"comment": "the number of axes on this joystick"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "nbuttons",
|
|
||||||
"type": "Uint16",
|
|
||||||
"comment": "the number of buttons on this joystick"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "nballs",
|
|
||||||
"type": "Uint16",
|
|
||||||
"comment": "the number of balls on this joystick"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "nhats",
|
|
||||||
"type": "Uint16",
|
|
||||||
"comment": "the number of hats on this joystick"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "ntouchpads",
|
|
||||||
"type": "Uint16",
|
|
||||||
"comment": "the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "nsensors",
|
|
||||||
"type": "Uint16",
|
|
||||||
"comment": "the number of sensors on this joystick, requires `sensors` to point at valid descriptions"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "padding2",
|
|
||||||
"type": "Uint16[2]",
|
|
||||||
"comment": "unused"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "name",
|
|
||||||
"type": "const char *",
|
|
||||||
"comment": "the name of the joystick"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "touchpads",
|
|
||||||
"type": "const SDL_VirtualJoystickTouchpadDesc *",
|
|
||||||
"comment": "A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "sensors",
|
|
||||||
"type": "const SDL_VirtualJoystickSensorDesc *",
|
|
||||||
"comment": "A pointer to an array of sensor descriptions, required if `nsensors` is > 0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "userdata",
|
|
||||||
"type": "void *",
|
|
||||||
"comment": "User data pointer passed to callbacks"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "userdata",
|
|
||||||
"type": "void (SDLCALL *Update)(void *",
|
|
||||||
"comment": "Called when the joystick state should be updated"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "player_index",
|
|
||||||
"type": "void (SDLCALL *SetPlayerIndex)(void *userdata, int",
|
|
||||||
"comment": "Called when the player index is set"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "high_frequency_rumble",
|
|
||||||
"type": "bool (SDLCALL *Rumble)(void *userdata, Uint16 low_frequency_rumble, Uint16",
|
|
||||||
"comment": "Implements SDL_RumbleJoystick()"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "right_rumble",
|
|
||||||
"type": "bool (SDLCALL *RumbleTriggers)(void *userdata, Uint16 left_rumble, Uint16",
|
|
||||||
"comment": "Implements SDL_RumbleJoystickTriggers()"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "blue",
|
|
||||||
"type": "bool (SDLCALL *SetLED)(void *userdata, Uint8 red, Uint8 green, Uint8",
|
|
||||||
"comment": "Implements SDL_SetJoystickLED()"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "size",
|
|
||||||
"type": "bool (SDLCALL *SendEffect)(void *userdata, const void *data, int",
|
|
||||||
"comment": "Implements SDL_SendJoystickEffect()"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "enabled",
|
|
||||||
"type": "bool (SDLCALL *SetSensorsEnabled)(void *userdata, bool",
|
|
||||||
"comment": "Implements SDL_SetGamepadSensorEnabled()"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "userdata",
|
|
||||||
"type": "void (SDLCALL *Cleanup)(void *",
|
|
||||||
"comment": "Cleans up the userdata when the joystick is detached"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"unions": [],
|
|
||||||
"flags": [],
|
|
||||||
"functions": [
|
|
||||||
{
|
|
||||||
"name": "SDL_LockJoysticks",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "SDL_ACQUIRE(SDL_joystick_lock",
|
|
||||||
"type": "void)"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_UnlockJoysticks",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "SDL_RELEASE(SDL_joystick_lock",
|
|
||||||
"type": "void)"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_HasJoystick",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetJoysticks",
|
|
||||||
"return_type": "SDL_JoystickID *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "count",
|
|
||||||
"type": "int *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetJoystickNameForID",
|
|
||||||
"return_type": "const char *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "instance_id",
|
|
||||||
"type": "SDL_JoystickID"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetJoystickPathForID",
|
|
||||||
"return_type": "const char *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "instance_id",
|
|
||||||
"type": "SDL_JoystickID"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetJoystickPlayerIndexForID",
|
|
||||||
"return_type": "int",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "instance_id",
|
|
||||||
"type": "SDL_JoystickID"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetJoystickGUIDForID",
|
|
||||||
"return_type": "SDL_GUID",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "instance_id",
|
|
||||||
"type": "SDL_JoystickID"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetJoystickVendorForID",
|
|
||||||
"return_type": "Uint16",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "instance_id",
|
|
||||||
"type": "SDL_JoystickID"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetJoystickProductForID",
|
|
||||||
"return_type": "Uint16",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "instance_id",
|
|
||||||
"type": "SDL_JoystickID"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetJoystickProductVersionForID",
|
|
||||||
"return_type": "Uint16",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "instance_id",
|
|
||||||
"type": "SDL_JoystickID"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetJoystickTypeForID",
|
|
||||||
"return_type": "SDL_JoystickType",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "instance_id",
|
|
||||||
"type": "SDL_JoystickID"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_OpenJoystick",
|
|
||||||
"return_type": "SDL_Joystick *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "instance_id",
|
|
||||||
"type": "SDL_JoystickID"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetJoystickFromID",
|
|
||||||
"return_type": "SDL_Joystick *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "instance_id",
|
|
||||||
"type": "SDL_JoystickID"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetJoystickFromPlayerIndex",
|
|
||||||
"return_type": "SDL_Joystick *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "player_index",
|
|
||||||
"type": "int"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_AttachVirtualJoystick",
|
|
||||||
"return_type": "SDL_JoystickID",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "desc",
|
|
||||||
"type": "const SDL_VirtualJoystickDesc *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_DetachVirtualJoystick",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "instance_id",
|
|
||||||
"type": "SDL_JoystickID"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_IsJoystickVirtual",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "instance_id",
|
|
||||||
"type": "SDL_JoystickID"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_SetJoystickVirtualAxis",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "joystick",
|
|
||||||
"type": "SDL_Joystick *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "axis",
|
|
||||||
"type": "int"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "value",
|
|
||||||
"type": "Sint16"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_SetJoystickVirtualBall",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "joystick",
|
|
||||||
"type": "SDL_Joystick *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "ball",
|
|
||||||
"type": "int"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "xrel",
|
|
||||||
"type": "Sint16"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "yrel",
|
|
||||||
"type": "Sint16"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_SetJoystickVirtualButton",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "joystick",
|
|
||||||
"type": "SDL_Joystick *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "button",
|
|
||||||
"type": "int"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "down",
|
|
||||||
"type": "bool"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_SetJoystickVirtualHat",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "joystick",
|
|
||||||
"type": "SDL_Joystick *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "hat",
|
|
||||||
"type": "int"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "value",
|
|
||||||
"type": "Uint8"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_SetJoystickVirtualTouchpad",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "joystick",
|
|
||||||
"type": "SDL_Joystick *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "touchpad",
|
|
||||||
"type": "int"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "finger",
|
|
||||||
"type": "int"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "down",
|
|
||||||
"type": "bool"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "x",
|
|
||||||
"type": "float"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "y",
|
|
||||||
"type": "float"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "pressure",
|
|
||||||
"type": "float"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_SendJoystickVirtualSensorData",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "joystick",
|
|
||||||
"type": "SDL_Joystick *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "type",
|
|
||||||
"type": "SDL_SensorType"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "sensor_timestamp",
|
|
||||||
"type": "Uint64"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "data",
|
|
||||||
"type": "const float *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "num_values",
|
|
||||||
"type": "int"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetJoystickProperties",
|
|
||||||
"return_type": "SDL_PropertiesID",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "joystick",
|
|
||||||
"type": "SDL_Joystick *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetJoystickName",
|
|
||||||
"return_type": "const char *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "joystick",
|
|
||||||
"type": "SDL_Joystick *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetJoystickPath",
|
|
||||||
"return_type": "const char *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "joystick",
|
|
||||||
"type": "SDL_Joystick *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetJoystickPlayerIndex",
|
|
||||||
"return_type": "int",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "joystick",
|
|
||||||
"type": "SDL_Joystick *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_SetJoystickPlayerIndex",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "joystick",
|
|
||||||
"type": "SDL_Joystick *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "player_index",
|
|
||||||
"type": "int"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetJoystickGUID",
|
|
||||||
"return_type": "SDL_GUID",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "joystick",
|
|
||||||
"type": "SDL_Joystick *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetJoystickVendor",
|
|
||||||
"return_type": "Uint16",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "joystick",
|
|
||||||
"type": "SDL_Joystick *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetJoystickProduct",
|
|
||||||
"return_type": "Uint16",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "joystick",
|
|
||||||
"type": "SDL_Joystick *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetJoystickProductVersion",
|
|
||||||
"return_type": "Uint16",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "joystick",
|
|
||||||
"type": "SDL_Joystick *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetJoystickFirmwareVersion",
|
|
||||||
"return_type": "Uint16",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "joystick",
|
|
||||||
"type": "SDL_Joystick *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetJoystickSerial",
|
|
||||||
"return_type": "const char *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "joystick",
|
|
||||||
"type": "SDL_Joystick *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetJoystickType",
|
|
||||||
"return_type": "SDL_JoystickType",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "joystick",
|
|
||||||
"type": "SDL_Joystick *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetJoystickGUIDInfo",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "guid",
|
|
||||||
"type": "SDL_GUID"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "vendor",
|
|
||||||
"type": "Uint16 *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "product",
|
|
||||||
"type": "Uint16 *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "version",
|
|
||||||
"type": "Uint16 *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "crc16",
|
|
||||||
"type": "Uint16 *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_JoystickConnected",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "joystick",
|
|
||||||
"type": "SDL_Joystick *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetJoystickID",
|
|
||||||
"return_type": "SDL_JoystickID",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "joystick",
|
|
||||||
"type": "SDL_Joystick *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetNumJoystickAxes",
|
|
||||||
"return_type": "int",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "joystick",
|
|
||||||
"type": "SDL_Joystick *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetNumJoystickBalls",
|
|
||||||
"return_type": "int",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "joystick",
|
|
||||||
"type": "SDL_Joystick *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetNumJoystickHats",
|
|
||||||
"return_type": "int",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "joystick",
|
|
||||||
"type": "SDL_Joystick *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetNumJoystickButtons",
|
|
||||||
"return_type": "int",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "joystick",
|
|
||||||
"type": "SDL_Joystick *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_SetJoystickEventsEnabled",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "enabled",
|
|
||||||
"type": "bool"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_JoystickEventsEnabled",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_UpdateJoysticks",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetJoystickAxis",
|
|
||||||
"return_type": "Sint16",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "joystick",
|
|
||||||
"type": "SDL_Joystick *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "axis",
|
|
||||||
"type": "int"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetJoystickAxisInitialState",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "joystick",
|
|
||||||
"type": "SDL_Joystick *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "axis",
|
|
||||||
"type": "int"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "state",
|
|
||||||
"type": "Sint16 *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetJoystickBall",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "joystick",
|
|
||||||
"type": "SDL_Joystick *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "ball",
|
|
||||||
"type": "int"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "dx",
|
|
||||||
"type": "int *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "dy",
|
|
||||||
"type": "int *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetJoystickHat",
|
|
||||||
"return_type": "Uint8",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "joystick",
|
|
||||||
"type": "SDL_Joystick *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "hat",
|
|
||||||
"type": "int"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetJoystickButton",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "joystick",
|
|
||||||
"type": "SDL_Joystick *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "button",
|
|
||||||
"type": "int"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_RumbleJoystick",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "joystick",
|
|
||||||
"type": "SDL_Joystick *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "low_frequency_rumble",
|
|
||||||
"type": "Uint16"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "high_frequency_rumble",
|
|
||||||
"type": "Uint16"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "duration_ms",
|
|
||||||
"type": "Uint32"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_RumbleJoystickTriggers",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "joystick",
|
|
||||||
"type": "SDL_Joystick *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "left_rumble",
|
|
||||||
"type": "Uint16"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "right_rumble",
|
|
||||||
"type": "Uint16"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "duration_ms",
|
|
||||||
"type": "Uint32"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_SetJoystickLED",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "joystick",
|
|
||||||
"type": "SDL_Joystick *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "red",
|
|
||||||
"type": "Uint8"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "green",
|
|
||||||
"type": "Uint8"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "blue",
|
|
||||||
"type": "Uint8"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_SendJoystickEffect",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "joystick",
|
|
||||||
"type": "SDL_Joystick *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "data",
|
|
||||||
"type": "const void *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "size",
|
|
||||||
"type": "int"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_CloseJoystick",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "joystick",
|
|
||||||
"type": "SDL_Joystick *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetJoystickConnectionState",
|
|
||||||
"return_type": "SDL_JoystickConnectionState",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "joystick",
|
|
||||||
"type": "SDL_Joystick *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetJoystickPowerInfo",
|
|
||||||
"return_type": "SDL_PowerState",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "joystick",
|
|
||||||
"type": "SDL_Joystick *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "percent",
|
|
||||||
"type": "int *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
@ -1,277 +0,0 @@
|
||||||
{
|
|
||||||
"header": "SDL_keyboard.h",
|
|
||||||
"opaque_types": [],
|
|
||||||
"typedefs": [
|
|
||||||
{
|
|
||||||
"name": "SDL_KeyboardID",
|
|
||||||
"underlying_type": "Uint32"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"function_pointers": [],
|
|
||||||
"enums": [
|
|
||||||
{
|
|
||||||
"name": "SDL_TextInputType",
|
|
||||||
"values": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_Capitalization",
|
|
||||||
"values": []
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"structs": [],
|
|
||||||
"unions": [],
|
|
||||||
"flags": [],
|
|
||||||
"functions": [
|
|
||||||
{
|
|
||||||
"name": "SDL_HasKeyboard",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetKeyboards",
|
|
||||||
"return_type": "SDL_KeyboardID *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "count",
|
|
||||||
"type": "int *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetKeyboardNameForID",
|
|
||||||
"return_type": "const char *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "instance_id",
|
|
||||||
"type": "SDL_KeyboardID"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetKeyboardFocus",
|
|
||||||
"return_type": "SDL_Window *",
|
|
||||||
"parameters": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetKeyboardState",
|
|
||||||
"return_type": "const bool *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "numkeys",
|
|
||||||
"type": "int *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_ResetKeyboard",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetModState",
|
|
||||||
"return_type": "SDL_Keymod",
|
|
||||||
"parameters": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_SetModState",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "modstate",
|
|
||||||
"type": "SDL_Keymod"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetKeyFromScancode",
|
|
||||||
"return_type": "SDL_Keycode",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "scancode",
|
|
||||||
"type": "SDL_Scancode"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "modstate",
|
|
||||||
"type": "SDL_Keymod"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "key_event",
|
|
||||||
"type": "bool"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetScancodeFromKey",
|
|
||||||
"return_type": "SDL_Scancode",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "key",
|
|
||||||
"type": "SDL_Keycode"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "modstate",
|
|
||||||
"type": "SDL_Keymod *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_SetScancodeName",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "scancode",
|
|
||||||
"type": "SDL_Scancode"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "name",
|
|
||||||
"type": "const char *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetScancodeName",
|
|
||||||
"return_type": "const char *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "scancode",
|
|
||||||
"type": "SDL_Scancode"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetScancodeFromName",
|
|
||||||
"return_type": "SDL_Scancode",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "name",
|
|
||||||
"type": "const char *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetKeyName",
|
|
||||||
"return_type": "const char *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "key",
|
|
||||||
"type": "SDL_Keycode"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetKeyFromName",
|
|
||||||
"return_type": "SDL_Keycode",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "name",
|
|
||||||
"type": "const char *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_StartTextInput",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "window",
|
|
||||||
"type": "SDL_Window *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_StartTextInputWithProperties",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "window",
|
|
||||||
"type": "SDL_Window *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "props",
|
|
||||||
"type": "SDL_PropertiesID"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_TextInputActive",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "window",
|
|
||||||
"type": "SDL_Window *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_StopTextInput",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "window",
|
|
||||||
"type": "SDL_Window *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_ClearComposition",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "window",
|
|
||||||
"type": "SDL_Window *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_SetTextInputArea",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "window",
|
|
||||||
"type": "SDL_Window *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "rect",
|
|
||||||
"type": "const SDL_Rect *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "cursor",
|
|
||||||
"type": "int"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetTextInputArea",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "window",
|
|
||||||
"type": "SDL_Window *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "rect",
|
|
||||||
"type": "SDL_Rect *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "cursor",
|
|
||||||
"type": "int *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_HasScreenKeyboardSupport",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_ScreenKeyboardShown",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "window",
|
|
||||||
"type": "SDL_Window *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
@ -1,20 +0,0 @@
|
||||||
{
|
|
||||||
"header": "SDL_keycode.h",
|
|
||||||
"opaque_types": [],
|
|
||||||
"typedefs": [
|
|
||||||
{
|
|
||||||
"name": "SDL_Keycode",
|
|
||||||
"underlying_type": "Uint32"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_Keymod",
|
|
||||||
"underlying_type": "Uint16"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"function_pointers": [],
|
|
||||||
"enums": [],
|
|
||||||
"structs": [],
|
|
||||||
"unions": [],
|
|
||||||
"flags": [],
|
|
||||||
"functions": []
|
|
||||||
}
|
|
||||||
|
|
@ -1,38 +0,0 @@
|
||||||
{
|
|
||||||
"header": "SDL_locale.h",
|
|
||||||
"opaque_types": [],
|
|
||||||
"typedefs": [],
|
|
||||||
"function_pointers": [],
|
|
||||||
"enums": [],
|
|
||||||
"structs": [
|
|
||||||
{
|
|
||||||
"name": "SDL_Locale",
|
|
||||||
"fields": [
|
|
||||||
{
|
|
||||||
"name": "language",
|
|
||||||
"type": "const char *",
|
|
||||||
"comment": "A language name, like \"en\" for English."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "country",
|
|
||||||
"type": "const char *",
|
|
||||||
"comment": "A country, like \"US\" for America. Can be NULL."
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"unions": [],
|
|
||||||
"flags": [],
|
|
||||||
"functions": [
|
|
||||||
{
|
|
||||||
"name": "SDL_GetPreferredLocales",
|
|
||||||
"return_type": "SDL_Locale **",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "count",
|
|
||||||
"type": "int *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
@ -1,403 +0,0 @@
|
||||||
{
|
|
||||||
"header": "SDL_log.h",
|
|
||||||
"opaque_types": [],
|
|
||||||
"typedefs": [],
|
|
||||||
"function_pointers": [
|
|
||||||
{
|
|
||||||
"name": "SDL_LogOutputFunction",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "userdata",
|
|
||||||
"type": "void *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "category",
|
|
||||||
"type": "int"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "priority",
|
|
||||||
"type": "SDL_LogPriority"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "message",
|
|
||||||
"type": "const char *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"enums": [
|
|
||||||
{
|
|
||||||
"name": "SDL_LogCategory",
|
|
||||||
"values": [
|
|
||||||
{
|
|
||||||
"name": "SDL_LOG_CATEGORY_APPLICATION"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_LOG_CATEGORY_ERROR"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_LOG_CATEGORY_ASSERT"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_LOG_CATEGORY_SYSTEM"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_LOG_CATEGORY_AUDIO"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_LOG_CATEGORY_VIDEO"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_LOG_CATEGORY_RENDER"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_LOG_CATEGORY_INPUT"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_LOG_CATEGORY_TEST"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_LOG_CATEGORY_GPU"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_LOG_CATEGORY_RESERVED2"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_LOG_CATEGORY_RESERVED3"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_LOG_CATEGORY_RESERVED4"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_LOG_CATEGORY_RESERVED5"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_LOG_CATEGORY_RESERVED6"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_LOG_CATEGORY_RESERVED7"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_LOG_CATEGORY_RESERVED8"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_LOG_CATEGORY_RESERVED9"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_LOG_CATEGORY_RESERVED10"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_LOG_CATEGORY_CUSTOM"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_LogPriority",
|
|
||||||
"values": [
|
|
||||||
{
|
|
||||||
"name": "SDL_LOG_PRIORITY_INVALID"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_LOG_PRIORITY_TRACE"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_LOG_PRIORITY_VERBOSE"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_LOG_PRIORITY_DEBUG"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_LOG_PRIORITY_INFO"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_LOG_PRIORITY_WARN"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_LOG_PRIORITY_ERROR"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_LOG_PRIORITY_CRITICAL"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_LOG_PRIORITY_COUNT"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"structs": [],
|
|
||||||
"unions": [],
|
|
||||||
"flags": [],
|
|
||||||
"functions": [
|
|
||||||
{
|
|
||||||
"name": "SDL_SetLogPriorities",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "priority",
|
|
||||||
"type": "SDL_LogPriority"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_SetLogPriority",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "category",
|
|
||||||
"type": "int"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "priority",
|
|
||||||
"type": "SDL_LogPriority"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetLogPriority",
|
|
||||||
"return_type": "SDL_LogPriority",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "category",
|
|
||||||
"type": "int"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_ResetLogPriorities",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_SetLogPriorityPrefix",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "priority",
|
|
||||||
"type": "SDL_LogPriority"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "prefix",
|
|
||||||
"type": "const char *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_Log",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "fmt",
|
|
||||||
"type": "const char *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "",
|
|
||||||
"type": "..."
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_LogTrace",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "category",
|
|
||||||
"type": "int"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "fmt",
|
|
||||||
"type": "const char *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "",
|
|
||||||
"type": "..."
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_LogVerbose",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "category",
|
|
||||||
"type": "int"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "fmt",
|
|
||||||
"type": "const char *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "",
|
|
||||||
"type": "..."
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_LogDebug",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "category",
|
|
||||||
"type": "int"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "fmt",
|
|
||||||
"type": "const char *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "",
|
|
||||||
"type": "..."
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_LogInfo",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "category",
|
|
||||||
"type": "int"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "fmt",
|
|
||||||
"type": "const char *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "",
|
|
||||||
"type": "..."
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_LogWarn",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "category",
|
|
||||||
"type": "int"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "fmt",
|
|
||||||
"type": "const char *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "",
|
|
||||||
"type": "..."
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_LogError",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "category",
|
|
||||||
"type": "int"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "fmt",
|
|
||||||
"type": "const char *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "",
|
|
||||||
"type": "..."
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_LogCritical",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "category",
|
|
||||||
"type": "int"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "fmt",
|
|
||||||
"type": "const char *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "",
|
|
||||||
"type": "..."
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_LogMessage",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "category",
|
|
||||||
"type": "int"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "priority",
|
|
||||||
"type": "SDL_LogPriority"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "fmt",
|
|
||||||
"type": "const char *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "",
|
|
||||||
"type": "..."
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_LogMessageV",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "category",
|
|
||||||
"type": "int"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "priority",
|
|
||||||
"type": "SDL_LogPriority"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "fmt",
|
|
||||||
"type": "const char *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "ap",
|
|
||||||
"type": "va_list"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetDefaultLogOutputFunction",
|
|
||||||
"return_type": "SDL_LogOutputFunction",
|
|
||||||
"parameters": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetLogOutputFunction",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "callback",
|
|
||||||
"type": "SDL_LogOutputFunction *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "userdata",
|
|
||||||
"type": "void **"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_SetLogOutputFunction",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "callback",
|
|
||||||
"type": "SDL_LogOutputFunction"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "userdata",
|
|
||||||
"type": "void *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
@ -1,200 +0,0 @@
|
||||||
{
|
|
||||||
"header": "SDL_messagebox.h",
|
|
||||||
"opaque_types": [],
|
|
||||||
"typedefs": [],
|
|
||||||
"function_pointers": [],
|
|
||||||
"enums": [
|
|
||||||
{
|
|
||||||
"name": "SDL_MessageBoxColorType",
|
|
||||||
"values": [
|
|
||||||
{
|
|
||||||
"name": "SDL_MESSAGEBOX_COLOR_BACKGROUND"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_MESSAGEBOX_COLOR_TEXT"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_MESSAGEBOX_COLOR_BUTTON_BORDER"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_MESSAGEBOX_COLOR_BUTTON_BACKGROUND"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_MESSAGEBOX_COLOR_BUTTON_SELECTED"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"structs": [
|
|
||||||
{
|
|
||||||
"name": "SDL_MessageBoxButtonData",
|
|
||||||
"fields": [
|
|
||||||
{
|
|
||||||
"name": "flags",
|
|
||||||
"type": "SDL_MessageBoxButtonFlags"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "buttonID",
|
|
||||||
"type": "int",
|
|
||||||
"comment": "User defined button id (value returned via SDL_ShowMessageBox)"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "text",
|
|
||||||
"type": "const char *",
|
|
||||||
"comment": "The UTF-8 button text"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_MessageBoxColor",
|
|
||||||
"fields": [
|
|
||||||
{
|
|
||||||
"name": "r",
|
|
||||||
"type": "Uint8"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "g",
|
|
||||||
"type": "Uint8"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "b",
|
|
||||||
"type": "Uint8"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_MessageBoxColorScheme",
|
|
||||||
"fields": [
|
|
||||||
{
|
|
||||||
"name": "colors",
|
|
||||||
"type": "SDL_MessageBoxColor[SDL_MESSAGEBOX_COLOR_COUNT]"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_MessageBoxData",
|
|
||||||
"fields": [
|
|
||||||
{
|
|
||||||
"name": "flags",
|
|
||||||
"type": "SDL_MessageBoxFlags"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "window",
|
|
||||||
"type": "SDL_Window *",
|
|
||||||
"comment": "Parent window, can be NULL"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "title",
|
|
||||||
"type": "const char *",
|
|
||||||
"comment": "UTF-8 title"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "message",
|
|
||||||
"type": "const char *",
|
|
||||||
"comment": "UTF-8 message text"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "numbuttons",
|
|
||||||
"type": "int"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "buttons",
|
|
||||||
"type": "const SDL_MessageBoxButtonData *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "colorScheme",
|
|
||||||
"type": "const SDL_MessageBoxColorScheme *",
|
|
||||||
"comment": "SDL_MessageBoxColorScheme, can be NULL to use system settings"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"unions": [],
|
|
||||||
"flags": [
|
|
||||||
{
|
|
||||||
"name": "SDL_MessageBoxFlags",
|
|
||||||
"underlying_type": "Uint32",
|
|
||||||
"values": [
|
|
||||||
{
|
|
||||||
"name": "SDL_MESSAGEBOX_ERROR",
|
|
||||||
"value": "0x00000010u",
|
|
||||||
"comment": "error dialog"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_MESSAGEBOX_WARNING",
|
|
||||||
"value": "0x00000020u",
|
|
||||||
"comment": "warning dialog"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_MESSAGEBOX_INFORMATION",
|
|
||||||
"value": "0x00000040u",
|
|
||||||
"comment": "informational dialog"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_MESSAGEBOX_BUTTONS_LEFT_TO_RIGHT",
|
|
||||||
"value": "0x00000080u",
|
|
||||||
"comment": "buttons placed left to right"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_MESSAGEBOX_BUTTONS_RIGHT_TO_LEFT",
|
|
||||||
"value": "0x00000100u",
|
|
||||||
"comment": "buttons placed right to left"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_MessageBoxButtonFlags",
|
|
||||||
"underlying_type": "Uint32",
|
|
||||||
"values": [
|
|
||||||
{
|
|
||||||
"name": "SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT",
|
|
||||||
"value": "0x00000001u",
|
|
||||||
"comment": "Marks the default button when return is hit"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT",
|
|
||||||
"value": "0x00000002u",
|
|
||||||
"comment": "Marks the default button when escape is hit"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"functions": [
|
|
||||||
{
|
|
||||||
"name": "SDL_ShowMessageBox",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "messageboxdata",
|
|
||||||
"type": "const SDL_MessageBoxData *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "buttonid",
|
|
||||||
"type": "int *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_ShowSimpleMessageBox",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "flags",
|
|
||||||
"type": "SDL_MessageBoxFlags"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "title",
|
|
||||||
"type": "const char *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "message",
|
|
||||||
"type": "const char *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "window",
|
|
||||||
"type": "SDL_Window *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
@ -1,302 +0,0 @@
|
||||||
{
|
|
||||||
"header": "SDL_mouse.h",
|
|
||||||
"opaque_types": [
|
|
||||||
{
|
|
||||||
"name": "SDL_Cursor"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"typedefs": [
|
|
||||||
{
|
|
||||||
"name": "SDL_MouseID",
|
|
||||||
"underlying_type": "Uint32"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"function_pointers": [],
|
|
||||||
"enums": [
|
|
||||||
{
|
|
||||||
"name": "SDL_SystemCursor",
|
|
||||||
"values": [
|
|
||||||
{
|
|
||||||
"name": "SDL_SYSTEM_CURSOR_COUNT"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_MouseWheelDirection",
|
|
||||||
"values": []
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"structs": [],
|
|
||||||
"unions": [],
|
|
||||||
"flags": [
|
|
||||||
{
|
|
||||||
"name": "SDL_MouseButtonFlags",
|
|
||||||
"underlying_type": "Uint32",
|
|
||||||
"values": [
|
|
||||||
{
|
|
||||||
"name": "SDL_BUTTON_LEFT",
|
|
||||||
"value": "1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_BUTTON_MIDDLE",
|
|
||||||
"value": "2"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_BUTTON_RIGHT",
|
|
||||||
"value": "3"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_BUTTON_X1",
|
|
||||||
"value": "4"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_BUTTON_X2",
|
|
||||||
"value": "5"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"functions": [
|
|
||||||
{
|
|
||||||
"name": "SDL_HasMouse",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetMice",
|
|
||||||
"return_type": "SDL_MouseID *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "count",
|
|
||||||
"type": "int *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetMouseNameForID",
|
|
||||||
"return_type": "const char *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "instance_id",
|
|
||||||
"type": "SDL_MouseID"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetMouseFocus",
|
|
||||||
"return_type": "SDL_Window *",
|
|
||||||
"parameters": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetMouseState",
|
|
||||||
"return_type": "SDL_MouseButtonFlags",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "x",
|
|
||||||
"type": "float *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "y",
|
|
||||||
"type": "float *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetGlobalMouseState",
|
|
||||||
"return_type": "SDL_MouseButtonFlags",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "x",
|
|
||||||
"type": "float *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "y",
|
|
||||||
"type": "float *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetRelativeMouseState",
|
|
||||||
"return_type": "SDL_MouseButtonFlags",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "x",
|
|
||||||
"type": "float *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "y",
|
|
||||||
"type": "float *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_WarpMouseInWindow",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "window",
|
|
||||||
"type": "SDL_Window *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "x",
|
|
||||||
"type": "float"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "y",
|
|
||||||
"type": "float"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_WarpMouseGlobal",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "x",
|
|
||||||
"type": "float"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "y",
|
|
||||||
"type": "float"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_SetWindowRelativeMouseMode",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "window",
|
|
||||||
"type": "SDL_Window *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "enabled",
|
|
||||||
"type": "bool"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetWindowRelativeMouseMode",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "window",
|
|
||||||
"type": "SDL_Window *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_CaptureMouse",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "enabled",
|
|
||||||
"type": "bool"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_CreateCursor",
|
|
||||||
"return_type": "SDL_Cursor *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "data",
|
|
||||||
"type": "const Uint8 *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "mask",
|
|
||||||
"type": "const Uint8 *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "w",
|
|
||||||
"type": "int"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "h",
|
|
||||||
"type": "int"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "hot_x",
|
|
||||||
"type": "int"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "hot_y",
|
|
||||||
"type": "int"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_CreateColorCursor",
|
|
||||||
"return_type": "SDL_Cursor *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "surface",
|
|
||||||
"type": "SDL_Surface *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "hot_x",
|
|
||||||
"type": "int"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "hot_y",
|
|
||||||
"type": "int"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_CreateSystemCursor",
|
|
||||||
"return_type": "SDL_Cursor *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "id",
|
|
||||||
"type": "SDL_SystemCursor"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_SetCursor",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "cursor",
|
|
||||||
"type": "SDL_Cursor *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetCursor",
|
|
||||||
"return_type": "SDL_Cursor *",
|
|
||||||
"parameters": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetDefaultCursor",
|
|
||||||
"return_type": "SDL_Cursor *",
|
|
||||||
"parameters": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_DestroyCursor",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "cursor",
|
|
||||||
"type": "SDL_Cursor *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_ShowCursor",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_HideCursor",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_CursorVisible",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": []
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
@ -1,63 +0,0 @@
|
||||||
{
|
|
||||||
"header": "SDL_pen.h",
|
|
||||||
"opaque_types": [],
|
|
||||||
"typedefs": [
|
|
||||||
{
|
|
||||||
"name": "SDL_PenID",
|
|
||||||
"underlying_type": "Uint32"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"function_pointers": [],
|
|
||||||
"enums": [
|
|
||||||
{
|
|
||||||
"name": "SDL_PenAxis",
|
|
||||||
"values": []
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"structs": [],
|
|
||||||
"unions": [],
|
|
||||||
"flags": [
|
|
||||||
{
|
|
||||||
"name": "SDL_PenInputFlags",
|
|
||||||
"underlying_type": "Uint32",
|
|
||||||
"values": [
|
|
||||||
{
|
|
||||||
"name": "SDL_PEN_INPUT_DOWN",
|
|
||||||
"value": "(1u << 0)",
|
|
||||||
"comment": "pen is pressed down"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PEN_INPUT_BUTTON_1",
|
|
||||||
"value": "(1u << 1)",
|
|
||||||
"comment": "button 1 is pressed"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PEN_INPUT_BUTTON_2",
|
|
||||||
"value": "(1u << 2)",
|
|
||||||
"comment": "button 2 is pressed"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PEN_INPUT_BUTTON_3",
|
|
||||||
"value": "(1u << 3)",
|
|
||||||
"comment": "button 3 is pressed"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PEN_INPUT_BUTTON_4",
|
|
||||||
"value": "(1u << 4)",
|
|
||||||
"comment": "button 4 is pressed"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PEN_INPUT_BUTTON_5",
|
|
||||||
"value": "(1u << 5)",
|
|
||||||
"comment": "button 5 is pressed"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PEN_INPUT_ERASER_TIP",
|
|
||||||
"value": "(1u << 30)",
|
|
||||||
"comment": "eraser tip is used"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"functions": []
|
|
||||||
}
|
|
||||||
|
|
@ -1,907 +0,0 @@
|
||||||
{
|
|
||||||
"header": "SDL_pixels.h",
|
|
||||||
"opaque_types": [],
|
|
||||||
"typedefs": [],
|
|
||||||
"function_pointers": [],
|
|
||||||
"enums": [
|
|
||||||
{
|
|
||||||
"name": "SDL_PixelType",
|
|
||||||
"values": [
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELTYPE_UNKNOWN"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELTYPE_INDEX1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELTYPE_INDEX4"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELTYPE_INDEX8"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELTYPE_PACKED8"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELTYPE_PACKED16"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELTYPE_PACKED32"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELTYPE_ARRAYU8"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELTYPE_ARRAYU16"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELTYPE_ARRAYU32"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELTYPE_ARRAYF16"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELTYPE_ARRAYF32"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELTYPE_INDEX2"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_BitmapOrder",
|
|
||||||
"values": [
|
|
||||||
{
|
|
||||||
"name": "SDL_BITMAPORDER_NONE"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_BITMAPORDER_4321"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_BITMAPORDER_1234"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PackedOrder",
|
|
||||||
"values": [
|
|
||||||
{
|
|
||||||
"name": "SDL_PACKEDORDER_NONE"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PACKEDORDER_XRGB"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PACKEDORDER_RGBX"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PACKEDORDER_ARGB"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PACKEDORDER_RGBA"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PACKEDORDER_XBGR"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PACKEDORDER_BGRX"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PACKEDORDER_ABGR"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PACKEDORDER_BGRA"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_ArrayOrder",
|
|
||||||
"values": [
|
|
||||||
{
|
|
||||||
"name": "SDL_ARRAYORDER_NONE"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_ARRAYORDER_RGB"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_ARRAYORDER_RGBA"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_ARRAYORDER_ARGB"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_ARRAYORDER_BGR"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_ARRAYORDER_BGRA"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_ARRAYORDER_ABGR"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PackedLayout",
|
|
||||||
"values": [
|
|
||||||
{
|
|
||||||
"name": "SDL_PACKEDLAYOUT_NONE"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PACKEDLAYOUT_332"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PACKEDLAYOUT_4444"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PACKEDLAYOUT_1555"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PACKEDLAYOUT_5551"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PACKEDLAYOUT_565"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PACKEDLAYOUT_8888"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PACKEDLAYOUT_2101010"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PACKEDLAYOUT_1010102"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PixelFormat",
|
|
||||||
"values": [
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELFORMAT_UNKNOWN",
|
|
||||||
"value": "0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELFORMAT_INDEX1LSB",
|
|
||||||
"value": "0x11100100u"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELFORMAT_INDEX1MSB",
|
|
||||||
"value": "0x11200100u"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELFORMAT_INDEX2LSB",
|
|
||||||
"value": "0x1c100200u"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELFORMAT_INDEX2MSB",
|
|
||||||
"value": "0x1c200200u"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELFORMAT_INDEX4LSB",
|
|
||||||
"value": "0x12100400u"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELFORMAT_INDEX4MSB",
|
|
||||||
"value": "0x12200400u"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELFORMAT_INDEX8",
|
|
||||||
"value": "0x13000801u"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELFORMAT_RGB332",
|
|
||||||
"value": "0x14110801u"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELFORMAT_XRGB4444",
|
|
||||||
"value": "0x15120c02u"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELFORMAT_XBGR4444",
|
|
||||||
"value": "0x15520c02u"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELFORMAT_XRGB1555",
|
|
||||||
"value": "0x15130f02u"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELFORMAT_XBGR1555",
|
|
||||||
"value": "0x15530f02u"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELFORMAT_ARGB4444",
|
|
||||||
"value": "0x15321002u"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELFORMAT_RGBA4444",
|
|
||||||
"value": "0x15421002u"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELFORMAT_ABGR4444",
|
|
||||||
"value": "0x15721002u"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELFORMAT_BGRA4444",
|
|
||||||
"value": "0x15821002u"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELFORMAT_ARGB1555",
|
|
||||||
"value": "0x15331002u"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELFORMAT_RGBA5551",
|
|
||||||
"value": "0x15441002u"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELFORMAT_ABGR1555",
|
|
||||||
"value": "0x15731002u"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELFORMAT_BGRA5551",
|
|
||||||
"value": "0x15841002u"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELFORMAT_RGB565",
|
|
||||||
"value": "0x15151002u"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELFORMAT_BGR565",
|
|
||||||
"value": "0x15551002u"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELFORMAT_RGB24",
|
|
||||||
"value": "0x17101803u"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELFORMAT_BGR24",
|
|
||||||
"value": "0x17401803u"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELFORMAT_XRGB8888",
|
|
||||||
"value": "0x16161804u"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELFORMAT_RGBX8888",
|
|
||||||
"value": "0x16261804u"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELFORMAT_XBGR8888",
|
|
||||||
"value": "0x16561804u"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELFORMAT_BGRX8888",
|
|
||||||
"value": "0x16661804u"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELFORMAT_ARGB8888",
|
|
||||||
"value": "0x16362004u"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELFORMAT_RGBA8888",
|
|
||||||
"value": "0x16462004u"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELFORMAT_ABGR8888",
|
|
||||||
"value": "0x16762004u"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELFORMAT_BGRA8888",
|
|
||||||
"value": "0x16862004u"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELFORMAT_XRGB2101010",
|
|
||||||
"value": "0x16172004u"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELFORMAT_XBGR2101010",
|
|
||||||
"value": "0x16572004u"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELFORMAT_ARGB2101010",
|
|
||||||
"value": "0x16372004u"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELFORMAT_ABGR2101010",
|
|
||||||
"value": "0x16772004u"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELFORMAT_RGB48",
|
|
||||||
"value": "0x18103006u"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELFORMAT_BGR48",
|
|
||||||
"value": "0x18403006u"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELFORMAT_RGBA64",
|
|
||||||
"value": "0x18204008u"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELFORMAT_ARGB64",
|
|
||||||
"value": "0x18304008u"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELFORMAT_BGRA64",
|
|
||||||
"value": "0x18504008u"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELFORMAT_ABGR64",
|
|
||||||
"value": "0x18604008u"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELFORMAT_RGB48_FLOAT",
|
|
||||||
"value": "0x1a103006u"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELFORMAT_BGR48_FLOAT",
|
|
||||||
"value": "0x1a403006u"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELFORMAT_RGBA64_FLOAT",
|
|
||||||
"value": "0x1a204008u"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELFORMAT_ARGB64_FLOAT",
|
|
||||||
"value": "0x1a304008u"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELFORMAT_BGRA64_FLOAT",
|
|
||||||
"value": "0x1a504008u"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELFORMAT_ABGR64_FLOAT",
|
|
||||||
"value": "0x1a604008u"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELFORMAT_RGB96_FLOAT",
|
|
||||||
"value": "0x1b10600cu"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELFORMAT_BGR96_FLOAT",
|
|
||||||
"value": "0x1b40600cu"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELFORMAT_RGBA128_FLOAT",
|
|
||||||
"value": "0x1b208010u"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELFORMAT_ARGB128_FLOAT",
|
|
||||||
"value": "0x1b308010u"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELFORMAT_BGRA128_FLOAT",
|
|
||||||
"value": "0x1b508010u"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELFORMAT_ABGR128_FLOAT",
|
|
||||||
"value": "0x1b608010u"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELFORMAT_RGBA32",
|
|
||||||
"value": "SDL_PIXELFORMAT_RGBA8888"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELFORMAT_ARGB32",
|
|
||||||
"value": "SDL_PIXELFORMAT_ARGB8888"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELFORMAT_BGRA32",
|
|
||||||
"value": "SDL_PIXELFORMAT_BGRA8888"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELFORMAT_ABGR32",
|
|
||||||
"value": "SDL_PIXELFORMAT_ABGR8888"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELFORMAT_RGBX32",
|
|
||||||
"value": "SDL_PIXELFORMAT_RGBX8888"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELFORMAT_XRGB32",
|
|
||||||
"value": "SDL_PIXELFORMAT_XRGB8888"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELFORMAT_BGRX32",
|
|
||||||
"value": "SDL_PIXELFORMAT_BGRX8888"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PIXELFORMAT_XBGR32",
|
|
||||||
"value": "SDL_PIXELFORMAT_XBGR8888"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_ColorType",
|
|
||||||
"values": [
|
|
||||||
{
|
|
||||||
"name": "SDL_COLOR_TYPE_UNKNOWN",
|
|
||||||
"value": "0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_COLOR_TYPE_RGB",
|
|
||||||
"value": "1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_COLOR_TYPE_YCBCR",
|
|
||||||
"value": "2"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_ColorRange",
|
|
||||||
"values": [
|
|
||||||
{
|
|
||||||
"name": "SDL_COLOR_RANGE_UNKNOWN",
|
|
||||||
"value": "0"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_ColorPrimaries",
|
|
||||||
"values": [
|
|
||||||
{
|
|
||||||
"name": "SDL_COLOR_PRIMARIES_UNKNOWN",
|
|
||||||
"value": "0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_COLOR_PRIMARIES_UNSPECIFIED",
|
|
||||||
"value": "2"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_COLOR_PRIMARIES_CUSTOM",
|
|
||||||
"value": "31"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_TransferCharacteristics",
|
|
||||||
"values": [
|
|
||||||
{
|
|
||||||
"name": "SDL_TRANSFER_CHARACTERISTICS_UNKNOWN",
|
|
||||||
"value": "0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_TRANSFER_CHARACTERISTICS_UNSPECIFIED",
|
|
||||||
"value": "2"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_TRANSFER_CHARACTERISTICS_LINEAR",
|
|
||||||
"value": "8"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_TRANSFER_CHARACTERISTICS_LOG100",
|
|
||||||
"value": "9"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_TRANSFER_CHARACTERISTICS_LOG100_SQRT10",
|
|
||||||
"value": "10"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_TRANSFER_CHARACTERISTICS_CUSTOM",
|
|
||||||
"value": "31"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_MatrixCoefficients",
|
|
||||||
"values": [
|
|
||||||
{
|
|
||||||
"name": "SDL_MATRIX_COEFFICIENTS_IDENTITY",
|
|
||||||
"value": "0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_MATRIX_COEFFICIENTS_UNSPECIFIED",
|
|
||||||
"value": "2"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_MATRIX_COEFFICIENTS_YCGCO",
|
|
||||||
"value": "8"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_NCL",
|
|
||||||
"value": "12"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_CL",
|
|
||||||
"value": "13"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_MATRIX_COEFFICIENTS_CUSTOM",
|
|
||||||
"value": "31"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_ChromaLocation",
|
|
||||||
"values": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_Colorspace",
|
|
||||||
"values": [
|
|
||||||
{
|
|
||||||
"name": "SDL_COLORSPACE_UNKNOWN",
|
|
||||||
"value": "0"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"structs": [
|
|
||||||
{
|
|
||||||
"name": "SDL_Color",
|
|
||||||
"fields": [
|
|
||||||
{
|
|
||||||
"name": "r",
|
|
||||||
"type": "Uint8"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "g",
|
|
||||||
"type": "Uint8"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "b",
|
|
||||||
"type": "Uint8"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "a",
|
|
||||||
"type": "Uint8"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_FColor",
|
|
||||||
"fields": [
|
|
||||||
{
|
|
||||||
"name": "r",
|
|
||||||
"type": "float"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "g",
|
|
||||||
"type": "float"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "b",
|
|
||||||
"type": "float"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "a",
|
|
||||||
"type": "float"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_Palette",
|
|
||||||
"fields": [
|
|
||||||
{
|
|
||||||
"name": "ncolors",
|
|
||||||
"type": "int",
|
|
||||||
"comment": "number of elements in `colors`."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "colors",
|
|
||||||
"type": "SDL_Color *",
|
|
||||||
"comment": "an array of colors, `ncolors` long."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "version",
|
|
||||||
"type": "Uint32",
|
|
||||||
"comment": "internal use only, do not touch."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "refcount",
|
|
||||||
"type": "int",
|
|
||||||
"comment": "internal use only, do not touch."
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PixelFormatDetails",
|
|
||||||
"fields": [
|
|
||||||
{
|
|
||||||
"name": "format",
|
|
||||||
"type": "SDL_PixelFormat"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "bits_per_pixel",
|
|
||||||
"type": "Uint8"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "bytes_per_pixel",
|
|
||||||
"type": "Uint8"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "padding",
|
|
||||||
"type": "Uint8[2]"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Rmask",
|
|
||||||
"type": "Uint32"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Gmask",
|
|
||||||
"type": "Uint32"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Bmask",
|
|
||||||
"type": "Uint32"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Amask",
|
|
||||||
"type": "Uint32"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Rbits",
|
|
||||||
"type": "Uint8"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Gbits",
|
|
||||||
"type": "Uint8"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Bbits",
|
|
||||||
"type": "Uint8"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Abits",
|
|
||||||
"type": "Uint8"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Rshift",
|
|
||||||
"type": "Uint8"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Gshift",
|
|
||||||
"type": "Uint8"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Bshift",
|
|
||||||
"type": "Uint8"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Ashift",
|
|
||||||
"type": "Uint8"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"unions": [],
|
|
||||||
"flags": [],
|
|
||||||
"functions": [
|
|
||||||
{
|
|
||||||
"name": "SDL_GetPixelFormatName",
|
|
||||||
"return_type": "const char *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "format",
|
|
||||||
"type": "SDL_PixelFormat"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetMasksForPixelFormat",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "format",
|
|
||||||
"type": "SDL_PixelFormat"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "bpp",
|
|
||||||
"type": "int *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Rmask",
|
|
||||||
"type": "Uint32 *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Gmask",
|
|
||||||
"type": "Uint32 *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Bmask",
|
|
||||||
"type": "Uint32 *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Amask",
|
|
||||||
"type": "Uint32 *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetPixelFormatForMasks",
|
|
||||||
"return_type": "SDL_PixelFormat",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "bpp",
|
|
||||||
"type": "int"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Rmask",
|
|
||||||
"type": "Uint32"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Gmask",
|
|
||||||
"type": "Uint32"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Bmask",
|
|
||||||
"type": "Uint32"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Amask",
|
|
||||||
"type": "Uint32"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetPixelFormatDetails",
|
|
||||||
"return_type": "const SDL_PixelFormatDetails *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "format",
|
|
||||||
"type": "SDL_PixelFormat"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_CreatePalette",
|
|
||||||
"return_type": "SDL_Palette *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "ncolors",
|
|
||||||
"type": "int"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_SetPaletteColors",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "palette",
|
|
||||||
"type": "SDL_Palette *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "colors",
|
|
||||||
"type": "const SDL_Color *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "firstcolor",
|
|
||||||
"type": "int"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "ncolors",
|
|
||||||
"type": "int"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_DestroyPalette",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "palette",
|
|
||||||
"type": "SDL_Palette *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_MapRGB",
|
|
||||||
"return_type": "Uint32",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "format",
|
|
||||||
"type": "const SDL_PixelFormatDetails *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "palette",
|
|
||||||
"type": "const SDL_Palette *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "r",
|
|
||||||
"type": "Uint8"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "g",
|
|
||||||
"type": "Uint8"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "b",
|
|
||||||
"type": "Uint8"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_MapRGBA",
|
|
||||||
"return_type": "Uint32",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "format",
|
|
||||||
"type": "const SDL_PixelFormatDetails *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "palette",
|
|
||||||
"type": "const SDL_Palette *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "r",
|
|
||||||
"type": "Uint8"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "g",
|
|
||||||
"type": "Uint8"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "b",
|
|
||||||
"type": "Uint8"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "a",
|
|
||||||
"type": "Uint8"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetRGB",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "pixel",
|
|
||||||
"type": "Uint32"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "format",
|
|
||||||
"type": "const SDL_PixelFormatDetails *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "palette",
|
|
||||||
"type": "const SDL_Palette *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "r",
|
|
||||||
"type": "Uint8 *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "g",
|
|
||||||
"type": "Uint8 *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "b",
|
|
||||||
"type": "Uint8 *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetRGBA",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "pixel",
|
|
||||||
"type": "Uint32"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "format",
|
|
||||||
"type": "const SDL_PixelFormatDetails *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "palette",
|
|
||||||
"type": "const SDL_Palette *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "r",
|
|
||||||
"type": "Uint8 *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "g",
|
|
||||||
"type": "Uint8 *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "b",
|
|
||||||
"type": "Uint8 *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "a",
|
|
||||||
"type": "Uint8 *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
@ -1,31 +0,0 @@
|
||||||
{
|
|
||||||
"header": "SDL_power.h",
|
|
||||||
"opaque_types": [],
|
|
||||||
"typedefs": [],
|
|
||||||
"function_pointers": [],
|
|
||||||
"enums": [
|
|
||||||
{
|
|
||||||
"name": "SDL_PowerState",
|
|
||||||
"values": []
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"structs": [],
|
|
||||||
"unions": [],
|
|
||||||
"flags": [],
|
|
||||||
"functions": [
|
|
||||||
{
|
|
||||||
"name": "SDL_GetPowerInfo",
|
|
||||||
"return_type": "SDL_PowerState",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "seconds",
|
|
||||||
"type": "int *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "percent",
|
|
||||||
"type": "int *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
@ -1,394 +0,0 @@
|
||||||
{
|
|
||||||
"header": "SDL_properties.h",
|
|
||||||
"opaque_types": [],
|
|
||||||
"typedefs": [
|
|
||||||
{
|
|
||||||
"name": "SDL_PropertiesID",
|
|
||||||
"underlying_type": "Uint32"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"function_pointers": [
|
|
||||||
{
|
|
||||||
"name": "SDL_CleanupPropertyCallback",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "userdata",
|
|
||||||
"type": "void *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "value",
|
|
||||||
"type": "void *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_EnumeratePropertiesCallback",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "userdata",
|
|
||||||
"type": "void *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "props",
|
|
||||||
"type": "SDL_PropertiesID"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "name",
|
|
||||||
"type": "const char *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"enums": [
|
|
||||||
{
|
|
||||||
"name": "SDL_PropertyType",
|
|
||||||
"values": [
|
|
||||||
{
|
|
||||||
"name": "SDL_PROPERTY_TYPE_INVALID"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PROPERTY_TYPE_POINTER"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PROPERTY_TYPE_STRING"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PROPERTY_TYPE_NUMBER"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PROPERTY_TYPE_FLOAT"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_PROPERTY_TYPE_BOOLEAN"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"structs": [],
|
|
||||||
"unions": [],
|
|
||||||
"flags": [],
|
|
||||||
"functions": [
|
|
||||||
{
|
|
||||||
"name": "SDL_GetGlobalProperties",
|
|
||||||
"return_type": "SDL_PropertiesID",
|
|
||||||
"parameters": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_CreateProperties",
|
|
||||||
"return_type": "SDL_PropertiesID",
|
|
||||||
"parameters": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_CopyProperties",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "src",
|
|
||||||
"type": "SDL_PropertiesID"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "dst",
|
|
||||||
"type": "SDL_PropertiesID"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_LockProperties",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "props",
|
|
||||||
"type": "SDL_PropertiesID"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_UnlockProperties",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "props",
|
|
||||||
"type": "SDL_PropertiesID"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_SetPointerPropertyWithCleanup",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "props",
|
|
||||||
"type": "SDL_PropertiesID"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "name",
|
|
||||||
"type": "const char *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "value",
|
|
||||||
"type": "void *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "cleanup",
|
|
||||||
"type": "SDL_CleanupPropertyCallback"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "userdata",
|
|
||||||
"type": "void *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_SetPointerProperty",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "props",
|
|
||||||
"type": "SDL_PropertiesID"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "name",
|
|
||||||
"type": "const char *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "value",
|
|
||||||
"type": "void *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_SetStringProperty",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "props",
|
|
||||||
"type": "SDL_PropertiesID"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "name",
|
|
||||||
"type": "const char *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "value",
|
|
||||||
"type": "const char *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_SetNumberProperty",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "props",
|
|
||||||
"type": "SDL_PropertiesID"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "name",
|
|
||||||
"type": "const char *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "value",
|
|
||||||
"type": "Sint64"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_SetFloatProperty",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "props",
|
|
||||||
"type": "SDL_PropertiesID"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "name",
|
|
||||||
"type": "const char *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "value",
|
|
||||||
"type": "float"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_SetBooleanProperty",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "props",
|
|
||||||
"type": "SDL_PropertiesID"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "name",
|
|
||||||
"type": "const char *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "value",
|
|
||||||
"type": "bool"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_HasProperty",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "props",
|
|
||||||
"type": "SDL_PropertiesID"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "name",
|
|
||||||
"type": "const char *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetPropertyType",
|
|
||||||
"return_type": "SDL_PropertyType",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "props",
|
|
||||||
"type": "SDL_PropertiesID"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "name",
|
|
||||||
"type": "const char *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetPointerProperty",
|
|
||||||
"return_type": "void *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "props",
|
|
||||||
"type": "SDL_PropertiesID"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "name",
|
|
||||||
"type": "const char *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "default_value",
|
|
||||||
"type": "void *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetStringProperty",
|
|
||||||
"return_type": "const char *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "props",
|
|
||||||
"type": "SDL_PropertiesID"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "name",
|
|
||||||
"type": "const char *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "default_value",
|
|
||||||
"type": "const char *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetNumberProperty",
|
|
||||||
"return_type": "Sint64",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "props",
|
|
||||||
"type": "SDL_PropertiesID"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "name",
|
|
||||||
"type": "const char *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "default_value",
|
|
||||||
"type": "Sint64"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetFloatProperty",
|
|
||||||
"return_type": "float",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "props",
|
|
||||||
"type": "SDL_PropertiesID"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "name",
|
|
||||||
"type": "const char *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "default_value",
|
|
||||||
"type": "float"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetBooleanProperty",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "props",
|
|
||||||
"type": "SDL_PropertiesID"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "name",
|
|
||||||
"type": "const char *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "default_value",
|
|
||||||
"type": "bool"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_ClearProperty",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "props",
|
|
||||||
"type": "SDL_PropertiesID"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "name",
|
|
||||||
"type": "const char *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_EnumerateProperties",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "props",
|
|
||||||
"type": "SDL_PropertiesID"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "callback",
|
|
||||||
"type": "SDL_EnumeratePropertiesCallback"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "userdata",
|
|
||||||
"type": "void *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_DestroyProperties",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "props",
|
|
||||||
"type": "SDL_PropertiesID"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
@ -1,277 +0,0 @@
|
||||||
{
|
|
||||||
"header": "SDL_rect.h",
|
|
||||||
"opaque_types": [],
|
|
||||||
"typedefs": [],
|
|
||||||
"function_pointers": [],
|
|
||||||
"enums": [],
|
|
||||||
"structs": [
|
|
||||||
{
|
|
||||||
"name": "SDL_Point",
|
|
||||||
"fields": [
|
|
||||||
{
|
|
||||||
"name": "x",
|
|
||||||
"type": "int"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "y",
|
|
||||||
"type": "int"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_FPoint",
|
|
||||||
"fields": [
|
|
||||||
{
|
|
||||||
"name": "x",
|
|
||||||
"type": "float"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "y",
|
|
||||||
"type": "float"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_Rect",
|
|
||||||
"fields": [
|
|
||||||
{
|
|
||||||
"name": "x",
|
|
||||||
"type": "int"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "y",
|
|
||||||
"type": "int"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "w",
|
|
||||||
"type": "int"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "h",
|
|
||||||
"type": "int"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_FRect",
|
|
||||||
"fields": [
|
|
||||||
{
|
|
||||||
"name": "x",
|
|
||||||
"type": "float"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "y",
|
|
||||||
"type": "float"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "w",
|
|
||||||
"type": "float"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "h",
|
|
||||||
"type": "float"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"unions": [],
|
|
||||||
"flags": [],
|
|
||||||
"functions": [
|
|
||||||
{
|
|
||||||
"name": "SDL_HasRectIntersection",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "A",
|
|
||||||
"type": "const SDL_Rect *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "B",
|
|
||||||
"type": "const SDL_Rect *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetRectIntersection",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "A",
|
|
||||||
"type": "const SDL_Rect *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "B",
|
|
||||||
"type": "const SDL_Rect *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "result",
|
|
||||||
"type": "SDL_Rect *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetRectUnion",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "A",
|
|
||||||
"type": "const SDL_Rect *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "B",
|
|
||||||
"type": "const SDL_Rect *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "result",
|
|
||||||
"type": "SDL_Rect *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetRectEnclosingPoints",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "points",
|
|
||||||
"type": "const SDL_Point *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "count",
|
|
||||||
"type": "int"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "clip",
|
|
||||||
"type": "const SDL_Rect *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "result",
|
|
||||||
"type": "SDL_Rect *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetRectAndLineIntersection",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "rect",
|
|
||||||
"type": "const SDL_Rect *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "X1",
|
|
||||||
"type": "int *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Y1",
|
|
||||||
"type": "int *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "X2",
|
|
||||||
"type": "int *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Y2",
|
|
||||||
"type": "int *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_HasRectIntersectionFloat",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "A",
|
|
||||||
"type": "const SDL_FRect *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "B",
|
|
||||||
"type": "const SDL_FRect *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetRectIntersectionFloat",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "A",
|
|
||||||
"type": "const SDL_FRect *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "B",
|
|
||||||
"type": "const SDL_FRect *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "result",
|
|
||||||
"type": "SDL_FRect *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetRectUnionFloat",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "A",
|
|
||||||
"type": "const SDL_FRect *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "B",
|
|
||||||
"type": "const SDL_FRect *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "result",
|
|
||||||
"type": "SDL_FRect *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetRectEnclosingPointsFloat",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "points",
|
|
||||||
"type": "const SDL_FPoint *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "count",
|
|
||||||
"type": "int"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "clip",
|
|
||||||
"type": "const SDL_FRect *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "result",
|
|
||||||
"type": "SDL_FRect *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetRectAndLineIntersectionFloat",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "rect",
|
|
||||||
"type": "const SDL_FRect *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "X1",
|
|
||||||
"type": "float *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Y1",
|
|
||||||
"type": "float *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "X2",
|
|
||||||
"type": "float *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Y2",
|
|
||||||
"type": "float *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,169 +0,0 @@
|
||||||
{
|
|
||||||
"header": "SDL_sensor.h",
|
|
||||||
"opaque_types": [
|
|
||||||
{
|
|
||||||
"name": "SDL_Sensor"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"typedefs": [
|
|
||||||
{
|
|
||||||
"name": "SDL_SensorID",
|
|
||||||
"underlying_type": "Uint32"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"function_pointers": [],
|
|
||||||
"enums": [
|
|
||||||
{
|
|
||||||
"name": "SDL_SensorType",
|
|
||||||
"values": []
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"structs": [],
|
|
||||||
"unions": [],
|
|
||||||
"flags": [],
|
|
||||||
"functions": [
|
|
||||||
{
|
|
||||||
"name": "SDL_GetSensors",
|
|
||||||
"return_type": "SDL_SensorID *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "count",
|
|
||||||
"type": "int *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetSensorNameForID",
|
|
||||||
"return_type": "const char *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "instance_id",
|
|
||||||
"type": "SDL_SensorID"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetSensorTypeForID",
|
|
||||||
"return_type": "SDL_SensorType",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "instance_id",
|
|
||||||
"type": "SDL_SensorID"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetSensorNonPortableTypeForID",
|
|
||||||
"return_type": "int",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "instance_id",
|
|
||||||
"type": "SDL_SensorID"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_OpenSensor",
|
|
||||||
"return_type": "SDL_Sensor *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "instance_id",
|
|
||||||
"type": "SDL_SensorID"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetSensorFromID",
|
|
||||||
"return_type": "SDL_Sensor *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "instance_id",
|
|
||||||
"type": "SDL_SensorID"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetSensorProperties",
|
|
||||||
"return_type": "SDL_PropertiesID",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "sensor",
|
|
||||||
"type": "SDL_Sensor *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetSensorName",
|
|
||||||
"return_type": "const char *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "sensor",
|
|
||||||
"type": "SDL_Sensor *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetSensorType",
|
|
||||||
"return_type": "SDL_SensorType",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "sensor",
|
|
||||||
"type": "SDL_Sensor *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetSensorNonPortableType",
|
|
||||||
"return_type": "int",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "sensor",
|
|
||||||
"type": "SDL_Sensor *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetSensorID",
|
|
||||||
"return_type": "SDL_SensorID",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "sensor",
|
|
||||||
"type": "SDL_Sensor *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetSensorData",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "sensor",
|
|
||||||
"type": "SDL_Sensor *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "data",
|
|
||||||
"type": "float *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "num_values",
|
|
||||||
"type": "int"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_CloseSensor",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "sensor",
|
|
||||||
"type": "SDL_Sensor *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_UpdateSensors",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": []
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -1,242 +0,0 @@
|
||||||
{
|
|
||||||
"header": "SDL_thread.h",
|
|
||||||
"opaque_types": [
|
|
||||||
{
|
|
||||||
"name": "SDL_Thread"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"typedefs": [
|
|
||||||
{
|
|
||||||
"name": "SDL_ThreadID",
|
|
||||||
"underlying_type": "Uint64"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_TLSID",
|
|
||||||
"underlying_type": "SDL_AtomicInt"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"function_pointers": [
|
|
||||||
{
|
|
||||||
"name": "SDL_ThreadFunction",
|
|
||||||
"return_type": "int",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "data",
|
|
||||||
"type": "void *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_TLSDestructorCallback",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "value",
|
|
||||||
"type": "void *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"enums": [
|
|
||||||
{
|
|
||||||
"name": "SDL_ThreadPriority",
|
|
||||||
"values": [
|
|
||||||
{
|
|
||||||
"name": "SDL_THREAD_PRIORITY_LOW"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_THREAD_PRIORITY_NORMAL"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_THREAD_PRIORITY_HIGH"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_THREAD_PRIORITY_TIME_CRITICAL"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_ThreadState",
|
|
||||||
"values": []
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"structs": [],
|
|
||||||
"unions": [],
|
|
||||||
"flags": [],
|
|
||||||
"functions": [
|
|
||||||
{
|
|
||||||
"name": "SDL_CreateThread",
|
|
||||||
"return_type": "SDL_Thread *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "fn",
|
|
||||||
"type": "SDL_ThreadFunction"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "name",
|
|
||||||
"type": "const char *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "data",
|
|
||||||
"type": "void *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_CreateThreadWithProperties",
|
|
||||||
"return_type": "SDL_Thread *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "props",
|
|
||||||
"type": "SDL_PropertiesID"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_CreateThreadRuntime",
|
|
||||||
"return_type": "SDL_Thread *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "fn",
|
|
||||||
"type": "SDL_ThreadFunction"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "name",
|
|
||||||
"type": "const char *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "data",
|
|
||||||
"type": "void *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "pfnBeginThread",
|
|
||||||
"type": "SDL_FunctionPointer"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "pfnEndThread",
|
|
||||||
"type": "SDL_FunctionPointer"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_CreateThreadWithPropertiesRuntime",
|
|
||||||
"return_type": "SDL_Thread *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "props",
|
|
||||||
"type": "SDL_PropertiesID"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "pfnBeginThread",
|
|
||||||
"type": "SDL_FunctionPointer"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "pfnEndThread",
|
|
||||||
"type": "SDL_FunctionPointer"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetThreadName",
|
|
||||||
"return_type": "const char *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "thread",
|
|
||||||
"type": "SDL_Thread *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetCurrentThreadID",
|
|
||||||
"return_type": "SDL_ThreadID",
|
|
||||||
"parameters": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetThreadID",
|
|
||||||
"return_type": "SDL_ThreadID",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "thread",
|
|
||||||
"type": "SDL_Thread *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_SetCurrentThreadPriority",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "priority",
|
|
||||||
"type": "SDL_ThreadPriority"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_WaitThread",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "thread",
|
|
||||||
"type": "SDL_Thread *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "status",
|
|
||||||
"type": "int *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetThreadState",
|
|
||||||
"return_type": "SDL_ThreadState",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "thread",
|
|
||||||
"type": "SDL_Thread *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_DetachThread",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "thread",
|
|
||||||
"type": "SDL_Thread *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetTLS",
|
|
||||||
"return_type": "void *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "id",
|
|
||||||
"type": "SDL_TLSID *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_SetTLS",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "id",
|
|
||||||
"type": "SDL_TLSID *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "value",
|
|
||||||
"type": "const void *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "destructor",
|
|
||||||
"type": "SDL_TLSDestructorCallback"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_CleanupTLS",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": []
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
@ -1,210 +0,0 @@
|
||||||
{
|
|
||||||
"header": "SDL_time.h",
|
|
||||||
"opaque_types": [],
|
|
||||||
"typedefs": [],
|
|
||||||
"function_pointers": [],
|
|
||||||
"enums": [
|
|
||||||
{
|
|
||||||
"name": "SDL_DateFormat",
|
|
||||||
"values": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_TimeFormat",
|
|
||||||
"values": []
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"structs": [
|
|
||||||
{
|
|
||||||
"name": "SDL_DateTime",
|
|
||||||
"fields": [
|
|
||||||
{
|
|
||||||
"name": "year",
|
|
||||||
"type": "int",
|
|
||||||
"comment": "Year"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "month",
|
|
||||||
"type": "int",
|
|
||||||
"comment": "Month [01-12]"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "day",
|
|
||||||
"type": "int",
|
|
||||||
"comment": "Day of the month [01-31]"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "hour",
|
|
||||||
"type": "int",
|
|
||||||
"comment": "Hour [0-23]"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "minute",
|
|
||||||
"type": "int",
|
|
||||||
"comment": "Minute [0-59]"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "second",
|
|
||||||
"type": "int",
|
|
||||||
"comment": "Seconds [0-60]"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "nanosecond",
|
|
||||||
"type": "int",
|
|
||||||
"comment": "Nanoseconds [0-999999999]"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "day_of_week",
|
|
||||||
"type": "int",
|
|
||||||
"comment": "Day of the week [0-6] (0 being Sunday)"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "utc_offset",
|
|
||||||
"type": "int",
|
|
||||||
"comment": "Seconds east of UTC"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"unions": [],
|
|
||||||
"flags": [],
|
|
||||||
"functions": [
|
|
||||||
{
|
|
||||||
"name": "SDL_GetDateTimeLocalePreferences",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "dateFormat",
|
|
||||||
"type": "SDL_DateFormat *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "timeFormat",
|
|
||||||
"type": "SDL_TimeFormat *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetCurrentTime",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "ticks",
|
|
||||||
"type": "SDL_Time *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_TimeToDateTime",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "ticks",
|
|
||||||
"type": "SDL_Time"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "dt",
|
|
||||||
"type": "SDL_DateTime *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "localTime",
|
|
||||||
"type": "bool"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_DateTimeToTime",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "dt",
|
|
||||||
"type": "const SDL_DateTime *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "ticks",
|
|
||||||
"type": "SDL_Time *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_TimeToWindows",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "ticks",
|
|
||||||
"type": "SDL_Time"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "dwLowDateTime",
|
|
||||||
"type": "Uint32 *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "dwHighDateTime",
|
|
||||||
"type": "Uint32 *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_TimeFromWindows",
|
|
||||||
"return_type": "SDL_Time",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "dwLowDateTime",
|
|
||||||
"type": "Uint32"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "dwHighDateTime",
|
|
||||||
"type": "Uint32"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetDaysInMonth",
|
|
||||||
"return_type": "int",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "year",
|
|
||||||
"type": "int"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "month",
|
|
||||||
"type": "int"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetDayOfYear",
|
|
||||||
"return_type": "int",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "year",
|
|
||||||
"type": "int"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "month",
|
|
||||||
"type": "int"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "day",
|
|
||||||
"type": "int"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetDayOfWeek",
|
|
||||||
"return_type": "int",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "year",
|
|
||||||
"type": "int"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "month",
|
|
||||||
"type": "int"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "day",
|
|
||||||
"type": "int"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
@ -1,150 +0,0 @@
|
||||||
{
|
|
||||||
"header": "SDL_timer.h",
|
|
||||||
"opaque_types": [],
|
|
||||||
"typedefs": [
|
|
||||||
{
|
|
||||||
"name": "SDL_TimerID",
|
|
||||||
"underlying_type": "Uint32"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"function_pointers": [
|
|
||||||
{
|
|
||||||
"name": "SDL_TimerCallback",
|
|
||||||
"return_type": "Uint32",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "userdata",
|
|
||||||
"type": "void *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "timerID",
|
|
||||||
"type": "SDL_TimerID"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "interval",
|
|
||||||
"type": "Uint32"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_NSTimerCallback",
|
|
||||||
"return_type": "Uint64",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "userdata",
|
|
||||||
"type": "void *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "timerID",
|
|
||||||
"type": "SDL_TimerID"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "interval",
|
|
||||||
"type": "Uint64"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"enums": [],
|
|
||||||
"structs": [],
|
|
||||||
"unions": [],
|
|
||||||
"flags": [],
|
|
||||||
"functions": [
|
|
||||||
{
|
|
||||||
"name": "SDL_GetTicks",
|
|
||||||
"return_type": "Uint64",
|
|
||||||
"parameters": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetTicksNS",
|
|
||||||
"return_type": "Uint64",
|
|
||||||
"parameters": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetPerformanceCounter",
|
|
||||||
"return_type": "Uint64",
|
|
||||||
"parameters": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetPerformanceFrequency",
|
|
||||||
"return_type": "Uint64",
|
|
||||||
"parameters": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_Delay",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "ms",
|
|
||||||
"type": "Uint32"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_DelayNS",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "ns",
|
|
||||||
"type": "Uint64"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_DelayPrecise",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "ns",
|
|
||||||
"type": "Uint64"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_AddTimer",
|
|
||||||
"return_type": "SDL_TimerID",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "interval",
|
|
||||||
"type": "Uint32"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "callback",
|
|
||||||
"type": "SDL_TimerCallback"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "userdata",
|
|
||||||
"type": "void *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_AddTimerNS",
|
|
||||||
"return_type": "SDL_TimerID",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "interval",
|
|
||||||
"type": "Uint64"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "callback",
|
|
||||||
"type": "SDL_NSTimerCallback"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "userdata",
|
|
||||||
"type": "void *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_RemoveTimer",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "id",
|
|
||||||
"type": "SDL_TimerID"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
@ -1,101 +0,0 @@
|
||||||
{
|
|
||||||
"header": "SDL_touch.h",
|
|
||||||
"opaque_types": [],
|
|
||||||
"typedefs": [
|
|
||||||
{
|
|
||||||
"name": "SDL_TouchID",
|
|
||||||
"underlying_type": "Uint64"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_FingerID",
|
|
||||||
"underlying_type": "Uint64"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"function_pointers": [],
|
|
||||||
"enums": [
|
|
||||||
{
|
|
||||||
"name": "SDL_TouchDeviceType",
|
|
||||||
"values": [
|
|
||||||
{
|
|
||||||
"name": "SDL_TOUCH_DEVICE_INVALID",
|
|
||||||
"value": "-1"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"structs": [
|
|
||||||
{
|
|
||||||
"name": "SDL_Finger",
|
|
||||||
"fields": [
|
|
||||||
{
|
|
||||||
"name": "id",
|
|
||||||
"type": "SDL_FingerID",
|
|
||||||
"comment": "the finger ID"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "x",
|
|
||||||
"type": "float",
|
|
||||||
"comment": "the x-axis location of the touch event, normalized (0...1)"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "y",
|
|
||||||
"type": "float",
|
|
||||||
"comment": "the y-axis location of the touch event, normalized (0...1)"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "pressure",
|
|
||||||
"type": "float",
|
|
||||||
"comment": "the quantity of pressure applied, normalized (0...1)"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"unions": [],
|
|
||||||
"flags": [],
|
|
||||||
"functions": [
|
|
||||||
{
|
|
||||||
"name": "SDL_GetTouchDevices",
|
|
||||||
"return_type": "SDL_TouchID *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "count",
|
|
||||||
"type": "int *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetTouchDeviceName",
|
|
||||||
"return_type": "const char *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "touchID",
|
|
||||||
"type": "SDL_TouchID"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetTouchDeviceType",
|
|
||||||
"return_type": "SDL_TouchDeviceType",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "touchID",
|
|
||||||
"type": "SDL_TouchID"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetTouchFingers",
|
|
||||||
"return_type": "SDL_Finger **",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "touchID",
|
|
||||||
"type": "SDL_TouchID"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "count",
|
|
||||||
"type": "int *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
@ -1,22 +0,0 @@
|
||||||
{
|
|
||||||
"header": "SDL_version.h",
|
|
||||||
"opaque_types": [],
|
|
||||||
"typedefs": [],
|
|
||||||
"function_pointers": [],
|
|
||||||
"enums": [],
|
|
||||||
"structs": [],
|
|
||||||
"unions": [],
|
|
||||||
"flags": [],
|
|
||||||
"functions": [
|
|
||||||
{
|
|
||||||
"name": "SDL_GetVersion",
|
|
||||||
"return_type": "int",
|
|
||||||
"parameters": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_GetRevision",
|
|
||||||
"return_type": "const char *",
|
|
||||||
"parameters": []
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,100 +0,0 @@
|
||||||
{
|
|
||||||
"header": "SDL_vulkan.h",
|
|
||||||
"opaque_types": [],
|
|
||||||
"typedefs": [],
|
|
||||||
"function_pointers": [],
|
|
||||||
"enums": [],
|
|
||||||
"structs": [],
|
|
||||||
"unions": [],
|
|
||||||
"flags": [],
|
|
||||||
"functions": [
|
|
||||||
{
|
|
||||||
"name": "SDL_Vulkan_LoadLibrary",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "path",
|
|
||||||
"type": "const char *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_Vulkan_GetVkGetInstanceProcAddr",
|
|
||||||
"return_type": "SDL_FunctionPointer",
|
|
||||||
"parameters": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_Vulkan_UnloadLibrary",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_Vulkan_GetInstanceExtensions",
|
|
||||||
"return_type": "char const * const *",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "count",
|
|
||||||
"type": "Uint32 *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_Vulkan_CreateSurface",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "window",
|
|
||||||
"type": "SDL_Window *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "instance",
|
|
||||||
"type": "VkInstance"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "allocator",
|
|
||||||
"type": "const struct VkAllocationCallbacks *"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "surface",
|
|
||||||
"type": "VkSurfaceKHR *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_Vulkan_DestroySurface",
|
|
||||||
"return_type": "void",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "instance",
|
|
||||||
"type": "VkInstance"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "surface",
|
|
||||||
"type": "VkSurfaceKHR"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "allocator",
|
|
||||||
"type": "const struct VkAllocationCallbacks *"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "SDL_Vulkan_GetPresentationSupport",
|
|
||||||
"return_type": "bool",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "instance",
|
|
||||||
"type": "VkInstance"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "physicalDevice",
|
|
||||||
"type": "VkPhysicalDevice"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "queueFamilyIndex",
|
|
||||||
"type": "Uint32"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
typedef struct SDL_GPUDevice SDL_GPUDevice;
|
|
||||||
|
|
||||||
typedef enum SDL_GPUPrimitiveType {
|
|
||||||
SDL_GPU_PRIMITIVETYPE_TRIANGLELIST, /**< A series of separate triangles. */
|
|
||||||
SDL_GPU_PRIMITIVETYPE_TRIANGLESTRIP /**< A series of connected triangles. */
|
|
||||||
} SDL_GPUPrimitiveType;
|
|
||||||
|
|
||||||
extern SDL_DECLSPEC SDL_GPUDevice* SDLCALL SDL_CreateGPUDevice(bool debug_mode);
|
|
||||||
|
|
@ -1,22 +0,0 @@
|
||||||
{
|
|
||||||
"header": "test_small.h",
|
|
||||||
"opaque_types": [
|
|
||||||
{"name": "SDL_GPUDevice"}
|
|
||||||
],
|
|
||||||
"typedefs": [
|
|
||||||
],
|
|
||||||
"function_pointers": [
|
|
||||||
],
|
|
||||||
"enums": [
|
|
||||||
{"name": "SDL_GPUPrimitiveType", "values": []}
|
|
||||||
],
|
|
||||||
"structs": [
|
|
||||||
],
|
|
||||||
"unions": [
|
|
||||||
],
|
|
||||||
"flags": [
|
|
||||||
],
|
|
||||||
"functions": [
|
|
||||||
{"name": "SDL_CreateGPUDevice", "return_type": "SDL_GPUDevice*", "parameters": [{"name": "debug_mode", "type": "bool"}]}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
@ -1,143 +0,0 @@
|
||||||
{
|
|
||||||
"header": "SDL_video.h",
|
|
||||||
"opaque_types": [
|
|
||||||
{"name": "SDL_DisplayModeData"},
|
|
||||||
{"name": "SDL_Window"}
|
|
||||||
],
|
|
||||||
"typedefs": [
|
|
||||||
{"name": "SDL_DisplayID", "underlying_type": "Uint32"},
|
|
||||||
{"name": "SDL_WindowID", "underlying_type": "Uint32"},
|
|
||||||
{"name": "SDL_GLProfile", "underlying_type": "Uint32"},
|
|
||||||
{"name": "SDL_GLContextFlag", "underlying_type": "Uint32"},
|
|
||||||
{"name": "SDL_GLContextReleaseFlag", "underlying_type": "Uint32"},
|
|
||||||
{"name": "SDL_GLContextResetNotification", "underlying_type": "Uint32"}
|
|
||||||
],
|
|
||||||
"function_pointers": [
|
|
||||||
],
|
|
||||||
"enums": [
|
|
||||||
{"name": "SDL_SystemTheme", "values": []},
|
|
||||||
{"name": "SDL_DisplayOrientation", "values": []},
|
|
||||||
{"name": "SDL_FlashOperation", "values": []},
|
|
||||||
{"name": "SDL_HitTestResult", "values": []}
|
|
||||||
],
|
|
||||||
"structs": [
|
|
||||||
{"name": "SDL_DisplayMode", "fields": [{"name": "displayID", "type": "SDL_DisplayID", "comment": "the display this mode is associated with"}, {"name": "format", "type": "SDL_PixelFormat", "comment": "pixel format"}, {"name": "w", "type": "int", "comment": "width"}, {"name": "h", "type": "int", "comment": "height"}, {"name": "pixel_density", "type": "float", "comment": "scale converting size to pixels (e.g. a 1920x1080 mode with 2.0 scale would have 3840x2160 pixels)"}, {"name": "refresh_rate", "type": "float", "comment": "refresh rate (or 0.0f for unspecified)"}, {"name": "refresh_rate_numerator", "type": "int", "comment": "precise refresh rate numerator (or 0 for unspecified)"}, {"name": "refresh_rate_denominator", "type": "int", "comment": "precise refresh rate denominator"}, {"name": "internal", "type": "SDL_DisplayModeData *", "comment": "Private"}]},
|
|
||||||
{"name": "SDL_GLContextState", "fields": []}
|
|
||||||
],
|
|
||||||
"unions": [
|
|
||||||
],
|
|
||||||
"flags": [
|
|
||||||
{"name": "SDL_WindowFlags", "underlying_type": "Uint64", "values": [{"name": "SDL_WINDOW_FULLSCREEN", "value": "SDL_UINT64_C(0x0000000000000001)", "comment": "window is in fullscreen mode"}, {"name": "SDL_WINDOW_OPENGL", "value": "SDL_UINT64_C(0x0000000000000002)", "comment": "window usable with OpenGL context"}, {"name": "SDL_WINDOW_OCCLUDED", "value": "SDL_UINT64_C(0x0000000000000004)", "comment": "window is occluded"}, {"name": "SDL_WINDOW_HIDDEN", "value": "SDL_UINT64_C(0x0000000000000008)", "comment": "window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible"}, {"name": "SDL_WINDOW_BORDERLESS", "value": "SDL_UINT64_C(0x0000000000000010)", "comment": "no window decoration"}, {"name": "SDL_WINDOW_RESIZABLE", "value": "SDL_UINT64_C(0x0000000000000020)", "comment": "window can be resized"}, {"name": "SDL_WINDOW_MINIMIZED", "value": "SDL_UINT64_C(0x0000000000000040)", "comment": "window is minimized"}, {"name": "SDL_WINDOW_MAXIMIZED", "value": "SDL_UINT64_C(0x0000000000000080)", "comment": "window is maximized"}, {"name": "SDL_WINDOW_MOUSE_GRABBED", "value": "SDL_UINT64_C(0x0000000000000100)", "comment": "window has grabbed mouse input"}, {"name": "SDL_WINDOW_INPUT_FOCUS", "value": "SDL_UINT64_C(0x0000000000000200)", "comment": "window has input focus"}, {"name": "SDL_WINDOW_MOUSE_FOCUS", "value": "SDL_UINT64_C(0x0000000000000400)", "comment": "window has mouse focus"}, {"name": "SDL_WINDOW_EXTERNAL", "value": "SDL_UINT64_C(0x0000000000000800)", "comment": "window not created by SDL"}, {"name": "SDL_WINDOW_MODAL", "value": "SDL_UINT64_C(0x0000000000001000)", "comment": "window is modal"}, {"name": "SDL_WINDOW_HIGH_PIXEL_DENSITY", "value": "SDL_UINT64_C(0x0000000000002000)", "comment": "window uses high pixel density back buffer if possible"}, {"name": "SDL_WINDOW_MOUSE_CAPTURE", "value": "SDL_UINT64_C(0x0000000000004000)", "comment": "window has mouse captured (unrelated to MOUSE_GRABBED)"}, {"name": "SDL_WINDOW_MOUSE_RELATIVE_MODE", "value": "SDL_UINT64_C(0x0000000000008000)", "comment": "window has relative mode enabled"}, {"name": "SDL_WINDOW_ALWAYS_ON_TOP", "value": "SDL_UINT64_C(0x0000000000010000)", "comment": "window should always be above others"}, {"name": "SDL_WINDOW_UTILITY", "value": "SDL_UINT64_C(0x0000000000020000)", "comment": "window should be treated as a utility window, not showing in the task bar and window list"}, {"name": "SDL_WINDOW_TOOLTIP", "value": "SDL_UINT64_C(0x0000000000040000)", "comment": "window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window"}, {"name": "SDL_WINDOW_POPUP_MENU", "value": "SDL_UINT64_C(0x0000000000080000)", "comment": "window should be treated as a popup menu, requires a parent window"}, {"name": "SDL_WINDOW_KEYBOARD_GRABBED", "value": "SDL_UINT64_C(0x0000000000100000)", "comment": "window has grabbed keyboard input"}, {"name": "SDL_WINDOW_VULKAN", "value": "SDL_UINT64_C(0x0000000010000000)", "comment": "window usable for Vulkan surface"}, {"name": "SDL_WINDOW_METAL", "value": "SDL_UINT64_C(0x0000000020000000)", "comment": "window usable for Metal view"}, {"name": "SDL_WINDOW_TRANSPARENT", "value": "SDL_UINT64_C(0x0000000040000000)", "comment": "window with transparent buffer"}, {"name": "SDL_WINDOW_NOT_FOCUSABLE", "value": "SDL_UINT64_C(0x0000000080000000)", "comment": "window should not be focusable"}]}
|
|
||||||
],
|
|
||||||
"functions": [
|
|
||||||
{"name": "SDL_GetNumVideoDrivers", "return_type": "int", "parameters": []},
|
|
||||||
{"name": "SDL_GetVideoDriver", "return_type": "const char *", "parameters": [{"name": "index", "type": "int"}]},
|
|
||||||
{"name": "SDL_GetCurrentVideoDriver", "return_type": "const char *", "parameters": []},
|
|
||||||
{"name": "SDL_GetSystemTheme", "return_type": "SDL_SystemTheme", "parameters": []},
|
|
||||||
{"name": "SDL_GetDisplays", "return_type": "SDL_DisplayID *", "parameters": [{"name": "count", "type": "int *"}]},
|
|
||||||
{"name": "SDL_GetPrimaryDisplay", "return_type": "SDL_DisplayID", "parameters": []},
|
|
||||||
{"name": "SDL_GetDisplayProperties", "return_type": "SDL_PropertiesID", "parameters": [{"name": "displayID", "type": "SDL_DisplayID"}]},
|
|
||||||
{"name": "SDL_GetDisplayName", "return_type": "const char *", "parameters": [{"name": "displayID", "type": "SDL_DisplayID"}]},
|
|
||||||
{"name": "SDL_GetDisplayBounds", "return_type": "bool", "parameters": [{"name": "displayID", "type": "SDL_DisplayID"}, {"name": "rect", "type": "SDL_Rect *"}]},
|
|
||||||
{"name": "SDL_GetDisplayUsableBounds", "return_type": "bool", "parameters": [{"name": "displayID", "type": "SDL_DisplayID"}, {"name": "rect", "type": "SDL_Rect *"}]},
|
|
||||||
{"name": "SDL_GetNaturalDisplayOrientation", "return_type": "SDL_DisplayOrientation", "parameters": [{"name": "displayID", "type": "SDL_DisplayID"}]},
|
|
||||||
{"name": "SDL_GetCurrentDisplayOrientation", "return_type": "SDL_DisplayOrientation", "parameters": [{"name": "displayID", "type": "SDL_DisplayID"}]},
|
|
||||||
{"name": "SDL_GetDisplayContentScale", "return_type": "float", "parameters": [{"name": "displayID", "type": "SDL_DisplayID"}]},
|
|
||||||
{"name": "SDL_GetFullscreenDisplayModes", "return_type": "SDL_DisplayMode **", "parameters": [{"name": "displayID", "type": "SDL_DisplayID"}, {"name": "count", "type": "int *"}]},
|
|
||||||
{"name": "SDL_GetClosestFullscreenDisplayMode", "return_type": "bool", "parameters": [{"name": "displayID", "type": "SDL_DisplayID"}, {"name": "w", "type": "int"}, {"name": "h", "type": "int"}, {"name": "refresh_rate", "type": "float"}, {"name": "include_high_density_modes", "type": "bool"}, {"name": "closest", "type": "SDL_DisplayMode *"}]},
|
|
||||||
{"name": "SDL_GetDesktopDisplayMode", "return_type": "const SDL_DisplayMode *", "parameters": [{"name": "displayID", "type": "SDL_DisplayID"}]},
|
|
||||||
{"name": "SDL_GetCurrentDisplayMode", "return_type": "const SDL_DisplayMode *", "parameters": [{"name": "displayID", "type": "SDL_DisplayID"}]},
|
|
||||||
{"name": "SDL_GetDisplayForPoint", "return_type": "SDL_DisplayID", "parameters": [{"name": "point", "type": "const SDL_Point *"}]},
|
|
||||||
{"name": "SDL_GetDisplayForRect", "return_type": "SDL_DisplayID", "parameters": [{"name": "rect", "type": "const SDL_Rect *"}]},
|
|
||||||
{"name": "SDL_GetDisplayForWindow", "return_type": "SDL_DisplayID", "parameters": [{"name": "window", "type": "SDL_Window *"}]},
|
|
||||||
{"name": "SDL_GetWindowPixelDensity", "return_type": "float", "parameters": [{"name": "window", "type": "SDL_Window *"}]},
|
|
||||||
{"name": "SDL_GetWindowDisplayScale", "return_type": "float", "parameters": [{"name": "window", "type": "SDL_Window *"}]},
|
|
||||||
{"name": "SDL_SetWindowFullscreenMode", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "mode", "type": "const SDL_DisplayMode *"}]},
|
|
||||||
{"name": "SDL_GetWindowFullscreenMode", "return_type": "const SDL_DisplayMode *", "parameters": [{"name": "window", "type": "SDL_Window *"}]},
|
|
||||||
{"name": "SDL_GetWindowICCProfile", "return_type": "void *", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "size", "type": "size_t *"}]},
|
|
||||||
{"name": "SDL_GetWindowPixelFormat", "return_type": "SDL_PixelFormat", "parameters": [{"name": "window", "type": "SDL_Window *"}]},
|
|
||||||
{"name": "SDL_GetWindows", "return_type": "SDL_Window **", "parameters": [{"name": "count", "type": "int *"}]},
|
|
||||||
{"name": "SDL_CreateWindow", "return_type": "SDL_Window *", "parameters": [{"name": "title", "type": "const char *"}, {"name": "w", "type": "int"}, {"name": "h", "type": "int"}, {"name": "flags", "type": "SDL_WindowFlags"}]},
|
|
||||||
{"name": "SDL_CreatePopupWindow", "return_type": "SDL_Window *", "parameters": [{"name": "parent", "type": "SDL_Window *"}, {"name": "offset_x", "type": "int"}, {"name": "offset_y", "type": "int"}, {"name": "w", "type": "int"}, {"name": "h", "type": "int"}, {"name": "flags", "type": "SDL_WindowFlags"}]},
|
|
||||||
{"name": "SDL_CreateWindowWithProperties", "return_type": "SDL_Window *", "parameters": [{"name": "props", "type": "SDL_PropertiesID"}]},
|
|
||||||
{"name": "SDL_GetWindowID", "return_type": "SDL_WindowID", "parameters": [{"name": "window", "type": "SDL_Window *"}]},
|
|
||||||
{"name": "SDL_GetWindowFromID", "return_type": "SDL_Window *", "parameters": [{"name": "id", "type": "SDL_WindowID"}]},
|
|
||||||
{"name": "SDL_GetWindowParent", "return_type": "SDL_Window *", "parameters": [{"name": "window", "type": "SDL_Window *"}]},
|
|
||||||
{"name": "SDL_GetWindowProperties", "return_type": "SDL_PropertiesID", "parameters": [{"name": "window", "type": "SDL_Window *"}]},
|
|
||||||
{"name": "SDL_GetWindowFlags", "return_type": "SDL_WindowFlags", "parameters": [{"name": "window", "type": "SDL_Window *"}]},
|
|
||||||
{"name": "SDL_SetWindowTitle", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "title", "type": "const char *"}]},
|
|
||||||
{"name": "SDL_GetWindowTitle", "return_type": "const char *", "parameters": [{"name": "window", "type": "SDL_Window *"}]},
|
|
||||||
{"name": "SDL_SetWindowIcon", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "icon", "type": "SDL_Surface *"}]},
|
|
||||||
{"name": "SDL_SetWindowPosition", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "x", "type": "int"}, {"name": "y", "type": "int"}]},
|
|
||||||
{"name": "SDL_GetWindowPosition", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "x", "type": "int *"}, {"name": "y", "type": "int *"}]},
|
|
||||||
{"name": "SDL_SetWindowSize", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "w", "type": "int"}, {"name": "h", "type": "int"}]},
|
|
||||||
{"name": "SDL_GetWindowSize", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "w", "type": "int *"}, {"name": "h", "type": "int *"}]},
|
|
||||||
{"name": "SDL_GetWindowSafeArea", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "rect", "type": "SDL_Rect *"}]},
|
|
||||||
{"name": "SDL_SetWindowAspectRatio", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "min_aspect", "type": "float"}, {"name": "max_aspect", "type": "float"}]},
|
|
||||||
{"name": "SDL_GetWindowAspectRatio", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "min_aspect", "type": "float *"}, {"name": "max_aspect", "type": "float *"}]},
|
|
||||||
{"name": "SDL_GetWindowBordersSize", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "top", "type": "int *"}, {"name": "left", "type": "int *"}, {"name": "bottom", "type": "int *"}, {"name": "right", "type": "int *"}]},
|
|
||||||
{"name": "SDL_GetWindowSizeInPixels", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "w", "type": "int *"}, {"name": "h", "type": "int *"}]},
|
|
||||||
{"name": "SDL_SetWindowMinimumSize", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "min_w", "type": "int"}, {"name": "min_h", "type": "int"}]},
|
|
||||||
{"name": "SDL_GetWindowMinimumSize", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "w", "type": "int *"}, {"name": "h", "type": "int *"}]},
|
|
||||||
{"name": "SDL_SetWindowMaximumSize", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "max_w", "type": "int"}, {"name": "max_h", "type": "int"}]},
|
|
||||||
{"name": "SDL_GetWindowMaximumSize", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "w", "type": "int *"}, {"name": "h", "type": "int *"}]},
|
|
||||||
{"name": "SDL_SetWindowBordered", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "bordered", "type": "bool"}]},
|
|
||||||
{"name": "SDL_SetWindowResizable", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "resizable", "type": "bool"}]},
|
|
||||||
{"name": "SDL_SetWindowAlwaysOnTop", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "on_top", "type": "bool"}]},
|
|
||||||
{"name": "SDL_ShowWindow", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}]},
|
|
||||||
{"name": "SDL_HideWindow", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}]},
|
|
||||||
{"name": "SDL_RaiseWindow", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}]},
|
|
||||||
{"name": "SDL_MaximizeWindow", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}]},
|
|
||||||
{"name": "SDL_MinimizeWindow", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}]},
|
|
||||||
{"name": "SDL_RestoreWindow", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}]},
|
|
||||||
{"name": "SDL_SetWindowFullscreen", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "fullscreen", "type": "bool"}]},
|
|
||||||
{"name": "SDL_SyncWindow", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}]},
|
|
||||||
{"name": "SDL_WindowHasSurface", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}]},
|
|
||||||
{"name": "SDL_GetWindowSurface", "return_type": "SDL_Surface *", "parameters": [{"name": "window", "type": "SDL_Window *"}]},
|
|
||||||
{"name": "SDL_SetWindowSurfaceVSync", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "vsync", "type": "int"}]},
|
|
||||||
{"name": "SDL_GetWindowSurfaceVSync", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "vsync", "type": "int *"}]},
|
|
||||||
{"name": "SDL_UpdateWindowSurface", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}]},
|
|
||||||
{"name": "SDL_UpdateWindowSurfaceRects", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "rects", "type": "const SDL_Rect *"}, {"name": "numrects", "type": "int"}]},
|
|
||||||
{"name": "SDL_DestroyWindowSurface", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}]},
|
|
||||||
{"name": "SDL_SetWindowKeyboardGrab", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "grabbed", "type": "bool"}]},
|
|
||||||
{"name": "SDL_SetWindowMouseGrab", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "grabbed", "type": "bool"}]},
|
|
||||||
{"name": "SDL_GetWindowKeyboardGrab", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}]},
|
|
||||||
{"name": "SDL_GetWindowMouseGrab", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}]},
|
|
||||||
{"name": "SDL_GetGrabbedWindow", "return_type": "SDL_Window *", "parameters": []},
|
|
||||||
{"name": "SDL_SetWindowMouseRect", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "rect", "type": "const SDL_Rect *"}]},
|
|
||||||
{"name": "SDL_GetWindowMouseRect", "return_type": "const SDL_Rect *", "parameters": [{"name": "window", "type": "SDL_Window *"}]},
|
|
||||||
{"name": "SDL_SetWindowOpacity", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "opacity", "type": "float"}]},
|
|
||||||
{"name": "SDL_GetWindowOpacity", "return_type": "float", "parameters": [{"name": "window", "type": "SDL_Window *"}]},
|
|
||||||
{"name": "SDL_SetWindowParent", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "parent", "type": "SDL_Window *"}]},
|
|
||||||
{"name": "SDL_SetWindowModal", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "modal", "type": "bool"}]},
|
|
||||||
{"name": "SDL_SetWindowFocusable", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "focusable", "type": "bool"}]},
|
|
||||||
{"name": "SDL_ShowWindowSystemMenu", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "x", "type": "int"}, {"name": "y", "type": "int"}]},
|
|
||||||
{"name": "SDL_SetWindowHitTest", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "callback", "type": "SDL_HitTest"}, {"name": "callback_data", "type": "void *"}]},
|
|
||||||
{"name": "SDL_SetWindowShape", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "shape", "type": "SDL_Surface *"}]},
|
|
||||||
{"name": "SDL_FlashWindow", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "operation", "type": "SDL_FlashOperation"}]},
|
|
||||||
{"name": "SDL_DestroyWindow", "return_type": "void", "parameters": [{"name": "window", "type": "SDL_Window *"}]},
|
|
||||||
{"name": "SDL_ScreenSaverEnabled", "return_type": "bool", "parameters": []},
|
|
||||||
{"name": "SDL_EnableScreenSaver", "return_type": "bool", "parameters": []},
|
|
||||||
{"name": "SDL_DisableScreenSaver", "return_type": "bool", "parameters": []},
|
|
||||||
{"name": "SDL_GL_LoadLibrary", "return_type": "bool", "parameters": [{"name": "path", "type": "const char *"}]},
|
|
||||||
{"name": "SDL_GL_GetProcAddress", "return_type": "SDL_FunctionPointer", "parameters": [{"name": "proc", "type": "const char *"}]},
|
|
||||||
{"name": "SDL_EGL_GetProcAddress", "return_type": "SDL_FunctionPointer", "parameters": [{"name": "proc", "type": "const char *"}]},
|
|
||||||
{"name": "SDL_GL_UnloadLibrary", "return_type": "void", "parameters": []},
|
|
||||||
{"name": "SDL_GL_ExtensionSupported", "return_type": "bool", "parameters": [{"name": "extension", "type": "const char *"}]},
|
|
||||||
{"name": "SDL_GL_ResetAttributes", "return_type": "void", "parameters": []},
|
|
||||||
{"name": "SDL_GL_SetAttribute", "return_type": "bool", "parameters": [{"name": "attr", "type": "SDL_GLAttr"}, {"name": "value", "type": "int"}]},
|
|
||||||
{"name": "SDL_GL_GetAttribute", "return_type": "bool", "parameters": [{"name": "attr", "type": "SDL_GLAttr"}, {"name": "value", "type": "int *"}]},
|
|
||||||
{"name": "SDL_GL_CreateContext", "return_type": "SDL_GLContext", "parameters": [{"name": "window", "type": "SDL_Window *"}]},
|
|
||||||
{"name": "SDL_GL_MakeCurrent", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}, {"name": "context", "type": "SDL_GLContext"}]},
|
|
||||||
{"name": "SDL_GL_GetCurrentWindow", "return_type": "SDL_Window *", "parameters": []},
|
|
||||||
{"name": "SDL_GL_GetCurrentContext", "return_type": "SDL_GLContext", "parameters": []},
|
|
||||||
{"name": "SDL_EGL_GetCurrentDisplay", "return_type": "SDL_EGLDisplay", "parameters": []},
|
|
||||||
{"name": "SDL_EGL_GetCurrentConfig", "return_type": "SDL_EGLConfig", "parameters": []},
|
|
||||||
{"name": "SDL_EGL_GetWindowSurface", "return_type": "SDL_EGLSurface", "parameters": [{"name": "window", "type": "SDL_Window *"}]},
|
|
||||||
{"name": "SDL_EGL_SetAttributeCallbacks", "return_type": "void", "parameters": [{"name": "platformAttribCallback", "type": "SDL_EGLAttribArrayCallback"}, {"name": "surfaceAttribCallback", "type": "SDL_EGLIntArrayCallback"}, {"name": "contextAttribCallback", "type": "SDL_EGLIntArrayCallback"}, {"name": "userdata", "type": "void *"}]},
|
|
||||||
{"name": "SDL_GL_SetSwapInterval", "return_type": "bool", "parameters": [{"name": "interval", "type": "int"}]},
|
|
||||||
{"name": "SDL_GL_GetSwapInterval", "return_type": "bool", "parameters": [{"name": "interval", "type": "int *"}]},
|
|
||||||
{"name": "SDL_GL_SwapWindow", "return_type": "bool", "parameters": [{"name": "window", "type": "SDL_Window *"}]},
|
|
||||||
{"name": "SDL_GL_DestroyContext", "return_type": "bool", "parameters": [{"name": "context", "type": "SDL_GLContext"}]}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue