pygame-ce icon indicating copy to clipboard operation
pygame-ce copied to clipboard

Implement `display.gl_get_proc`

Open yunline opened this issue 10 months ago • 2 comments
trafficstars

Trys to fix #3284

Example:

import pygame
import ctypes

win = pygame.Window(opengl=True)

GL_VENDOR = 0x1F00
GL_RENDERER = 0x1F01
GL_VERSION = 0x1F02
GL_EXTENSIONS = 0x1F03

glGetString = pygame.display.gl_get_proc("glGetString")
glGetString.restype = ctypes.c_char_p
glGetString.argtypes = (ctypes.c_int,)
print(glGetString(GL_VENDOR))

# prints b'ATI Technologies Inc.' on my computer

WARNING This PR introduces a new dependency: ctypes

This PR is experimental. If you have better idea, feel free to open another PR.

yunline avatar Jan 08 '25 14:01 yunline