pyglet.config.gl
- class GLSurfaceConfig(
- window: WindowT,
- config: OpenGLUserConfig,
- handle: Any,
A config representing the capabilities of a specific surface.
This is returned by the platform on a specific window and is not meant to be created by users.
- Parameters:
window (
TypeVar(WindowT, bound= BaseWindow)) – The current window or display.config (
OpenGLUserConfig) – The requested user configuration.handle (
Any) – A handle to the underlying configuration unique to each platform.
- create_context(
- opengl_backend: OpenGLBackend,
- share: Any,
- Return type:
OpenGLSurfaceContext
- config: OpenGLUserConfig
- class OpenGLUserConfig(
- double_buffer: bool | None = None,
- stereo: bool | None = None,
- buffer_size: int | None = None,
- aux_buffers: int | None = None,
- sample_buffers: int | None = None,
- samples: int | None = None,
- red_size: int | None = None,
- green_size: int | None = None,
- blue_size: int | None = None,
- alpha_size: int | None = None,
- depth_size: int | None = None,
- stencil_size: int | None = None,
- accum_red_size: int | None = None,
- accum_green_size: int | None = None,
- accum_blue_size: int | None = None,
- accum_alpha_size: int | None = None,
- major_version: int | None = None,
- minor_version: int | None = None,
- forward_compatible: bool | None = None,
- debug: bool | None = None,
- transparent_framebuffer: bool | None = None,
- api: GraphicsAPI = GraphicsAPI.OPENGL,
An OpenGL Graphics configuration.
- accum_alpha_size: int | None = None
Bits per pixel devoted to the alpha component in the accumulation buffer. Deprecated.
- accum_blue_size: int | None = None
Bits per pixel devoted to the blue component in the accumulation buffer. Deprecated.
- accum_green_size: int | None = None
Bits per pixel devoted to the green component in the accumulation buffer. Deprecated.
- accum_red_size: int | None = None
Bits per pixel devoted to the red component in the accumulation buffer. Deprecated.
- api: GraphicsAPI = 'opengl'
Which rendering API is being used (GL, ES, etc.).
- class WebGLUserConfig(
- alpha: bool = False,
- depth: bool | None = None,
- stencil: bool | None = None,
- antialias: bool | None = None,
- premultipliedAlpha: bool | None = None,
- preserveDrawingBuffer: bool | None = None,
- failIfMajorPerformanceCaveat: bool | None = None,
- powerPreference: str | None = None,
- desynchronized: bool | None = None,
A WebGL Graphics configuration.
- property api
- desynchronized: bool | None = None
Hints to reduce latency by desynchronizing canvas painting (default False).
- failIfMajorPerformanceCaveat: bool | None = None
Whether context creation fails if performance is low (default False).
- powerPreference: str | None = None
“default”, “low-power”, or “high-performance” (default “default”).
- Type:
Hints GPU preference
- premultipliedAlpha: bool | None = None
Whether color values are pre-multiplied by alpha (default True).
- get_surface_config(
- user_config: OpenGLUserConfig,
- surface: BaseWindow,
- Return type: