WebGL
Khronos
 

WebGL WEBGL_polygon_mode Extension Specification

Name

WEBGL_polygon_mode

Contact

WebGL working group (public_webgl 'at' khronos.org)

Contributors

Members of the WebGL working group

Version

Last modified date: November 06, 2023
Revision: 2

Number

WebGL extension #53

Dependencies

Written against the WebGL API 1.0 specification.

Overview

This extension exposes the ANGLE_polygon_mode functionality to WebGL.

There are no WebGL-specific behavioral changes.

Consult the above extension for documentation, issues and new functions and enumerants.

Applications should not use this extension to achieve rendering effects, and browsers should discourage use of this extension in non-debug applications, because it is non-portable. For example, browsers should warn about the use of this extension, and/or disable it in non-early-access release channel versions of browsers.

IDL

[Exposed=(Window,Worker), LegacyNoInterfaceObject]
interface WEBGL_polygon_mode {
    const GLenum POLYGON_MODE_WEBGL = 0x0B40;

    const GLenum POLYGON_OFFSET_LINE_WEBGL = 0x2A02;

    const GLenum LINE_WEBGL = 0x1B01;
    const GLenum FILL_WEBGL = 0x1B02;

    undefined polygonModeWEBGL(GLenum face, GLenum mode);
};
  

New Functions

undefined polygonModeWEBGL(GLenum face, GLenum mode)

face must be FRONT_AND_BACK.

mode must be LINE_WEBGL or FILL_WEBGL (default).

New Tokens

undefined enable(GLenum cap)
New enum POLYGON_OFFSET_LINE_WEBGL is accepted as the cap parameter.
undefined disable(GLenum cap)
New enum POLYGON_OFFSET_LINE_WEBGL is accepted as the cap parameter.
GLboolean isEnabled(GLenum cap)
New enum POLYGON_OFFSET_LINE_WEBGL is accepted as the cap parameter.
any getParameter(GLenum pname)

New enums POLYGON_MODE_WEBGL and POLYGON_OFFSET_LINE_WEBGL are accepted as the pname parameter.

The return type of this method depends on the parameter queried:

pnamereturned type
POLYGON_MODE_WEBGLGLenum
POLYGON_OFFSET_LINE_WEBGLGLboolean

Revision History

Revision 1, 2023/06/01

Revision 2, 2023/11/06