MapLibre Native C API
Public C ABI for the MapLibre Native wrapper.
Loading...
Searching...
No Matches
render_target.h File Reference

Go to the source code of this file.

Data Structures

struct  mln_render_target_extent
 
struct  mln_metal_context_descriptor
 
struct  mln_vulkan_context_descriptor
 
struct  mln_webgpu_context_descriptor
 
struct  mln_wgl_context_descriptor
 
struct  mln_egl_context_descriptor
 
struct  mln_webgl_context_descriptor
 
struct  mln_opengl_context_descriptor
 

Typedefs

typedef struct mln_render_target_extent mln_render_target_extent
 
typedef struct mln_metal_context_descriptor mln_metal_context_descriptor
 
typedef struct mln_vulkan_context_descriptor mln_vulkan_context_descriptor
 
typedef struct mln_webgpu_context_descriptor mln_webgpu_context_descriptor
 
typedef enum mln_opengl_context_provider_flag mln_opengl_context_provider_flag
 
typedef enum mln_opengl_context_platform mln_opengl_context_platform
 
typedef enum mln_opengl_context_ownership mln_opengl_context_ownership
 
typedef enum mln_opengl_client_api mln_opengl_client_api
 
typedef struct mln_wgl_context_descriptor mln_wgl_context_descriptor
 
typedef struct mln_egl_context_descriptor mln_egl_context_descriptor
 
typedef struct mln_webgl_context_descriptor mln_webgl_context_descriptor
 
typedef struct mln_opengl_context_descriptor mln_opengl_context_descriptor
 

Enumerations

enum  mln_opengl_context_provider_flag : uint32_t { }
 
enum  mln_opengl_context_platform : uint32_t { MLN_OPENGL_CONTEXT_PLATFORM_UNSPECIFIED = 0u , MLN_OPENGL_CONTEXT_PLATFORM_WGL = 1u , MLN_OPENGL_CONTEXT_PLATFORM_EGL = 2u , MLN_OPENGL_CONTEXT_PLATFORM_WEBGL = 3u }
 
enum  mln_opengl_context_ownership : uint32_t { MLN_OPENGL_CONTEXT_OWNERSHIP_SHARED = 0u , MLN_OPENGL_CONTEXT_OWNERSHIP_DEDICATED = 1u }
 
enum  mln_opengl_client_api : uint32_t { MLN_OPENGL_CLIENT_API_UNSPECIFIED = 0u , MLN_OPENGL_CLIENT_API_GL = 1u , MLN_OPENGL_CLIENT_API_GLES = 2u }
 

Functions

mln_status mln_render_target_extent_physical_size (const mln_render_target_extent *extent, uint32_t *out_width, uint32_t *out_height)
 
uint32_t mln_opengl_supported_context_provider_mask (void)
 

Detailed Description

Shared public C API declarations for render target descriptors.

Typedef Documentation

◆ mln_egl_context_descriptor

typedef struct mln_egl_context_descriptor mln_egl_context_descriptor

EGL context fields shared by OpenGL render targets.

◆ mln_metal_context_descriptor

typedef struct mln_metal_context_descriptor mln_metal_context_descriptor

Metal backend context fields shared by Metal render targets.

◆ mln_opengl_client_api

OpenGL client API a dedicated EGL session creates its context for.

◆ mln_opengl_context_descriptor

typedef struct mln_opengl_context_descriptor mln_opengl_context_descriptor

OpenGL backend context fields shared by OpenGL render targets.

◆ mln_opengl_context_ownership

How a session's OpenGL context relates to the thread that attached it.

A shared session leaves the thread as it found it: every render makes the session context current and restores whatever was current before. The session context joins the host share group named by the descriptor, so a host may hand the session a texture and sample it from its own context.

A dedicated session owns the thread. It makes its context current once and keeps it current between renders, and it joins no share group. Use this when a thread exists to drive one render session and runs no other graphics work, such as an Android host that renders into a SurfaceView.

◆ mln_opengl_context_platform

OpenGL platform context provider used by a context descriptor.

◆ mln_opengl_context_provider_flag

OpenGL context providers supported by this build.

◆ mln_render_target_extent

typedef struct mln_render_target_extent mln_render_target_extent

Logical render target extent in UI pixels.

◆ mln_vulkan_context_descriptor

typedef struct mln_vulkan_context_descriptor mln_vulkan_context_descriptor

Vulkan backend context fields shared by Vulkan render targets.

◆ mln_webgl_context_descriptor

typedef struct mln_webgl_context_descriptor mln_webgl_context_descriptor

WebGL context fields shared by OpenGL render targets in the browser.

◆ mln_webgpu_context_descriptor

typedef struct mln_webgpu_context_descriptor mln_webgpu_context_descriptor

WebGPU backend context fields shared by WebGPU render targets.

◆ mln_wgl_context_descriptor

typedef struct mln_wgl_context_descriptor mln_wgl_context_descriptor

WGL context fields shared by OpenGL render targets on Windows.

Enumeration Type Documentation

◆ mln_opengl_client_api

enum mln_opengl_client_api : uint32_t

OpenGL client API a dedicated EGL session creates its context for.

Enumerator
MLN_OPENGL_CLIENT_API_UNSPECIFIED 

No client API is named.

MLN_OPENGL_CLIENT_API_GL 

Desktop OpenGL, as EGL_OPENGL_API names it.

MLN_OPENGL_CLIENT_API_GLES 

OpenGL ES, as EGL_OPENGL_ES_API names it.

◆ mln_opengl_context_ownership

How a session's OpenGL context relates to the thread that attached it.

A shared session leaves the thread as it found it: every render makes the session context current and restores whatever was current before. The session context joins the host share group named by the descriptor, so a host may hand the session a texture and sample it from its own context.

A dedicated session owns the thread. It makes its context current once and keeps it current between renders, and it joins no share group. Use this when a thread exists to drive one render session and runs no other graphics work, such as an Android host that renders into a SurfaceView.

Enumerator
MLN_OPENGL_CONTEXT_OWNERSHIP_SHARED 

The session shares its thread with host graphics work.

MLN_OPENGL_CONTEXT_OWNERSHIP_DEDICATED 

The session owns its thread's OpenGL context.

◆ mln_opengl_context_platform

enum mln_opengl_context_platform : uint32_t

OpenGL platform context provider used by a context descriptor.

Enumerator
MLN_OPENGL_CONTEXT_PLATFORM_UNSPECIFIED 

No OpenGL context provider is selected.

MLN_OPENGL_CONTEXT_PLATFORM_WEBGL 

Emscripten WebGL context handle.

◆ mln_opengl_context_provider_flag

OpenGL context providers supported by this build.

Enumerator
MLN_OPENGL_CONTEXT_PROVIDER_FLAG_WEBGL 

Browser WebGL context imported into an Emscripten module.

Function Documentation

◆ mln_opengl_supported_context_provider_mask()

uint32_t mln_opengl_supported_context_provider_mask ( void )

Returns OpenGL context providers supported by this build.

◆ mln_render_target_extent_physical_size()

mln_status mln_render_target_extent_physical_size ( const mln_render_target_extent * extent,
uint32_t * out_width,
uint32_t * out_height )

Computes the physical device-pixel size of a logical render target extent.

Each dimension is ceil(logical * scale_factor). Session-owned texture targets and surface targets are sized this way. Caller-owned borrowed texture targets state their physical size directly; see texture.h.

Returns:

  • MLN_STATUS_OK on success.
  • MLN_STATUS_INVALID_ARGUMENT when extent is null or invalid, out_width or out_height is null, or the scaled dimensions are too large.