Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EGL/GBM troubles #6

Closed
abandoned-cocoon opened this issue Jun 2, 2017 · 1 comment
Closed

EGL/GBM troubles #6

abandoned-cocoon opened this issue Jun 2, 2017 · 1 comment

Comments

@abandoned-cocoon
Copy link

It seems that

prefix = 'EGL_'
assumed_version = [1,0]
version_prefix = 'EGL_VERSION_EGL_'

in raw/EGL/_types.py gives errors and should be

prefix = as_8_bit('EGL_')
assumed_version = [1,0]
version_prefix = as_8_bit('EGL_VERSION_EGL_')

The other issue is that I cannot call eglGetPlatformDisplayEXT to get a display because it's marked as part of an extension and pyopengl tries to check if the extension is present without specifying a display but my egl implementation (glvnd/mesa) answers with an error.
My workaround right now is

import OpenGL
import OpenGL.platform.egl
OpenGL.platform.PLATFORM = p = OpenGL.platform.egl.EGLPlatform()
from OpenGL.EGL import *
from OpenGL.EGL.EXT.platform_base import *
from OpenGL.EGL.MESA.platform_gbm import *
import ctypes

with open("/dev/dri/renderD128", "w") as f:
	gbm = ctypes.CDLL("libgbm.so")
	dev = gbm.gbm_create_device(f.fileno())

	eglGetPlatformDisplayEXT.extension = None
	oc = p.__class__.constructFunction
	def nc(*args, **kwargs):
		kwargs.update({"force_extension": True})
		return oc(p, *args, **kwargs)

	p.constructFunction = nc
	dpy = eglGetPlatformDisplayEXT(EGL_PLATFORM_GBM_MESA, ctypes.c_void_p(dev), ctypes.c_void_p(0))
	del p.constructFunction
	print(dpy)
mcfletch added a commit that referenced this issue Feb 26, 2018
…tion

This allows particular functions to be marked (by setting extension to
None and force_extension to True in order to do an end-run around the 
extension-checking for the function because the extension checking requires
a current-default-display.
@mcfletch
Copy link
Owner

So I've worked on getting GBM support working relatively well. You can now find tests/os_egl.py in the develop branch which does both GBM and EGL enumeration context setups. I'm going to close the ticket for now, if there are further problems, let me know.

mcfletch added a commit that referenced this issue Jan 4, 2020
* 3e9791f Bump release to 3.1.5
* d06c1ac NUMPY Register intc and uintc as handled scalar types
* 38edb04 WIN FIX GL entry points are NULL on windows initially
* 57b7706 TESTS Run accelerate tests from base tox as well
* 60aec44 BUILD Update cython source with current release
* c26398b TESTS Switch to pytest.mark for skipping numpy handler when not available
* 6ec398d TESTS Switch to assertRaises
* 581d240 TESTS Don't print glget calls, compressed image api call revert
* 8cf737d API More support for using short-string types for convenience
* 1b7c3c3 API In ctypes arrays allow for numpy style short-string type specifiers
* eb9a6b4 FIX Work around weird numpy scalar behaviour (0-dimension arrays)
* d625f8b TESTS reason cannot be passed as a keyword argument in pytest.skip
* f12403b WGL FIX Set the resstyle for getCurrentDC in the wrapper
* 143ecbc GITHUB #7 Use b-strings instead of as_8_bit
* 44a89fe GITIGNORE Ignore .pyd files for Windows develop builds
* a52215f TESTS Fix usage of glCompressedTexImage2D in test_core
* 2f401a0 EGL Allow eglGetDeviceQueryString without display, use to display drm name
* c4cd5d0 BUILD Back out adding python3.8 to the build matrix
* 447fbfa BUILD Continue trying to get sdl to compile
* bdb957b BUILD Add libsdl1.2-dev to get the sld-config utility
* dccbbb6 BUILD Revert attempts to use arm64 (pygame doesn't build) but add python 3.8
* 907ec4a BUILD Experiment with testing on arm64 (loosely related to GH #29)
* 637caf4 TESTS Remove flaky test in favour of more robust one below it
* 144ce85 EGL DEMO Further refactoring of os_egl setup
* a07c956 EGL DEMO Allow for null values in EGL debug table formatting
* 9f115ff EGL Explicitly export EGLError from the EGL namespace
* c58c9c4 EGL Move code to debug, rely on EGLError for display, debug configs
* 93d6f66 EGL DEMO PPM writing and tabular format of configs in EGL debug module
* 9640630 FIX Fix latebind __bool__ definition as __nonzero__ isn't available
* 8628ce1 EGL Allow ErrorCheckers to specify GLError sub-classes, use for EGLError
* 1f1cda4 FORMAT Black formatting for os_egl demo/test script
* 0ed754b FIX for #27 to work on machines where libOpenGL is not present
* 589d3ca EGL Make `eglGetPlatformDisplay` an alternate with `eglGetPlatformDisplayEXT`
* e04bee4 FIX Add on for the fix to #6 to make force_extension functions bool() work
* 2487c21 EGL DEMO Try to create script to query the egl device enumerations
* 41e6f57 EGL DEMO Explicitly delete the DISPLAY environment variable to force offline operation
* 4a40d2b TESTS Ignore the output of osmesa and egl tests
* 3c81386 EGL DEMO Attempt to get an offscreen (pbuffer) render wrapper working
* 8f8d3e8 FIX #27 Load libOpenGL instead of libGL for egl platform
* 4f9cb46 DOCS Add pyrender as a sample source
* d401885 FIX GH #12 Include pxd files in the source-code release
* ca2cbbe DEMO Attempt to recreate github #33 without success
* ce8c5d5 DOCS Update comment to note that we're next to the main checkout now
* f85d8ce DOCS Update tartley projects to github urls, provide first-line links on gh and bb
* e81584a DOCS Skip generation of .xhtml redirect stubs
* 5f206da DEMO provide a running version of code in bug report in #34
* bf3fe7c FIX Explicitly add nonzero methods for base latebind classes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants