Open perey opened 2 years ago
Specifying attributes (for Config, Context, Display, Image, Surface, and Sync objects) is currently pretty verbose, e.g.
Config
Context
Display
Image
Surface
Sync
cfg.create_pbuffer_surface({SurfaceAttrib.GL_COLORSPACE: GLColorspace.SRGB, SurfaceAttrib.WIDTH: 256, SurfaceAttrib.HEIGHT: 256, SurfaceAttrib.LARGEST_PBUFFER: True})
It should be possible for Pegl to identify the relevant enums and build the attribs dict itself, given just the names. The above example might be rewritten like so:
cfg.create_pbuffer_surface({'GL_COLORSPACE': 'SRGB', 'WIDTH': 256, 'HEIGHT': 256, 'LARGEST_PBUFFER': True})
Other things to consider are:
ALL_CAPS
lower_case
Using keyword arguments, the example might instead look like this:
cfg.create_pbuffer_surface(gl_colorspace='SRGB', width=256, height=256, largest_pbuffer=True)
Specifying attributes (for
Config
,Context
,Display
,Image
,Surface
, andSync
objects) is currently pretty verbose, e.g.It should be possible for Pegl to identify the relevant enums and build the attribs dict itself, given just the names. The above example might be rewritten like so:
Other things to consider are:
ALL_CAPS
? Or accept them inlower_case
, which is more consistent with instance properties?Using keyword arguments, the example might instead look like this: