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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Empty file.
7 changes: 7 additions & 0 deletions kivy/graphics/cgl_backend/cgl_sdl2.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,19 @@ include "../common.pxi"
include "../../include/config.pxi"

from kivy.graphics.cgl cimport *
from libc.stdint cimport intptr_t

IF USE_SDL2:
cdef extern from "SDL.h":
void *SDL_GL_GetProcAddress(const char*)


def gl_get_proc_address(name):
cdef char *c_name = name
cdef void * p = SDL_GL_GetProcAddress(c_name)
return <intptr_t>p


cpdef is_backend_supported():
return USE_SDL2

Expand Down
5 changes: 5 additions & 0 deletions kivy/graphics/fbo.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,11 @@ cdef class Fbo(RenderContext):
self.observers.remove(cb)
continue

@property
def gl_id(self):
'''OpenGL id of framebuffer
'''
return self.buffer_id

@property
def size(self):
Expand Down
2 changes: 1 addition & 1 deletion kivy/graphics/instructions.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ from .shader cimport *
from .texture cimport Texture
from kivy._event cimport ObjectWithUid

cdef void reset_gl_context()
cpdef void reset_gl_context()

cdef class Instruction
cdef class InstructionGroup(Instruction)
Expand Down
2 changes: 1 addition & 1 deletion kivy/graphics/instructions.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ cdef int _need_reset_gl = 1
cdef int _active_texture = -1
cdef list canvas_list = []

cdef void reset_gl_context():
cpdef void reset_gl_context():
global _need_reset_gl, _active_texture
_need_reset_gl = 0
_active_texture = 0
Expand Down