Small World Engine API Reference - v0.76.20
    Preparing search index...

    Class DeviceCaps

    Centralized class for hardware and browser feature detection. Provides information about supported renderers, API features, and hardware limits.

    Index
    • get gpuModel(): string

      Returns the unmasked GPU model if available.

      Returns string

    • get gpuVendor(): string

      Returns the unmasked GPU vendor if available.

      Returns string

    • get networkInfo(): | {
          downlink: number;
          effectiveType: string;
          saveData: boolean;
      }
      | undefined

      Returns Network Information API data if the browser supports it (Chrome/Edge; absent on Firefox/Safari), or undefined otherwise.

      Returns { downlink: number; effectiveType: string; saveData: boolean } | undefined

    • Returns the spec-guaranteed minimum for limit -- the value every conformant device must support, regardless of what THIS device's getLimit() actually reports. Useful for code that needs to work correctly even on the lowest-common-denominator device, rather than just the one it happened to be tested on (a higher-than-guaranteed value on a dev machine or this project's headless test sandbox has repeatedly masked real budget-overrun bugs that only surfaced on stricter, spec-minimum hardware).

      Parameters

      Returns number

    • Initializes the feature detection. This is called automatically by the Engine, but can be called manually.

      Returns void

    • Returns true if the application is running on a mobile device (phone or tablet).

      Returns boolean

    • Updates hardware limits. Used by renderers to provide more precise values.

      Parameters

      • limits: {
            maxAnisotropy?: number;
            maxFragmentUniformVectors?: number;
            maxMsaaSamples?: number;
            maxTextureImageUnits?: number;
            maxTextureSize?: number;
            maxUniformBufferSize?: number;
            maxVertexUniformVectors?: number;
            webgpuMaxBindGroups?: number;
            webgpuMaxBindingsPerBindGroup?: number;
            webgpuMaxSampledTexturesPerStage?: number;
            webgpuMaxSamplersPerStage?: number;
            webgpuMaxTextureDimension2D?: number;
            webgpuMaxUniformBufferBindingSize?: number;
        }

      Returns void