609 lines
19 KiB
Zig
609 lines
19 KiB
Zig
const std = @import("std");
|
|
pub const c = @import("c.zig").c;
|
|
|
|
pub const PixelFormat = enum(c_int) {
|
|
pixelformatUnknown,
|
|
pixelformatIndex1lsb,
|
|
pixelformatIndex1msb,
|
|
pixelformatIndex2lsb,
|
|
pixelformatIndex2msb,
|
|
pixelformatIndex4lsb,
|
|
pixelformatIndex4msb,
|
|
pixelformatIndex8,
|
|
pixelformatRgb332,
|
|
pixelformatXrgb4444,
|
|
pixelformatXbgr4444,
|
|
pixelformatXrgb1555,
|
|
pixelformatXbgr1555,
|
|
pixelformatArgb4444,
|
|
pixelformatRgba4444,
|
|
pixelformatAbgr4444,
|
|
pixelformatBgra4444,
|
|
pixelformatArgb1555,
|
|
pixelformatRgba5551,
|
|
pixelformatAbgr1555,
|
|
pixelformatBgra5551,
|
|
pixelformatRgb565,
|
|
pixelformatBgr565,
|
|
pixelformatRgb24,
|
|
pixelformatBgr24,
|
|
pixelformatXrgb8888,
|
|
pixelformatRgbx8888,
|
|
pixelformatXbgr8888,
|
|
pixelformatBgrx8888,
|
|
pixelformatArgb8888,
|
|
pixelformatRgba8888,
|
|
pixelformatAbgr8888,
|
|
pixelformatBgra8888,
|
|
pixelformatXrgb2101010,
|
|
pixelformatXbgr2101010,
|
|
pixelformatArgb2101010,
|
|
pixelformatAbgr2101010,
|
|
pixelformatRgb48,
|
|
pixelformatBgr48,
|
|
pixelformatRgba64,
|
|
pixelformatArgb64,
|
|
pixelformatBgra64,
|
|
pixelformatAbgr64,
|
|
pixelformatRgb48Float,
|
|
pixelformatBgr48Float,
|
|
pixelformatRgba64Float,
|
|
pixelformatArgb64Float,
|
|
pixelformatBgra64Float,
|
|
pixelformatAbgr64Float,
|
|
pixelformatRgb96Float,
|
|
pixelformatBgr96Float,
|
|
pixelformatRgba128Float,
|
|
pixelformatArgb128Float,
|
|
pixelformatBgra128Float,
|
|
pixelformatAbgr128Float,
|
|
pixelformatRgba32,
|
|
pixelformatArgb32,
|
|
pixelformatBgra32,
|
|
pixelformatAbgr32,
|
|
pixelformatRgbx32,
|
|
pixelformatXrgb32,
|
|
pixelformatBgrx32,
|
|
pixelformatXbgr32,
|
|
};
|
|
|
|
pub const Point = extern struct {
|
|
x: c_int,
|
|
y: c_int,
|
|
};
|
|
|
|
pub const Surface = opaque {};
|
|
|
|
pub const PropertiesID = u32;
|
|
|
|
pub const Rect = extern struct {
|
|
x: c_int,
|
|
y: c_int,
|
|
w: c_int,
|
|
h: c_int,
|
|
};
|
|
|
|
pub const DisplayID = u32;
|
|
|
|
pub const WindowID = u32;
|
|
|
|
pub const SystemTheme = enum(c_int) {};
|
|
|
|
pub const DisplayModeData = opaque {};
|
|
|
|
pub const DisplayMode = extern struct {};
|
|
|
|
pub const DisplayOrientation = enum(c_int) {};
|
|
|
|
pub const Window = opaque {
|
|
pub inline fn getDisplayForWindow(window: *Window) DisplayID {
|
|
return c.SDL_GetDisplayForWindow(window);
|
|
}
|
|
|
|
pub inline fn getWindowPixelDensity(window: *Window) f32 {
|
|
return c.SDL_GetWindowPixelDensity(window);
|
|
}
|
|
|
|
pub inline fn getWindowDisplayScale(window: *Window) f32 {
|
|
return c.SDL_GetWindowDisplayScale(window);
|
|
}
|
|
|
|
pub inline fn setWindowFullscreenMode(window: *Window, mode: *const DisplayMode) bool {
|
|
return c.SDL_SetWindowFullscreenMode(window, @ptrCast(mode));
|
|
}
|
|
|
|
pub inline fn getWindowFullscreenMode(window: *Window) *const DisplayMode {
|
|
return @ptrCast(c.SDL_GetWindowFullscreenMode(window));
|
|
}
|
|
|
|
pub inline fn getWindowICCProfile(window: *Window, size: *usize) ?*anyopaque {
|
|
return c.SDL_GetWindowICCProfile(window, @ptrCast(size));
|
|
}
|
|
|
|
pub inline fn getWindowPixelFormat(window: *Window) PixelFormat {
|
|
return @bitCast(c.SDL_GetWindowPixelFormat(window));
|
|
}
|
|
|
|
pub inline fn createPopupWindow(
|
|
window: *Window,
|
|
offset_x: c_int,
|
|
offset_y: c_int,
|
|
w: c_int,
|
|
h: c_int,
|
|
flags: WindowFlags,
|
|
) ?*Window {
|
|
return c.SDL_CreatePopupWindow(window, offset_x, offset_y, w, h, @bitCast(flags));
|
|
}
|
|
|
|
pub inline fn getWindowID(window: *Window) WindowID {
|
|
return c.SDL_GetWindowID(window);
|
|
}
|
|
|
|
pub inline fn getWindowParent(window: *Window) ?*Window {
|
|
return c.SDL_GetWindowParent(window);
|
|
}
|
|
|
|
pub inline fn getWindowProperties(window: *Window) PropertiesID {
|
|
return c.SDL_GetWindowProperties(window);
|
|
}
|
|
|
|
pub inline fn getWindowFlags(window: *Window) WindowFlags {
|
|
return @bitCast(c.SDL_GetWindowFlags(window));
|
|
}
|
|
|
|
pub inline fn setWindowTitle(window: *Window, title: [*c]const u8) bool {
|
|
return c.SDL_SetWindowTitle(window, title);
|
|
}
|
|
|
|
pub inline fn getWindowTitle(window: *Window) [*c]const u8 {
|
|
return c.SDL_GetWindowTitle(window);
|
|
}
|
|
|
|
pub inline fn setWindowIcon(window: *Window, icon: ?*Surface) bool {
|
|
return c.SDL_SetWindowIcon(window, icon);
|
|
}
|
|
|
|
pub inline fn setWindowPosition(window: *Window, x: c_int, y: c_int) bool {
|
|
return c.SDL_SetWindowPosition(window, x, y);
|
|
}
|
|
|
|
pub inline fn getWindowPosition(window: *Window, x: *c_int, y: *c_int) bool {
|
|
return c.SDL_GetWindowPosition(window, @ptrCast(x), @ptrCast(y));
|
|
}
|
|
|
|
pub inline fn setWindowSize(window: *Window, w: c_int, h: c_int) bool {
|
|
return c.SDL_SetWindowSize(window, w, h);
|
|
}
|
|
|
|
pub inline fn getWindowSize(window: *Window, w: *c_int, h: *c_int) bool {
|
|
return c.SDL_GetWindowSize(window, @ptrCast(w), @ptrCast(h));
|
|
}
|
|
|
|
pub inline fn getWindowSafeArea(window: *Window, rect: ?*Rect) bool {
|
|
return c.SDL_GetWindowSafeArea(window, rect);
|
|
}
|
|
|
|
pub inline fn setWindowAspectRatio(window: *Window, min_aspect: f32, max_aspect: f32) bool {
|
|
return c.SDL_SetWindowAspectRatio(window, min_aspect, max_aspect);
|
|
}
|
|
|
|
pub inline fn getWindowAspectRatio(window: *Window, min_aspect: *f32, max_aspect: *f32) bool {
|
|
return c.SDL_GetWindowAspectRatio(window, @ptrCast(min_aspect), @ptrCast(max_aspect));
|
|
}
|
|
|
|
pub inline fn getWindowBordersSize(
|
|
window: *Window,
|
|
top: *c_int,
|
|
left: *c_int,
|
|
bottom: *c_int,
|
|
right: *c_int,
|
|
) bool {
|
|
return c.SDL_GetWindowBordersSize(window, @ptrCast(top), @ptrCast(left), @ptrCast(bottom), @ptrCast(right));
|
|
}
|
|
|
|
pub inline fn getWindowSizeInPixels(window: *Window, w: *c_int, h: *c_int) bool {
|
|
return c.SDL_GetWindowSizeInPixels(window, @ptrCast(w), @ptrCast(h));
|
|
}
|
|
|
|
pub inline fn setWindowMinimumSize(window: *Window, min_w: c_int, min_h: c_int) bool {
|
|
return c.SDL_SetWindowMinimumSize(window, min_w, min_h);
|
|
}
|
|
|
|
pub inline fn getWindowMinimumSize(window: *Window, w: *c_int, h: *c_int) bool {
|
|
return c.SDL_GetWindowMinimumSize(window, @ptrCast(w), @ptrCast(h));
|
|
}
|
|
|
|
pub inline fn setWindowMaximumSize(window: *Window, max_w: c_int, max_h: c_int) bool {
|
|
return c.SDL_SetWindowMaximumSize(window, max_w, max_h);
|
|
}
|
|
|
|
pub inline fn getWindowMaximumSize(window: *Window, w: *c_int, h: *c_int) bool {
|
|
return c.SDL_GetWindowMaximumSize(window, @ptrCast(w), @ptrCast(h));
|
|
}
|
|
|
|
pub inline fn setWindowBordered(window: *Window, bordered: bool) bool {
|
|
return c.SDL_SetWindowBordered(window, bordered);
|
|
}
|
|
|
|
pub inline fn setWindowResizable(window: *Window, resizable: bool) bool {
|
|
return c.SDL_SetWindowResizable(window, resizable);
|
|
}
|
|
|
|
pub inline fn setWindowAlwaysOnTop(window: *Window, on_top: bool) bool {
|
|
return c.SDL_SetWindowAlwaysOnTop(window, on_top);
|
|
}
|
|
|
|
pub inline fn showWindow(window: *Window) bool {
|
|
return c.SDL_ShowWindow(window);
|
|
}
|
|
|
|
pub inline fn hideWindow(window: *Window) bool {
|
|
return c.SDL_HideWindow(window);
|
|
}
|
|
|
|
pub inline fn raiseWindow(window: *Window) bool {
|
|
return c.SDL_RaiseWindow(window);
|
|
}
|
|
|
|
pub inline fn maximizeWindow(window: *Window) bool {
|
|
return c.SDL_MaximizeWindow(window);
|
|
}
|
|
|
|
pub inline fn minimizeWindow(window: *Window) bool {
|
|
return c.SDL_MinimizeWindow(window);
|
|
}
|
|
|
|
pub inline fn restoreWindow(window: *Window) bool {
|
|
return c.SDL_RestoreWindow(window);
|
|
}
|
|
|
|
pub inline fn setWindowFullscreen(window: *Window, fullscreen: bool) bool {
|
|
return c.SDL_SetWindowFullscreen(window, fullscreen);
|
|
}
|
|
|
|
pub inline fn syncWindow(window: *Window) bool {
|
|
return c.SDL_SyncWindow(window);
|
|
}
|
|
|
|
pub inline fn windowHasSurface(window: *Window) bool {
|
|
return c.SDL_WindowHasSurface(window);
|
|
}
|
|
|
|
pub inline fn getWindowSurface(window: *Window) ?*Surface {
|
|
return c.SDL_GetWindowSurface(window);
|
|
}
|
|
|
|
pub inline fn setWindowSurfaceVSync(window: *Window, vsync: c_int) bool {
|
|
return c.SDL_SetWindowSurfaceVSync(window, vsync);
|
|
}
|
|
|
|
pub inline fn getWindowSurfaceVSync(window: *Window, vsync: *c_int) bool {
|
|
return c.SDL_GetWindowSurfaceVSync(window, @ptrCast(vsync));
|
|
}
|
|
|
|
pub inline fn updateWindowSurface(window: *Window) bool {
|
|
return c.SDL_UpdateWindowSurface(window);
|
|
}
|
|
|
|
pub inline fn updateWindowSurfaceRects(window: *Window, rects: *const Rect, numrects: c_int) bool {
|
|
return c.SDL_UpdateWindowSurfaceRects(window, @ptrCast(rects), numrects);
|
|
}
|
|
|
|
pub inline fn destroyWindowSurface(window: *Window) bool {
|
|
return c.SDL_DestroyWindowSurface(window);
|
|
}
|
|
|
|
pub inline fn setWindowKeyboardGrab(window: *Window, grabbed: bool) bool {
|
|
return c.SDL_SetWindowKeyboardGrab(window, grabbed);
|
|
}
|
|
|
|
pub inline fn setWindowMouseGrab(window: *Window, grabbed: bool) bool {
|
|
return c.SDL_SetWindowMouseGrab(window, grabbed);
|
|
}
|
|
|
|
pub inline fn getWindowKeyboardGrab(window: *Window) bool {
|
|
return c.SDL_GetWindowKeyboardGrab(window);
|
|
}
|
|
|
|
pub inline fn getWindowMouseGrab(window: *Window) bool {
|
|
return c.SDL_GetWindowMouseGrab(window);
|
|
}
|
|
|
|
pub inline fn setWindowMouseRect(window: *Window, rect: *const Rect) bool {
|
|
return c.SDL_SetWindowMouseRect(window, @ptrCast(rect));
|
|
}
|
|
|
|
pub inline fn getWindowMouseRect(window: *Window) *const Rect {
|
|
return @ptrCast(c.SDL_GetWindowMouseRect(window));
|
|
}
|
|
|
|
pub inline fn setWindowOpacity(window: *Window, opacity: f32) bool {
|
|
return c.SDL_SetWindowOpacity(window, opacity);
|
|
}
|
|
|
|
pub inline fn getWindowOpacity(window: *Window) f32 {
|
|
return c.SDL_GetWindowOpacity(window);
|
|
}
|
|
|
|
pub inline fn setWindowParent(window: *Window, parent: ?*Window) bool {
|
|
return c.SDL_SetWindowParent(window, parent);
|
|
}
|
|
|
|
pub inline fn setWindowModal(window: *Window, modal: bool) bool {
|
|
return c.SDL_SetWindowModal(window, modal);
|
|
}
|
|
|
|
pub inline fn setWindowFocusable(window: *Window, focusable: bool) bool {
|
|
return c.SDL_SetWindowFocusable(window, focusable);
|
|
}
|
|
|
|
pub inline fn showWindowSystemMenu(window: *Window, x: c_int, y: c_int) bool {
|
|
return c.SDL_ShowWindowSystemMenu(window, x, y);
|
|
}
|
|
|
|
pub inline fn setWindowHitTest(window: *Window, callback: HitTest, callback_data: ?*anyopaque) bool {
|
|
return c.SDL_SetWindowHitTest(window, callback, callback_data);
|
|
}
|
|
|
|
pub inline fn setWindowShape(window: *Window, shape: ?*Surface) bool {
|
|
return c.SDL_SetWindowShape(window, shape);
|
|
}
|
|
|
|
pub inline fn flashWindow(window: *Window, operation: FlashOperation) bool {
|
|
return c.SDL_FlashWindow(window, @intFromEnum(operation));
|
|
}
|
|
|
|
pub inline fn destroyWindow(window: *Window) void {
|
|
return c.SDL_DestroyWindow(window);
|
|
}
|
|
|
|
pub inline fn gl_CreateContext(window: *Window) GLContext {
|
|
return c.SDL_GL_CreateContext(window);
|
|
}
|
|
|
|
pub inline fn gl_MakeCurrent(window: *Window, context: GLContext) bool {
|
|
return c.SDL_GL_MakeCurrent(window, context);
|
|
}
|
|
|
|
pub inline fn egl_GetWindowSurface(window: *Window) EGLSurface {
|
|
return c.SDL_EGL_GetWindowSurface(window);
|
|
}
|
|
|
|
pub inline fn gl_SwapWindow(window: *Window) bool {
|
|
return c.SDL_GL_SwapWindow(window);
|
|
}
|
|
};
|
|
|
|
pub const WindowFlags = packed struct(u64) {
|
|
windowFullscreen: bool = false, // window is in fullscreen mode
|
|
windowOpengl: bool = false, // window usable with OpenGL context
|
|
windowOccluded: bool = false, // window is occluded
|
|
windowHidden: bool = false, // window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible
|
|
windowBorderless: bool = false, // no window decoration
|
|
windowResizable: bool = false, // window can be resized
|
|
windowMinimized: bool = false, // window is minimized
|
|
windowMaximized: bool = false, // window is maximized
|
|
windowMouseGrabbed: bool = false, // window has grabbed mouse input
|
|
windowInputFocus: bool = false, // window has input focus
|
|
windowMouseFocus: bool = false, // window has mouse focus
|
|
windowExternal: bool = false, // window not created by SDL
|
|
windowModal: bool = false, // window is modal
|
|
windowHighPixelDensity: bool = false, // window uses high pixel density back buffer if possible
|
|
windowMouseCapture: bool = false, // window has mouse captured (unrelated to MOUSE_GRABBED)
|
|
windowMouseRelativeMode: bool = false, // window has relative mode enabled
|
|
windowAlwaysOnTop: bool = false, // window should always be above others
|
|
windowUtility: bool = false, // window should be treated as a utility window, not showing in the task bar and window list
|
|
windowTooltip: bool = false, // window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window
|
|
windowPopupMenu: bool = false, // window should be treated as a popup menu, requires a parent window
|
|
windowKeyboardGrabbed: bool = false, // window has grabbed keyboard input
|
|
windowVulkan: bool = false, // window usable for Vulkan surface
|
|
windowMetal: bool = false, // window usable for Metal view
|
|
windowTransparent: bool = false, // window with transparent buffer
|
|
windowNotFocusable: bool = false, // window should not be focusable
|
|
pad0: u38 = 0,
|
|
rsvd: bool = false,
|
|
};
|
|
|
|
pub const FlashOperation = enum(c_int) {};
|
|
|
|
pub const GLContextState = extern struct {};
|
|
|
|
pub const GLProfile = u32;
|
|
|
|
pub const GLContextFlag = u32;
|
|
|
|
pub const GLContextReleaseFlag = u32;
|
|
|
|
pub const GLContextResetNotification = u32;
|
|
|
|
pub inline fn getNumVideoDrivers() c_int {
|
|
return c.SDL_GetNumVideoDrivers();
|
|
}
|
|
|
|
pub inline fn getVideoDriver(index: c_int) [*c]const u8 {
|
|
return c.SDL_GetVideoDriver(index);
|
|
}
|
|
|
|
pub inline fn getCurrentVideoDriver() [*c]const u8 {
|
|
return c.SDL_GetCurrentVideoDriver();
|
|
}
|
|
|
|
pub inline fn getSystemTheme() SystemTheme {
|
|
return c.SDL_GetSystemTheme();
|
|
}
|
|
|
|
pub inline fn getDisplays(count: *c_int) ?*DisplayID {
|
|
return c.SDL_GetDisplays(@ptrCast(count));
|
|
}
|
|
|
|
pub inline fn getPrimaryDisplay() DisplayID {
|
|
return c.SDL_GetPrimaryDisplay();
|
|
}
|
|
|
|
pub inline fn getDisplayProperties(displayID: DisplayID) PropertiesID {
|
|
return c.SDL_GetDisplayProperties(displayID);
|
|
}
|
|
|
|
pub inline fn getDisplayName(displayID: DisplayID) [*c]const u8 {
|
|
return c.SDL_GetDisplayName(displayID);
|
|
}
|
|
|
|
pub inline fn getDisplayBounds(displayID: DisplayID, rect: ?*Rect) bool {
|
|
return c.SDL_GetDisplayBounds(displayID, rect);
|
|
}
|
|
|
|
pub inline fn getDisplayUsableBounds(displayID: DisplayID, rect: ?*Rect) bool {
|
|
return c.SDL_GetDisplayUsableBounds(displayID, rect);
|
|
}
|
|
|
|
pub inline fn getNaturalDisplayOrientation(displayID: DisplayID) DisplayOrientation {
|
|
return c.SDL_GetNaturalDisplayOrientation(displayID);
|
|
}
|
|
|
|
pub inline fn getCurrentDisplayOrientation(displayID: DisplayID) DisplayOrientation {
|
|
return c.SDL_GetCurrentDisplayOrientation(displayID);
|
|
}
|
|
|
|
pub inline fn getDisplayContentScale(displayID: DisplayID) f32 {
|
|
return c.SDL_GetDisplayContentScale(displayID);
|
|
}
|
|
|
|
pub inline fn getFullscreenDisplayModes(displayID: DisplayID, count: *c_int) ?*?*DisplayMode {
|
|
return @intFromEnum(c.SDL_GetFullscreenDisplayModes(displayID, @ptrCast(count)));
|
|
}
|
|
|
|
pub inline fn getClosestFullscreenDisplayMode(
|
|
displayID: DisplayID,
|
|
w: c_int,
|
|
h: c_int,
|
|
refresh_rate: f32,
|
|
include_high_density_modes: bool,
|
|
closest: ?*DisplayMode,
|
|
) bool {
|
|
return c.SDL_GetClosestFullscreenDisplayMode(displayID, w, h, refresh_rate, include_high_density_modes, @intFromEnum(closest));
|
|
}
|
|
|
|
pub inline fn getDesktopDisplayMode(displayID: DisplayID) *const DisplayMode {
|
|
return @ptrCast(c.SDL_GetDesktopDisplayMode(displayID));
|
|
}
|
|
|
|
pub inline fn getCurrentDisplayMode(displayID: DisplayID) *const DisplayMode {
|
|
return @ptrCast(c.SDL_GetCurrentDisplayMode(displayID));
|
|
}
|
|
|
|
pub inline fn getDisplayForPoint(point: *const Point) DisplayID {
|
|
return c.SDL_GetDisplayForPoint(@ptrCast(point));
|
|
}
|
|
|
|
pub inline fn getDisplayForRect(rect: *const Rect) DisplayID {
|
|
return c.SDL_GetDisplayForRect(@ptrCast(rect));
|
|
}
|
|
|
|
pub inline fn getWindows(count: *c_int) ?*?*Window {
|
|
return c.SDL_GetWindows(@ptrCast(count));
|
|
}
|
|
|
|
pub inline fn createWindow(
|
|
title: [*c]const u8,
|
|
w: c_int,
|
|
h: c_int,
|
|
flags: WindowFlags,
|
|
) ?*Window {
|
|
return c.SDL_CreateWindow(title, w, h, @bitCast(flags));
|
|
}
|
|
|
|
pub inline fn createWindowWithProperties(props: PropertiesID) ?*Window {
|
|
return c.SDL_CreateWindowWithProperties(props);
|
|
}
|
|
|
|
pub inline fn getWindowFromID(id: WindowID) ?*Window {
|
|
return c.SDL_GetWindowFromID(id);
|
|
}
|
|
|
|
pub inline fn getGrabbedWindow() ?*Window {
|
|
return c.SDL_GetGrabbedWindow();
|
|
}
|
|
|
|
pub const HitTestResult = enum(c_int) {};
|
|
|
|
pub inline fn screenSaverEnabled() bool {
|
|
return c.SDL_ScreenSaverEnabled();
|
|
}
|
|
|
|
pub inline fn enableScreenSaver() bool {
|
|
return c.SDL_EnableScreenSaver();
|
|
}
|
|
|
|
pub inline fn disableScreenSaver() bool {
|
|
return c.SDL_DisableScreenSaver();
|
|
}
|
|
|
|
pub inline fn gl_LoadLibrary(path: [*c]const u8) bool {
|
|
return c.SDL_GL_LoadLibrary(path);
|
|
}
|
|
|
|
pub inline fn gl_GetProcAddress(proc: [*c]const u8) FunctionPointer {
|
|
return c.SDL_GL_GetProcAddress(proc);
|
|
}
|
|
|
|
pub inline fn egl_GetProcAddress(proc: [*c]const u8) FunctionPointer {
|
|
return c.SDL_EGL_GetProcAddress(proc);
|
|
}
|
|
|
|
pub inline fn gl_UnloadLibrary() void {
|
|
return c.SDL_GL_UnloadLibrary();
|
|
}
|
|
|
|
pub inline fn gl_ExtensionSupported(extension: [*c]const u8) bool {
|
|
return c.SDL_GL_ExtensionSupported(extension);
|
|
}
|
|
|
|
pub inline fn gl_ResetAttributes() void {
|
|
return c.SDL_GL_ResetAttributes();
|
|
}
|
|
|
|
pub inline fn gl_SetAttribute(attr: GLAttr, value: c_int) bool {
|
|
return c.SDL_GL_SetAttribute(attr, value);
|
|
}
|
|
|
|
pub inline fn gl_GetAttribute(attr: GLAttr, value: *c_int) bool {
|
|
return c.SDL_GL_GetAttribute(attr, @ptrCast(value));
|
|
}
|
|
|
|
pub inline fn gl_GetCurrentWindow() ?*Window {
|
|
return c.SDL_GL_GetCurrentWindow();
|
|
}
|
|
|
|
pub inline fn gl_GetCurrentContext() GLContext {
|
|
return c.SDL_GL_GetCurrentContext();
|
|
}
|
|
|
|
pub inline fn egl_GetCurrentDisplay() EGLDisplay {
|
|
return c.SDL_EGL_GetCurrentDisplay();
|
|
}
|
|
|
|
pub inline fn egl_GetCurrentConfig() EGLConfig {
|
|
return c.SDL_EGL_GetCurrentConfig();
|
|
}
|
|
|
|
pub inline fn egl_SetAttributeCallbacks(
|
|
platformAttribCallback: EGLAttribArrayCallback,
|
|
surfaceAttribCallback: EGLIntArrayCallback,
|
|
contextAttribCallback: EGLIntArrayCallback,
|
|
userdata: ?*anyopaque,
|
|
) void {
|
|
return c.SDL_EGL_SetAttributeCallbacks(platformAttribCallback, surfaceAttribCallback, contextAttribCallback, userdata);
|
|
}
|
|
|
|
pub inline fn gl_SetSwapInterval(interval: c_int) bool {
|
|
return c.SDL_GL_SetSwapInterval(interval);
|
|
}
|
|
|
|
pub inline fn gl_GetSwapInterval(interval: *c_int) bool {
|
|
return c.SDL_GL_GetSwapInterval(@ptrCast(interval));
|
|
}
|
|
|
|
pub inline fn gl_DestroyContext(context: GLContext) bool {
|
|
return c.SDL_GL_DestroyContext(context);
|
|
}
|