MiniDoom

src/i_video.ml

Owns the Win32 game window, keyboard/mouse polling, indexed-frame presentation, HD overlays, wipes, and screenshots.

Package
(global)
Reachable
Yes

Imports

Declarations

_I_AddKeyMap

inline function _I_AddKeyMap(vk, doomKey)

Appends a Win32 virtual-key to Doom-key mapping with an initially released edge-tracking cell.

ParameterTypeDefaultDescription
vkdynamic—Vk value supplied to `_I_AddKeyMap`.
doomKeydynamic—Doom input-key code to process.

View source

_i_altGPrev

_i_altGPrev

Tracks whether i alt gprev is active in the i video subsystem.

View source

_I_BI_RGB

const _I_BI_RGB = 0

Defines i bi rgb for the i video subsystem.

View source

_i_bmi

_i_bmi

Tracks the mutable i bmi value used by the i video subsystem.

View source

_I_BMP_HEADER_SIZE

const _I_BMP_HEADER_SIZE = 54

Defines i bmp header size for the i video subsystem.

View source

_I_BuildBmpFromFrame

function _I_BuildBmpFromFrame()

Encodes the currently selected presentation framebuffer as an 8-bit BMP.

View source

_I_BuildBmpFromIndexedFrame

function _I_BuildBmpFromIndexedFrame(src, width, height)

Builds an 8-bit BMP from a prepared indexed frame.

ParameterTypeDefaultDescription
srcdynamic—Src value supplied to `_I_BuildBmpFromIndexedFrame`.
widthdynamic—Width of the target in pixels or map units.
heightdynamic—Height of the target in pixels or map units.

View source

_I_BuildHighresGameFrame

function _I_BuildHighresGameFrame()

Presents the native high-resolution world buffer plus scaled logical UI/overlay areas.

View source

_I_BuildNearestLogicalFrame

function _I_BuildNearestLogicalFrame(src)

Builds a cheap nearest-scaled logical frame used as fallback behind prepared assets.

ParameterTypeDefaultDescription
srcdynamic—Src value supplied to `_I_BuildNearestLogicalFrame`.

View source

_I_BuildPresentFrame

function _I_BuildPresentFrame()

Returns the framebuffer that should be presented to the window.

View source

_I_ClampPresentScale

inline function _I_ClampPresentScale(scale)

Keeps the physical presentation scale inside the supported range.

ParameterTypeDefaultDescription
scaledynamic—Scale value supplied to `_I_ClampPresentScale`.

View source

_I_COLORONCOLOR

const _I_COLORONCOLOR = 3

Defines the Doom palette selection for i coloroncolor.

View source

_I_ComposeHDWipeFrame

function _I_ComposeHDWipeFrame()

Composes one RGBA melt frame from the start/end captures and each column group's vertical frontier.

View source

_i_consoleTildePrev

_i_consoleTildePrev

Tracks whether i console tilde prev is active in the i video subsystem.

View source

_I_CreateWindow

function _I_CreateWindow()

Creates, sizes, activates, and acquires a device context for the fullscreen or windowed native game window.

View source

_i_cursorHidden

_i_cursorHidden

Tracks whether i cursor hidden is active in the i video subsystem.

View source

_I_DIB_RGB_COLORS

const _I_DIB_RGB_COLORS = 0

Defines the Doom palette selection for i dib rgb colors.

View source

_I_DrawGLOverlayFrame

function _I_DrawGLOverlayFrame()

Composes a visible status bar, marked logical UI, and prepared HD patches, then submits the masked overlay to OpenGL.

View source

_I_DrawLoadingIndicator

function _I_DrawLoadingIndicator()

Renders a small animated loading marker in the lower-right corner of the software framebuffer.

View source

_I_EnsureGLOOverlay

function _I_EnsureGLOOverlay()

Ensures the OpenGL UI overlay color and alpha-mask buffers match the physical presentation dimensions.

View source

_I_EnsureScreenshotDir

function _I_EnsureScreenshotDir()

Creates the screenshot directory once and caches success so periodic captures avoid repeated filesystem work.

View source

_i_forceSoftwarePresent

_i_forceSoftwarePresent

Tracks whether i force software present is active in the i video subsystem.

View source

_i_fpsFrameCount

_i_fpsFrameCount

Tracks the mutable i fps frame count value used by the i video subsystem.

View source

_I_FpsTitle

inline function _I_FpsTitle()

Formats the base window caption with the most recently measured non-negative FPS value.

View source

_i_fpsValue

_i_fpsValue

Tracks the mutable i fps value value used by the i video subsystem.

View source

_i_fpsWindowStart

_i_fpsWindowStart

Tracks the mutable i fps window start value used by the i video subsystem.

View source

_i_fullscreen

_i_fullscreen

Tracks whether i fullscreen is active in the i video subsystem.

View source

_i_glOverlayBuffer

_i_glOverlayBuffer

Holds the optional i gl overlay buffer resource used by the i video subsystem.

View source

_I_GLOverlayHighresPatches

function _I_GLOverlayHighresPatches()

Merges prepared native-resolution patch pixels and their mask into the OpenGL overlay buffers.

View source

_I_GLOverlayLogicalMask

function _I_GLOverlayLogicalMask(src, mask)

Expands only mask-selected logical indexed pixels into the OpenGL overlay buffers.

ParameterTypeDefaultDescription
srcdynamic—Src value supplied to `_I_GLOverlayLogicalMask`.
maskdynamic—Mask value supplied to `_I_GLOverlayLogicalMask`.

View source

_I_GLOverlayLogicalPixel

function _I_GLOverlayLogicalPixel(src, sx, sy)

Expands one logical indexed pixel into its physical-scale overlay block and marks those destination pixels opaque.

ParameterTypeDefaultDescription
srcdynamic—Src value supplied to `_I_GLOverlayLogicalPixel`.
sxdynamic—Horizontal coordinate or vector component represented by sx.
sydynamic—Vertical coordinate or vector component represented by sy.

View source

_I_GLOverlayLogicalRect

function _I_GLOverlayLogicalRect(src, x, y, w, h)

Clips and expands a logical indexed rectangle into the OpenGL overlay buffers.

ParameterTypeDefaultDescription
srcdynamic—Src value supplied to `_I_GLOverlayLogicalRect`.
xdynamic—Horizontal map- or screen-space coordinate.
ydynamic—Vertical map- or screen-space coordinate.
wdynamic—W value supplied to `_I_GLOverlayLogicalRect`.
hdynamic—H value supplied to `_I_GLOverlayLogicalRect`.

View source

_i_glOverlayMask

_i_glOverlayMask

Holds the optional i gl overlay mask resource used by the i video subsystem.

View source

_I_GWL_STYLE

const _I_GWL_STYLE = -16

Defines i gwl style for the i video subsystem.

View source

_I_HandleRendererHotkeyMessage

function _I_HandleRendererHotkeyMessage(msg, wparam, lparam)

Handles Alt+G from the Win32 message stream, independent of foreground polling.

ParameterTypeDefaultDescription
msgdynamic—Msg value supplied to `_I_HandleRendererHotkeyMessage`.
wparamdynamic—Wparam value supplied to `_I_HandleRendererHotkeyMessage`.
lparamdynamic—Lparam value supplied to `_I_HandleRendererHotkeyMessage`.

View source

_i_hdc

_i_hdc

Holds the optional i hdc resource used by the i video subsystem.

View source

_I_HDWIPE_Rand

inline function _I_HDWIPE_Rand()

Produces deterministic 15-bit randomness for high-resolution melt-column delays.

View source

_i_hdWipeActive

_i_hdWipeActive

Tracks whether i hd wipe active is active in the i video subsystem.

View source

_i_hdWipeEnd

_i_hdWipeEnd

Holds the optional i hd wipe end resource used by the i video subsystem.

View source

_i_hdWipeFrame

_i_hdWipeFrame

Holds the optional i hd wipe frame resource used by the i video subsystem.

View source

_i_hdWipeSeed

_i_hdWipeSeed

Tracks the mutable i hd wipe seed value used by the i video subsystem.

View source

_i_hdWipeStart

_i_hdWipeStart

Holds the optional i hd wipe start resource used by the i video subsystem.

View source

_i_hdWipeY

_i_hdWipeY

Stores the i hd wipe y collection used by the i video subsystem.

View source

_i_hwnd

_i_hwnd

Holds the optional i hwnd resource used by the i video subsystem.

View source

_I_IDiv

inline function _I_IDiv(a, b)

Coerces numeric operands and returns their signed quotient truncated toward zero, using zero for a zero divisor.

ParameterTypeDefaultDescription
adynamic—First input operand.
bdynamic—Second input operand.

View source

_I_IndexedToRGBA

function _I_IndexedToRGBA(src, dst, width, height)

Expands validated indexed pixels through the active RGB palette into opaque RGBA output.

ParameterTypeDefaultDescription
srcdynamic—Src value supplied to `_I_IndexedToRGBA`.
dstdynamic—Dst value supplied to `_I_IndexedToRGBA`.
widthdynamic—Width of the target in pixels or map units.
heightdynamic—Height of the target in pixels or map units.

View source

_I_InitBitmapInfo

function _I_InitBitmapInfo()

Builds a top-down 8-bit BITMAPINFO for the physical presentation size and forwards its initial palette to OpenGL.

View source

_I_InitDefaultPalette

function _I_InitDefaultPalette()

Seeds the 256-entry RGB palette with a grayscale ramp before PLAYPAL is applied.

View source

_i_inited

_i_inited

Tracks whether i inited is active in the i video subsystem.

View source

_I_InitKeyMap

function _I_InitKeyMap()

Lazily builds the complete navigation, function, digit, numpad, punctuation, and lowercase-letter key map.

View source

_I_InitPresentMetrics

function _I_InitPresentMetrics()

Initializes physical framebuffer dimensions used by GDI presentation.

View source

_I_IntToString

function _I_IntToString(v)

Formats an integer as decimal text without relying on platform string conversion.

ParameterTypeDefaultDescription
vdynamic—Value consumed by the operation.

View source

_i_keyDoom

_i_keyDoom

Stores the i key doom collection used by the i video subsystem.

View source

_i_keyPrev

_i_keyPrev

Stores the i key prev collection used by the i video subsystem.

View source

_i_keyVk

_i_keyVk

Stores the i key vk collection used by the i video subsystem.

View source

_i_lastPresentFrame

_i_lastPresentFrame

Holds the optional i last present frame resource used by the i video subsystem.

View source

_i_lastPresentRGBA

_i_lastPresentRGBA

Holds the optional i last present rgba resource used by the i video subsystem.

View source

_i_loadingAnimPhase

_i_loadingAnimPhase

Tracks the mutable i loading anim phase value used by the i video subsystem.

View source

_i_loadingStatusText

_i_loadingStatusText

Stores the mutable i loading status text text used by the i video subsystem.

View source

_I_MaybeAutoScreenshot

function _I_MaybeAutoScreenshot()

Writes the current presentation frame only when the one-second automatic capture deadline has elapsed.

View source

_I_MaybeAutoScreenshotFromFrame

function _I_MaybeAutoScreenshotFromFrame(src, width, height)

Writes a prepared frame when the auto screenshot interval has elapsed.

ParameterTypeDefaultDescription
srcdynamic—Src value supplied to `_I_MaybeAutoScreenshotFromFrame`.
widthdynamic—Width of the target in pixels or map units.
heightdynamic—Height of the target in pixels or map units.

View source

_I_MouseButtonsNow

inline function _I_MouseButtonsNow()

Packs the current left, right, and middle Win32 button states into Doom's three-bit mouse mask.

View source

_i_mouseInited

_i_mouseInited

Tracks whether i mouse inited is active in the i video subsystem.

View source

_i_mousePoint

_i_mousePoint

Tracks the mutable i mouse point value used by the i video subsystem.

View source

_i_mousePrevButtons

_i_mousePrevButtons

Tracks the mutable i mouse prev buttons value used by the i video subsystem.

View source

_i_mousePrevX

_i_mousePrevX

Tracks the mutable i mouse prev x value used by the i video subsystem.

View source

_i_mousePrevY

_i_mousePrevY

Tracks the mutable i mouse prev y value used by the i video subsystem.

View source

_i_msg

_i_msg

Tracks the mutable i msg value used by the i video subsystem.

View source

_i_overlayBase

_i_overlayBase

Holds the optional i overlay base resource used by the i video subsystem.

View source

_I_OverlayChangedLogicalPixels

function _I_OverlayChangedLogicalPixels(scaled, cur, base)

Copies only logical pixels changed after the world pass, preserving high-res world rendering.

ParameterTypeDefaultDescription
scaleddynamic—Scaled value supplied to `_I_OverlayChangedLogicalPixels`.
curdynamic—Cur value supplied to `_I_OverlayChangedLogicalPixels`.
basedynamic—Base value supplied to `_I_OverlayChangedLogicalPixels`.

View source

_I_OverlayChangedLogicalPixelsNearest

function _I_OverlayChangedLogicalPixelsNearest(cur, base)

Copies changed logical pixels directly into the high-resolution frame.

ParameterTypeDefaultDescription
curdynamic—Cur value supplied to `_I_OverlayChangedLogicalPixelsNearest`.
basedynamic—Base value supplied to `_I_OverlayChangedLogicalPixelsNearest`.

View source

_I_OverlayLogicalRectNearest

function _I_OverlayLogicalRectNearest(src, x, y, w, h)

Copies a logical-screen rectangle into the high-resolution frame with cheap nearest scaling.

ParameterTypeDefaultDescription
srcdynamic—Src value supplied to `_I_OverlayLogicalRectNearest`.
xdynamic—Horizontal map- or screen-space coordinate.
ydynamic—Vertical map- or screen-space coordinate.
wdynamic—W value supplied to `_I_OverlayLogicalRectNearest`.
hdynamic—H value supplied to `_I_OverlayLogicalRectNearest`.

View source

_I_OverlayMarkedLogicalPixels

function _I_OverlayMarkedLogicalPixels(scaled, mask)

Copies logical pixels marked by V_DrawPatch/V_DrawBlock into the high-resolution frame.

ParameterTypeDefaultDescription
scaleddynamic—Scaled value supplied to `_I_OverlayMarkedLogicalPixels`.
maskdynamic—Mask value supplied to `_I_OverlayMarkedLogicalPixels`.

View source

_I_OverlayMarkedLogicalPixelsNearest

function _I_OverlayMarkedLogicalPixelsNearest(src, mask)

Copies UI-marked logical pixels directly into the high-resolution frame.

ParameterTypeDefaultDescription
srcdynamic—Src value supplied to `_I_OverlayMarkedLogicalPixelsNearest`.
maskdynamic—Mask value supplied to `_I_OverlayMarkedLogicalPixelsNearest`.

View source

_I_OverlayPreparedHighresPatches

function _I_OverlayPreparedHighresPatches()

Copies pre-upscaled patch pixels prepared by V_DrawPatch into the presentation frame.

View source

_i_overlayRowBuffer

_i_overlayRowBuffer

Holds the optional i overlay row buffer resource used by the i video subsystem.

View source

_I_OverlayScaledRect

function _I_OverlayScaledRect(scaled, x, y, w, h)

Copies a scaled logical-screen rectangle into the high-resolution frame.

ParameterTypeDefaultDescription
scaleddynamic—Scaled value supplied to `_I_OverlayScaledRect`.
xdynamic—Horizontal map- or screen-space coordinate.
ydynamic—Vertical map- or screen-space coordinate.
wdynamic—W value supplied to `_I_OverlayScaledRect`.
hdynamic—H value supplied to `_I_OverlayScaledRect`.

View source

_i_ownsWindow

_i_ownsWindow

Tracks whether i owns window is active in the i video subsystem.

View source

_i_paletteRgb

_i_paletteRgb

Tracks the mutable i palette rgb value used by the i video subsystem.

View source

_I_PM_REMOVE

const _I_PM_REMOVE = 1

Defines i pm remove for the i video subsystem.

View source

_I_PollKeyboard

function _I_PollKeyboard()

Polls mapped virtual keys while focused, posts edge-triggered Doom events, and handles the Alt+G renderer toggle.

View source

_I_PollMouse

function _I_PollMouse()

Converts focused cursor deltas and button changes into Doom mouse events while synchronizing cursor visibility.

View source

_i_presentBuffer

_i_presentBuffer

Holds the optional i present buffer resource used by the i video subsystem.

View source

_i_presentHeight

_i_presentHeight

Tracks the mutable i present height value used by the i video subsystem.

View source

_I_PresentIndexedFrameGL

function _I_PresentIndexedFrameGL(src)

Presents an indexed frame whose dimensions match the physical presentation buffer.

ParameterTypeDefaultDescription
srcdynamic—Src value supplied to `_I_PresentIndexedFrameGL`.

View source

_I_PresentIndexedFrameGLSized

function _I_PresentIndexedFrameGLSized(src, srcW, srcH)

Palette-expands an arbitrary indexed frame, resizes the GL viewport, submits it as RGBA, and swaps buffers.

ParameterTypeDefaultDescription
srcdynamic—Src value supplied to `_I_PresentIndexedFrameGLSized`.
srcWdynamic—Src w value supplied to `_I_PresentIndexedFrameGLSized`.
srcHdynamic—Src h value supplied to `_I_PresentIndexedFrameGLSized`.

View source

_i_presentScale

_i_presentScale

Tracks the mutable i present scale value used by the i video subsystem.

View source

_i_presentWidth

_i_presentWidth

Tracks the mutable i present width value used by the i video subsystem.

View source

_I_PumpMessages

function _I_PumpMessages()

Drains queued Win32 messages, handles Alt+G directly, and quits if the stored game window was destroyed.

View source

_I_ReadS32

inline function _I_ReadS32(buf, off)

Decodes a signed 32-bit little-endian field from a Win32 structure buffer.

ParameterTypeDefaultDescription
bufdynamic—Buf value supplied to `_I_ReadS32`.
offdynamic—Zero-based byte or element offset.

View source

_I_ReadU32

inline function _I_ReadU32(buf, off)

Decodes an unsigned 32-bit little-endian field from a Win32 structure buffer.

ParameterTypeDefaultDescription
bufdynamic—Buf value supplied to `_I_ReadU32`.
offdynamic—Zero-based byte or element offset.

View source

_i_rect

_i_rect

Tracks the mutable i rect value used by the i video subsystem.

View source

_I_ReleaseKeyboard

function _I_ReleaseKeyboard(postEvents)

Clears all remembered key-down edges and optionally posts matching Doom key-up events on focus loss.

ParameterTypeDefaultDescription
postEventsdynamic—Post events value supplied to `_I_ReleaseKeyboard`.

View source

_I_SaveLastPresentFrame

function _I_SaveLastPresentFrame(src)

Caches the latest full-size indexed frame and its palette-expanded RGBA copy for capture and wipe fallback.

ParameterTypeDefaultDescription
srcdynamic—Src value supplied to `_I_SaveLastPresentFrame`.

View source

_I_SaveLastRGBAFrameSized

function _I_SaveLastRGBAFrameSized(src, width, height)

Converts an indexed frame of arbitrary dimensions for OpenGL presentation.

ParameterTypeDefaultDescription
srcdynamic—Src value supplied to `_I_SaveLastRGBAFrameSized`.
widthdynamic—Width of the target in pixels or map units.
heightdynamic—Height of the target in pixels or map units.

View source

_I_SCREENSHOT_INTERVAL_MS

const _I_SCREENSHOT_INTERVAL_MS = 1000

Defines i screenshot interval ms for the i video subsystem.

View source

_i_screenshotDir

_i_screenshotDir

Stores the mutable i screenshot dir text used by the i video subsystem.

View source

_i_screenshotDirReady

_i_screenshotDirReady

Tracks whether i screenshot dir ready is active in the i video subsystem.

View source

_i_screenshotEnabled

_i_screenshotEnabled

Tracks whether i screenshot enabled is active in the i video subsystem.

View source

_i_screenshotIndex

_i_screenshotIndex

Tracks the mutable i screenshot index value used by the i video subsystem.

View source

_i_screenshotNextTick

_i_screenshotNextTick

Tracks the mutable i screenshot next tick value used by the i video subsystem.

View source

_i_screenshotWriteError

_i_screenshotWriteError

Tracks whether i screenshot write error is active in the i video subsystem.

View source

_I_SetCursorVisible

function _I_SetCursorVisible(visible)

Keeps cursor visibility in sync while game window is active.

ParameterTypeDefaultDescription
visibledynamic—Visible value supplied to `_I_SetCursorVisible`.

View source

_I_SetWindowTitle

inline function _I_SetWindowTitle(title)

Applies a changed caption once and clears STATIC-class repaint requests caused by title updates.

ParameterTypeDefaultDescription
titledynamic—Title value supplied to `_I_SetWindowTitle`.

View source

_I_ShouldAutoScreenshot

function _I_ShouldAutoScreenshot()

Returns true when the next auto screenshot interval has elapsed.

View source

_I_SM_CXSCREEN

const _I_SM_CXSCREEN = 0

Defines i sm cxscreen for the i video subsystem.

View source

_I_SM_CYSCREEN

const _I_SM_CYSCREEN = 1

Defines i sm cyscreen for the i video subsystem.

View source

_I_SRCCOPY

const _I_SRCCOPY = 13369376

Defines i srccopy for the i video subsystem.

View source

_I_SS_OWNERDRAW

const _I_SS_OWNERDRAW = 13

Defines i ss ownerdraw for the i video subsystem.

View source

_I_STATUSBAR_HEIGHT

const _I_STATUSBAR_HEIGHT = 32

Defines i statusbar height for the i video subsystem.

View source

_I_StatusOverlayY

inline function _I_StatusOverlayY()

Returns the logical start row of a visible status bar, or screen height when fullscreen rendering must remain unobscured.

View source

_I_SW_MAXIMIZE

const _I_SW_MAXIMIZE = 3

Defines the maximum i sw maximize accepted by the i video subsystem.

View source

_I_SW_SHOW

const _I_SW_SHOW = 5

Defines i sw show for the i video subsystem.

View source

_I_SWP_FRAMECHANGED

const _I_SWP_FRAMECHANGED = 32

Defines i swp framechanged for the i video subsystem.

View source

_I_SWP_SHOWWINDOW

const _I_SWP_SHOWWINDOW = 64

Defines i swp showwindow for the i video subsystem.

View source

_i_titleBase

_i_titleBase

Stores the mutable i title base text used by the i video subsystem.

View source

_i_titleLast

_i_titleLast

Stores the mutable i title last text used by the i video subsystem.

View source

_I_ToggleRendererHotkey

function _I_ToggleRendererHotkey()

Switches renderer state and invalidates cached high-resolution overlays.

View source

_I_ToIntOr

function _I_ToIntOr(v, fallback)

Coerces numeric values to truncation-toward-zero integers and returns fallback on failure in `_I_ToIntOr`

ParameterTypeDefaultDescription
vdynamic—Value consumed by the operation.
fallbackdynamic—Value returned when the requested conversion or lookup is unavailable.

View source

_I_UpdateBitmapColorTable

function _I_UpdateBitmapColorTable()

Converts the active RGB palette into the BGR0 color table embedded in the 8-bit BITMAPINFO.

View source

_I_UpdateWindowTitle

function _I_UpdateWindowTitle()

Counts presented frames over one-second windows and updates the caption unless a loading status owns it.

View source

_I_VK_LBUTTON

const _I_VK_LBUTTON = 1

Defines i vk lbutton for the i video subsystem.

View source

_I_VK_MBUTTON

const _I_VK_MBUTTON = 4

Defines i vk mbutton for the i video subsystem.

View source

_I_VK_RBUTTON

const _I_VK_RBUTTON = 2

Defines i vk rbutton for the i video subsystem.

View source

_I_WINDOW_SCALE

const _I_WINDOW_SCALE = 2

Defines i window scale for the i video subsystem.

View source

_i_windowFailed

_i_windowFailed

Tracks whether i window failed is active in the i video subsystem.

View source

_I_WM_CLOSE

const _I_WM_CLOSE = 16

Defines i wm close for the i video subsystem.

View source

_I_WM_DESTROY

const _I_WM_DESTROY = 2

Defines i wm destroy for the i video subsystem.

View source

_I_WM_ERASEBKGND

const _I_WM_ERASEBKGND = 20

Defines i wm erasebkgnd for the i video subsystem.

View source

_I_WM_KEYDOWN

const _I_WM_KEYDOWN = 256

Defines i wm keydown for the i video subsystem.

View source

_I_WM_KEYUP

const _I_WM_KEYUP = 257

Defines i wm keyup for the i video subsystem.

View source

_I_WM_NCDESTROY

const _I_WM_NCDESTROY = 130

Defines i wm ncdestroy for the i video subsystem.

View source

_I_WM_PAINT

const _I_WM_PAINT = 15

Defines i wm paint for the i video subsystem.

View source

_I_WM_QUIT

const _I_WM_QUIT = 18

Defines i wm quit for the i video subsystem.

View source

_I_WM_SYSKEYDOWN

const _I_WM_SYSKEYDOWN = 260

Defines i wm syskeydown for the i video subsystem.

View source

_I_WM_SYSKEYUP

const _I_WM_SYSKEYUP = 261

Defines i wm syskeyup for the i video subsystem.

View source

_I_WriteAutoScreenshot

function _I_WriteAutoScreenshot()

Captures the current presentation selection and delegates indexed BMP creation and numbered file output.

View source

_I_WriteAutoScreenshotFromFrame

function _I_WriteAutoScreenshotFromFrame(src, width, height)

Writes an auto screenshot from a prepared indexed frame.

ParameterTypeDefaultDescription
srcdynamic—Src value supplied to `_I_WriteAutoScreenshotFromFrame`.
widthdynamic—Width of the target in pixels or map units.
heightdynamic—Height of the target in pixels or map units.

View source

_I_WriteU16

inline function _I_WriteU16(buf, off, value)

Encodes the low 16 bits of a value into a little-endian Win32 structure buffer.

ParameterTypeDefaultDescription
bufdynamic—Buf value supplied to `_I_WriteU16`.
offdynamic—Zero-based byte or element offset.
valuedynamic—Value consumed by the operation.

View source

_I_WriteU32

inline function _I_WriteU32(buf, off, value)

Encodes the low 32 bits of a value into a little-endian Win32 structure buffer.

ParameterTypeDefaultDescription
bufdynamic—Buf value supplied to `_I_WriteU32`.
offdynamic—Zero-based byte or element offset.
valuedynamic—Value consumed by the operation.

View source

_I_WS_OVERLAPPEDWINDOW

const _I_WS_OVERLAPPEDWINDOW = 13565952

Defines i ws overlappedwindow for the i video subsystem.

View source

_I_WS_POPUP

const _I_WS_POPUP = -2147483648

Defines i ws popup for the i video subsystem.

View source

_I_WS_VISIBLE

const _I_WS_VISIBLE = 268435456

Defines i ws visible for the i video subsystem.

View source

AdjustWindowRect

extern function AdjustWindowRect(rect as bytes, style as u32, hasMenu as bool) from "user32.dll" symbol "AdjustWindowRect" returns bool

Expands a desired client rectangle to include the selected non-client window borders.

ParameterTypeDefaultDescription
rectbytes—`bytes` value supplied as rect to `AdjustWindowRect`.
styleu32—`u32` value supplied as style to `AdjustWindowRect`.
hasMenubool—Whether has menu holds.

Returns: Result returned by the native `AdjustWindowRect` binding as `bool`.

View source

BringWindowToTop

extern function BringWindowToTop(hwnd as ptr) from "user32.dll" symbol "BringWindowToTop" returns bool

Raises the game window above other top-level windows during activation.

ParameterTypeDefaultDescription
hwndptr—`ptr` value supplied as hwnd to `BringWindowToTop`.

Returns: Result returned by the native `BringWindowToTop` binding as `bool`.

View source

CreateDirectoryW

extern function CreateDirectoryW(path as wstr, security as ptr) from "kernel32.dll" symbol "CreateDirectoryW" returns bool

Creates the auto-screenshot output directory when it does not yet exist.

ParameterTypeDefaultDescription
pathwstr—Filesystem path to process.
securityptr—Optional native security-attributes pointer.

Returns: The resulting auto-screenshot output directory when it does not yet exist.

View source

createnullcursor

function createnullcursor()

Preserves the legacy cursor-construction hook; cursor hiding is handled through ShowCursor instead.

View source

CreateWindowExW

extern function CreateWindowExW(exStyle as u32, className as wstr, windowName as wstr, style as u32, x as int, y as int, width as int, height as int, parent as ptr, menu as ptr, instance as ptr, param as ptr) from "user32.dll" symbol "CreateWindowExW" returns ptr

Creates the native game window with the requested client style, placement, and dimensions.

ParameterTypeDefaultDescription
exStyleu32—`u32` value supplied as ex style to `CreateWindowExW`.
classNamewstr—`wstr` value supplied as class name to `CreateWindowExW`.
windowNamewstr—`wstr` value supplied as window name to `CreateWindowExW`.
styleu32—`u32` value supplied as style to `CreateWindowExW`.
xint—Horizontal map- or screen-space coordinate.
yint—Vertical map- or screen-space coordinate.
widthint—Width of the target in pixels or map units.
heightint—Height of the target in pixels or map units.
parentptr—`ptr` value supplied as parent to `CreateWindowExW`.
menuptr—`ptr` value supplied as menu to `CreateWindowExW`.
instanceptr—`ptr` value supplied as instance to `CreateWindowExW`.
paramptr—`ptr` value supplied as param to `CreateWindowExW`.

Returns: The resulting native game window with the requested client style, placement, and dimensions.

View source

DestroyWindow

extern function DestroyWindow(hwnd as ptr) from "user32.dll" symbol "DestroyWindow" returns bool

Destroys a game window owned by this video backend.

ParameterTypeDefaultDescription
hwndptr—`ptr` value supplied as hwnd to `DestroyWindow`.

Returns: Result returned by the native `DestroyWindow` binding as `bool`.

View source

DispatchMessageW

extern function DispatchMessageW(msg as bytes) from "user32.dll" symbol "DispatchMessageW" returns ptr

Dispatches a retrieved Win32 message to the target window procedure.

ParameterTypeDefaultDescription
msgbytes—`bytes` value supplied as msg to `DispatchMessageW`.

Returns: Result returned by the native `DispatchMessageW` binding as `ptr`.

View source

Expand4

function Expand4(src, dst, count)

Retains the legacy expansion entry point as a bounded raw byte copy into the destination buffer.

ParameterTypeDefaultDescription
srcdynamic—Src value supplied to `Expand4`.
dstdynamic—Dst value supplied to `Expand4`.
countdynamic—Number of elements or iterations to process.

View source

GetAsyncKeyState

extern function GetAsyncKeyState(vkey as int) from "user32.dll" symbol "GetAsyncKeyState" returns int

Polls a virtual key's current high-bit down state for edge-based Doom input events.

ParameterTypeDefaultDescription
vkeyint—Native virtual-key code to translate.

Returns: Result returned by the native `GetAsyncKeyState` binding as `int`.

View source

GetClientRect

extern function GetClientRect(hwnd as ptr, rect as bytes) from "user32.dll" symbol "GetClientRect" returns bool

Reads the current drawable client dimensions for OpenGL resize or GDI scaling.

ParameterTypeDefaultDescription
hwndptr—`ptr` value supplied as hwnd to `GetClientRect`.
rectbytes—`bytes` value supplied as rect to `GetClientRect`.

Returns: The requested the current drawable client dimensions for OpenGL resize or GDI scaling.

View source

GetConsoleWindow

extern function GetConsoleWindow() from "kernel32.dll" symbol "GetConsoleWindow" returns ptr

Retrieves the process console window so startup can reuse or coordinate native window state.

Returns: Result returned by the native `GetConsoleWindow` binding as `ptr`.

View source

GetCursorPos

extern function GetCursorPos(point as bytes) from "user32.dll" symbol "GetCursorPos" returns bool

Reads screen-space cursor coordinates used to derive relative mouse movement.

ParameterTypeDefaultDescription
pointbytes—`bytes` value supplied as point to `GetCursorPos`.

Returns: The requested screen-space cursor coordinates used to derive relative mouse movement.

View source

GetDC

extern function GetDC(hwnd as ptr) from "user32.dll" symbol "GetDC" returns ptr

Acquires the client device context used for software StretchDIBits presentation.

ParameterTypeDefaultDescription
hwndptr—`ptr` value supplied as hwnd to `GetDC`.

Returns: Result returned by the native `GetDC` binding as `ptr`.

View source

GetForegroundWindow

extern function GetForegroundWindow() from "user32.dll" symbol "GetForegroundWindow" returns ptr

Identifies the foreground window so input is released when the game loses focus.

Returns: Result returned by the native `GetForegroundWindow` binding as `ptr`.

View source

GetSystemMetrics

extern function GetSystemMetrics(index as int) from "user32.dll" symbol "GetSystemMetrics" returns int

Reads desktop dimensions used to size the borderless fullscreen window.

ParameterTypeDefaultDescription
indexint—Zero-based element or table index.

Returns: The requested desktop dimensions used to size the borderless fullscreen window.

View source

GetWindowLongPtrW

extern function GetWindowLongPtrW(hwnd as ptr, index as int) from "user32.dll" symbol "GetWindowLongPtrW" returns ptr

Reads native window style data needed when updating presentation mode.

ParameterTypeDefaultDescription
hwndptr—`ptr` value supplied as hwnd to `GetWindowLongPtrW`.
indexint—Zero-based element or table index.

Returns: The requested native window style data needed when updating presentation mode.

View source

grabsharedmemory

function grabsharedmemory(size)

Preserves the legacy shared-framebuffer allocation hook; this backend owns byte buffers directly and returns void.

ParameterTypeDefaultDescription
sizedynamic—Requested size in bytes or elements.

View source

I_BeginHDWipe

function I_BeginHDWipe()

Captures the current high-resolution start frame from OpenGL, the last RGBA frame, or a nearest logical fallback.

View source

I_CaptureGLFrameToScreen

function I_CaptureGLFrameToScreen()

Composes the current OpenGL world and UI, then reads a logical indexed capture into screen zero.

View source

I_CaptureLogicalOverlayBase

function I_CaptureLogicalOverlayBase()

Captures the logical framebuffer before late menu/message drawing.

View source

I_FinishUpdate

function I_FinishUpdate()

Presents one completed frame through native OpenGL, indexed GL fallback, or GDI and performs FPS/screenshot bookkeeping.

View source

I_GetEvent

function I_GetEvent()

Pumps native messages and posts all currently observed keyboard and mouse input changes.

View source

I_GetFPS

function I_GetFPS()

Exposes the last completed one-second presentation sample to in-game UI overlays.

View source

I_HDScreenWipe

function I_HDScreenWipe(tics)

Advances, draws, and swaps the high-resolution melt transition, returning true after every column reaches the bottom.

ParameterTypeDefaultDescription
ticsdynamic—Duration measured in Doom game tics.

View source

I_InitGraphics

function I_InitGraphics()

Allocates video/input buffers, parses display and screenshot options, creates the window, and initializes presentation state.

View source

I_LoadingPulse

function I_LoadingPulse()

Pumps window/audio updates and draws an animated loading marker while heavy loading code runs.

View source

I_PollInput

function I_PollInput()

Pumps native messages and posts current keyboard and mouse edge/motion events to Doom.

View source

I_PrepareHDWipeEnd

function I_PrepareHDWipeEnd()

Captures the destination frame and initializes correlated delayed melt positions for two-logical-pixel column groups.

View source

I_ReadScreen

function I_ReadScreen(scr)

Copies the complete 320x200 logical framebuffer from screen zero into a caller-provided capture buffer.

ParameterTypeDefaultDescription
scrdynamic—Scr value supplied to `I_ReadScreen`.

View source

I_SetForceSoftwarePresent

function I_SetForceSoftwarePresent(v)

Forces the next presentation path to use a nearest-scaled logical framebuffer instead of native OpenGL world output.

ParameterTypeDefaultDescription
vdynamic—Value consumed by the operation.

View source

I_SetLoadingStatus

function I_SetLoadingStatus(text)

Sets or clears loading text in the window caption, resets animation when cleared, and pumps messages immediately.

ParameterTypeDefaultDescription
textdynamic—Text to process.

View source

I_SetPalette

function I_SetPalette(palette)

Applies the selected gamma table to a 256-color palette and updates both GDI and OpenGL palette consumers.

ParameterTypeDefaultDescription
palettedynamic—Palette value supplied to `I_SetPalette`.

View source

I_ShutdownGraphics

function I_ShutdownGraphics()

Restores the cursor, shuts down OpenGL, releases the device context, and destroys the owned native window.

View source

I_StartFrame

function I_StartFrame()

Services native window messages at the start of a rendered frame.

View source

I_StartTic

function I_StartTic()

Polls and posts platform input events at the start of a simulation tic.

View source

I_UpdateNoBlit

function I_UpdateNoBlit()

Services the Win32 message queue without presenting or modifying a framebuffer.

View source

InitExpand

function InitExpand()

Preserves the legacy indexed expansion initializer; physical scaling is performed by current presentation paths.

View source

InitExpand2

function InitExpand2()

Preserves the second legacy expansion initializer; no precomputed expansion tables are required.

View source

IsWindow

extern function IsWindow(hwnd as ptr) from "user32.dll" symbol "IsWindow" returns bool

Validates that the stored native handle still names a live window.

ParameterTypeDefaultDescription
hwndptr—`ptr` value supplied as hwnd to `IsWindow`.

Returns: Result returned by the native `IsWindow` binding as `bool`.

View source

PeekMessageW

extern function PeekMessageW(msg as bytes, hwnd as ptr, minMsg as u32, maxMsg as u32, removeMsg as u32) from "user32.dll" symbol "PeekMessageW" returns bool

Retrieves and optionally removes queued Win32 messages without blocking the game loop.

ParameterTypeDefaultDescription
msgbytes—`bytes` value supplied as msg to `PeekMessageW`.
hwndptr—`ptr` value supplied as hwnd to `PeekMessageW`.
minMsgu32—`u32` value supplied as min msg to `PeekMessageW`.
maxMsgu32—`u32` value supplied as max msg to `PeekMessageW`.
removeMsgu32—`u32` value supplied as remove msg to `PeekMessageW`.

Returns: Result returned by the native `PeekMessageW` binding as `bool`.

View source

ReleaseDC

extern function ReleaseDC(hwnd as ptr, hdc as ptr) from "user32.dll" symbol "ReleaseDC" returns int

Releases a client device context previously acquired for software presentation.

ParameterTypeDefaultDescription
hwndptr—`ptr` value supplied as hwnd to `ReleaseDC`.
hdcptr—`ptr` value supplied as hdc to `ReleaseDC`.

Returns: Result returned by the native `ReleaseDC` binding as `int`.

View source

SetActiveWindow

extern function SetActiveWindow(hwnd as ptr) from "user32.dll" symbol "SetActiveWindow" returns ptr

Activates the game window within the current input thread.

ParameterTypeDefaultDescription
hwndptr—`ptr` value supplied as hwnd to `SetActiveWindow`.

Returns: Result returned by the native `SetActiveWindow` binding as `ptr`.

View source

SetForegroundWindow

extern function SetForegroundWindow(hwnd as ptr) from "user32.dll" symbol "SetForegroundWindow" returns bool

Requests foreground keyboard focus for the newly created game window.

ParameterTypeDefaultDescription
hwndptr—`ptr` value supplied as hwnd to `SetForegroundWindow`.

Returns: Result returned by the native `SetForegroundWindow` binding as `bool`.

View source

SetStretchBltMode

extern function SetStretchBltMode(hdc as ptr, mode as int) from "gdi32.dll" symbol "SetStretchBltMode" returns int

Selects COLORONCOLOR scaling for crisp software framebuffer presentation.

ParameterTypeDefaultDescription
hdcptr—`ptr` value supplied as hdc to `SetStretchBltMode`.
modeint—`int` value supplied as mode to `SetStretchBltMode`.

