Closed ShaunKulesa closed 3 years ago
I found how to do it with pygame, is it possible to use pygame and opengl using your module?
It is technically possible to render to an pygame surface, copy that data into a texture and display it using OpenGL. That is the only way you could display anything from pygame in OpenGL.
@einarf would I have to make a variable that equals the sprite data, then load that variable using opengl? And if so how?
There is an example here using moderngl : https://github.com/moderngl/moderngl-window/blob/820b7d7c6d4faea3cff2637a150c91582096557b/examples/advanced/pygame2_simple.py#L55-L73
You would have to figure out on your own how to use plain opengl functions to write to your own texture and display it.
I did find this texture mapping
def OnInit( self ): """Load the image on initial load of the application""" self.imageID = self.loadImage ()
http://pyopengl.sourceforge.net/context/tutorials/nehe6.html
What technique should i use for adding a sprite image?