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

Help understanding #286

Open
ghost opened this issue Apr 19, 2023 · 0 comments
Open

Help understanding #286

ghost opened this issue Apr 19, 2023 · 0 comments

Comments

@ghost
Copy link

ghost commented Apr 19, 2023

Hi there I'm struggling to understand how to use libepoxy.

If I cat /usr/local/include/epoxy/egl_generated.h

Then I can see lines like this:

#define eglBindAPI epoxy_eglBindAPI
#define eglBindTexImage epoxy_eglBindTexImage
#define eglChooseConfig epoxy_eglChooseConfig
#define eglClientSignalSyncEXT epoxy_eglClientSignalSyncEXT
#define eglClientWaitSync epoxy_eglClientWaitSync
#define eglClientWaitSyncKHR epoxy_eglClientWaitSyncKHR
#define eglClientWaitSyncNV epoxy_eglClientWaitSyncNV
#define eglCompositorBindTexWindowEXT epoxy_eglCompositorBindTexWindowEXT
#define eglCompositorSetContextAttributesEXT epoxy_eglCompositorSetContextAttributesEXT
#define eglCompositorSetContextListEXT epoxy_eglCompositorSetContextListEXT
#define eglCompositorSetSizeEXT epoxy_eglCompositorSetSizeEXT
#define eglCompositorSetWindowAttributesEXT epoxy_eglCompositorSetWindowAttributesEXT
#define eglCompositorSetWindowListEXT epoxy_eglCompositorSetWindowListEXT
#define eglCompositorSwapPolicyEXT epoxy_eglCompositorSwapPolicyEXT
#define eglCopyBuffers epoxy_eglCopyBuffers

Am I mean to be able to directly call these epoxy_ prefixed functions in my code?

Currently in my code I have this sort of thing, but it appears to be duplicating what I can see above?

// epoxy function pointers
PFNEGLDESTROYSTREAMKHRPROC epoxy_eglDestroyStreamKHR;
PFNEGLCREATESTREAMKHRPROC epoxy_eglCreateStreamKHR;
PFNEGLGETSTREAMFILEDESCRIPTORKHRPROC epoxy_eglGetStreamFileDescriptorKHR;
PFNEGLCREATESTREAMFROMFILEDESCRIPTORKHRPROC epoxy_eglCreateStreamFromFileDescriptorKHR;
PFNEGLGETPLATFORMDISPLAYEXTPROC epoxy_eglGetPlatformDisplayEXT;

void load_epoxy_function_pointers() {
    epoxy_eglDestroyStreamKHR = (PFNEGLDESTROYSTREAMKHRPROC) epoxy_eglGetProcAddress("eglDestroyStreamKHR");
    epoxy_eglCreateStreamKHR = (PFNEGLCREATESTREAMKHRPROC) epoxy_eglGetProcAddress("eglCreateStreamKHR");
    epoxy_eglGetPlatformDisplayEXT = (PFNEGLGETPLATFORMDISPLAYEXTPROC) epoxy_eglGetProcAddress("eglGetPlatformDisplayEXT");
    epoxy_eglGetStreamFileDescriptorKHR = (PFNEGLGETSTREAMFILEDESCRIPTORKHRPROC) epoxy_eglGetProcAddress(
            "eglGetStreamFileDescriptorKHR");
    epoxy_eglCreateStreamFromFileDescriptorKHR = (PFNEGLCREATESTREAMFROMFILEDESCRIPTORKHRPROC) epoxy_eglGetProcAddress(
            "eglCreateStreamFromFileDescriptorKHR");
}

What is the "correct" way to set up and use egl extensions with libepoxy? I can't find any examples or documentation in this repository that says.

thanks!

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

0 participants