Returns: Result returned by the native `SetStretchBltMode` binding as `int`.

View source

SetWindowLongPtrW

extern function SetWindowLongPtrW(hwnd as ptr, index as int, newLong as ptr) from "user32.dll" symbol "SetWindowLongPtrW" returns ptr

Replaces native window style data when updating presentation mode.

ParameterTypeDefaultDescription
hwndptr—`ptr` value supplied as hwnd to `SetWindowLongPtrW`.
indexint—Zero-based element or table index.
newLongptr—`ptr` value supplied as new long to `SetWindowLongPtrW`.

Returns: Result returned by the native `SetWindowLongPtrW` binding as `ptr`.

View source

SetWindowPos

extern function SetWindowPos(hwnd as ptr, insertAfter as ptr, x as int, y as int, width as int, height as int, flags as u32) from "user32.dll" symbol "SetWindowPos" returns bool

Repositions or resizes the game window while changing fullscreen/windowed presentation.

ParameterTypeDefaultDescription
hwndptr—`ptr` value supplied as hwnd to `SetWindowPos`.
insertAfterptr—`ptr` value supplied as insert after to `SetWindowPos`.
xint—Horizontal map- or screen-space coordinate.
yint—Vertical map- or screen-space coordinate.
widthint—Width of the target in pixels or map units.
heightint—Height of the target in pixels or map units.
flagsu32—Bit flags that control the operation.

Returns: Result returned by the native `SetWindowPos` binding as `bool`.

View source

SetWindowTextW

extern function SetWindowTextW(hwnd as ptr, text as wstr) from "user32.dll" symbol "SetWindowTextW" returns bool

Updates the game window caption with loading or FPS status.

ParameterTypeDefaultDescription
hwndptr—`ptr` value supplied as hwnd to `SetWindowTextW`.
textwstr—Text to process.

Returns: Result returned by the native `SetWindowTextW` binding as `bool`.

View source

ShowCursor

extern function ShowCursor(show as bool) from "user32.dll" symbol "ShowCursor" returns int

Shows or hides the system cursor.

ParameterTypeDefaultDescription
showbool—`bool` value supplied as show to `ShowCursor`.

Returns: Result returned by the native `ShowCursor` binding as `int`.

View source

ShowWindow

extern function ShowWindow(hwnd as ptr, cmdShow as int) from "user32.dll" symbol "ShowWindow" returns bool

Applies the requested visibility state to the native game window.

ParameterTypeDefaultDescription
hwndptr—`ptr` value supplied as hwnd to `ShowWindow`.
cmdShowint—`int` value supplied as cmd show to `ShowWindow`.

Returns: Result returned by the native `ShowWindow` binding as `bool`.

View source

StretchDIBits

extern function StretchDIBits(hdc as ptr, xDest as int, yDest as int, destWidth as int, destHeight as int, xSrc as int, ySrc as int, srcWidth as int, srcHeight as int, bits as bytes, bmi as bytes, usage as u32, rop as u32) from "gdi32.dll" symbol "StretchDIBits" returns int

Scales and copies the indexed DIB presentation buffer into the window client area.

ParameterTypeDefaultDescription
hdcptr—`ptr` value supplied as hdc to `StretchDIBits`.
xDestint—`int` value supplied as x dest to `StretchDIBits`.
yDestint—`int` value supplied as y dest to `StretchDIBits`.
destWidthint—Width of dest width in pixels or map units.
destHeightint—Height of dest height in pixels or map units.
xSrcint—`int` value supplied as x src to `StretchDIBits`.
ySrcint—`int` value supplied as y src to `StretchDIBits`.
srcWidthint—Width of src width in pixels or map units.
srcHeightint—Height of src height in pixels or map units.
bitsbytes—`bytes` value supplied as bits to `StretchDIBits`.
bmibytes—`bytes` value supplied as bmi to `StretchDIBits`.
usageu32—`u32` value supplied as usage to `StretchDIBits`.
ropu32—`u32` value supplied as rop to `StretchDIBits`.

Returns: Result returned by the native `StretchDIBits` binding as `int`.

View source

TranslateMessage

extern function TranslateMessage(msg as bytes) from "user32.dll" symbol "TranslateMessage" returns bool

Generates character messages from a retrieved keyboard message before dispatch.

ParameterTypeDefaultDescription
msgbytes—`bytes` value supplied as msg to `TranslateMessage`.

Returns: Result returned by the native `TranslateMessage` binding as `bool`.

View source

UpdateWindow

extern function UpdateWindow(hwnd as ptr) from "user32.dll" symbol "UpdateWindow" returns bool

Forces pending client-area painting for a shown native window.

ParameterTypeDefaultDescription
hwndptr—`ptr` value supplied as hwnd to `UpdateWindow`.

Returns: Result returned by the native `UpdateWindow` binding as `bool`.

View source

UploadNewPalette

function UploadNewPalette(pal)

Compatibility entry point that applies a newly selected Doom palette through the active gamma-aware path.

ParameterTypeDefaultDescription
paldynamic—Pal value supplied to `UploadNewPalette`.

View source

ValidateRect

extern function ValidateRect(hwnd as ptr, rect as ptr) from "user32.dll" symbol "ValidateRect" returns bool

Clears pending client repaint requests after title updates on the built-in STATIC window class.

ParameterTypeDefaultDescription
hwndptr—`ptr` value supplied as hwnd to `ValidateRect`.
rectptr—`ptr` value supplied as rect to `ValidateRect`.

Returns: Result returned by the native `ValidateRect` binding as `bool`.

View source

xlatekey

function xlatekey(vk)

Translates a Win32 virtual key to its Doom code, with direct digit and lowercase-letter fallbacks.

ParameterTypeDefaultDescription
vkdynamic—Vk value supplied to `xlatekey`.

View source