-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
OpenGL GetProcAddress function #8589
base: master
Are you sure you want to change the base?
Conversation
Thanks for opening your first pull request here! 💖 Please check out our contributing guidelines. |
kivy/core/window/_window_sdl2.pyx
Outdated
@@ -320,6 +321,9 @@ cdef class _WindowSDL2Storage: | |||
cdef void * p = SDL_GL_GetProcAddress(c_name) | |||
return <intptr_t>p | |||
|
|||
def reset_gl_context(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this function?
Why not call the function directly instead of making it like this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean the SDL_GL_GetProcAddress
function or reset_gl_context
?
Anyway SDL_GL_GetProcAddress
returns void pointer so there's no point to call it directly because we need to cast it to intptr_t, and about reset_gl_context
I don't know how to call it directly because it can't be imported from kivy.graphics.instructions
from python
kivy/core/window/_window_sdl2.pyx
Outdated
@@ -314,6 +316,14 @@ cdef class _WindowSDL2Storage: | |||
cdef void set_cursor(self, SDL_Cursor * cursor): | |||
SDL_SetCursor(cursor) | |||
|
|||
def get_proc_address(self, name): | |||
cdef char *c_name = name | |||
cdef void * p = SDL_GL_GetProcAddress(c_name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SDL is not necessarily the GL provider for SDL-backed windows
How about exposing it in kivy.graphics.cgl
?
Make reset_gl_context function callable from python kivy#8457
#8457
Maintainer merge checklist
Component: xxx
label.api-deprecation
orapi-break
label.release-highlight
label to be highlighted in release notes.versionadded
,versionchanged
as needed.