panda3d icon indicating copy to clipboard operation
panda3d copied to clipboard

feature suggestion : convert textures to /from pygame

Open tigercoding56 opened this issue 2 years ago • 1 comments

Description

i would like to make a game that internally uses panda3d to render 3d models , but uses pygame for the GUI but i was unable to find any way to convert textures to / from pygame to panda3d

Use Case

basically any use case where someone wants to use these 2 libraries together

tigercoding56 avatar Dec 20 '23 03:12 tigercoding56

I believe the Buffer protocol and/or memoryview, which Panda already supports, is usual used for this kind of thing (sharing data between libraries). However, for textures, you'd have to do copies to and from the CPU, which would slow things down. I don't know the details, but there is a way to get Panda to share/use an existing OpenGL context (e.g., one created by PyGame). From there, you could grab the "native" ID of a Panda Texture to use in PyGame. I'm not sure about getting a texture from PyGame to Panda.

Moguri avatar Dec 20 '23 04:12 Moguri