[Python] Passing ctypes pointer as parameter
Rokas Kupstys via Swig-user <[email protected]> Sun, 5 Jun 2022 19:26:47 +0300
| Newsgroups | gmane.comp.programming.swig |
|---|---|
| Message-ID | <[email protected]> |
Hello,
I am wrapping following function:
> IMGUI_IMPL_API bool ImGui_ImplSDL2_InitForOpenGL(SDL_Window* window,
> void* sdl_gl_context);
And i use wrapped function together with PySDL2 package, which returns
SDL_Window as ctypes pointer. I am unable to figure out how to pass this
pointer as a parameter to wrapped function. I always get following error:
> TypeError: in method 'ImGui_ImplSDL2_InitForOpenGL', argument 1 of
> type 'SDL_Window *'
In my template i have this:
> %apply void* { SDL_Window*, SDL_Event* };
Idea is to just wrap these types as void* and that should be enough, but
its not. I also tried to pass "window.contents.value" as parameter,
which gets a python int with pointer address. That also did not work.
Any idea what else i could try?
Thanks
--
-- Rokas Kupstys