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

OpenGL GetProcAddress function #8589

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

OpenGL GetProcAddress function #8589

wants to merge 1 commit into from

Conversation

bl1nch
Copy link

@bl1nch bl1nch commented Jan 23, 2024

#8457

Maintainer merge checklist

  • Title is descriptive/clear for inclusion in release notes.
  • Applied a Component: xxx label.
  • Applied the api-deprecation or api-break label.
  • Applied the release-highlight label to be highlighted in release notes.
  • Added to the milestone version it was merged into.
  • Unittests are included in PR.
  • Properly documented, including versionadded, versionchanged as needed.

Copy link

welcome bot commented Jan 23, 2024

Thanks for opening your first pull request here! 💖 Please check out our contributing guidelines.

@@ -320,6 +321,9 @@ cdef class _WindowSDL2Storage:
cdef void * p = SDL_GL_GetProcAddress(c_name)
return <intptr_t>p

def reset_gl_context(self):
Copy link
Contributor

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

Copy link
Author

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

@@ -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)
Copy link
Member

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
@bl1nch bl1nch reopened this Feb 2, 2024
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

Successfully merging this pull request may close these issues.

None yet

3 participants