File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed
Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -311,6 +311,21 @@ def info(self) -> GLInfo:
311311 """
312312 return self ._info
313313
314+ @property
315+ def extensions (self ) -> set [str ]:
316+ """
317+ Get a set of supported OpenGL extensions strings for this context.
318+
319+ This can be used to check if a specific extension is supported::
320+
321+ # Check if bindless textures are supported
322+ "GL_ARB_bindless_texture" in ctx.extensions
323+ # Check for multiple extensions
324+ expected_extensions = {"GL_ARB_bindless_texture", "GL_ARB_get_program_binary"}
325+ ctx.extensions & expected_extensions == expected_extensions
326+ """
327+ return gl .gl_info .get_extensions ()
328+
314329 @property
315330 def stats (self ) -> ContextStats :
316331 """
Original file line number Diff line number Diff line change @@ -21,6 +21,11 @@ def test_ctx(ctx):
2121 assert ctx .blend_func == ctx .BLEND_PREMULTIPLIED_ALPHA
2222
2323
24+ def test_extensions (ctx ):
25+ assert isinstance (ctx .extensions , set )
26+ assert len (ctx .extensions ) > 0
27+
28+
2429def test_viewport (ctx ):
2530 vp = 0 , 0 , 100 , 100
2631 ctx .viewport = vp
You can’t perform that action at this time.
0 commit comments