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

SOP Questions... #103

Closed
Remusforte opened this issue May 28, 2018 · 0 comments
Closed

SOP Questions... #103

Remusforte opened this issue May 28, 2018 · 0 comments

Comments

@Remusforte
Copy link

Remusforte commented May 28, 2018

This is not an "issue" per se, but I am working on a pygame_sdl2 implementation and have some SOP questions:

First:
Is there a Forum or other place more suited to "questions" like this vs. "code issues"? If so, I'll move this there.

Second:
Please see the following code snip from a sample pygame_sdl2 program elsewhere on github -

`# Allow pygame_sdl2 to be imported as pygame.
import pygame_sdl2
pygame_sdl2.import_as_pygame()

import pygame
import os

...(later)...

def main():
pygame.init()`

My SOP questions are:
(a) Why import pygame when pygame_sdl2 has already been imported? My impression was that pygame_sdl2 was supposed to be a complete replacement for pygame, so doesn't this subsequent import create problems? Or is this necessary because there are actually missing pygame modules in the pygame_sdl2 import package?

(b) That said, I thought the call to "pygame_sdl2.import_as_pygame()" intercepts pygame calls and attempts to do them as pygame_sdl2 instead. So isn't the import pygame line going to effectively result in a duplicate call of import pygame_sdl2?

(c) Later on, the command "pygame.init()" is used, rather than "pygame_sdl2.init()". Why? What is the SOP for which init() to use when (or does it matter)?

Finally, though not shown in this code snip, what is the best way to import pygame locals? Use "from pygame.locals import *" or "from pygame_sdl2.locals import *" or does it matter (given the "import_as..." call up top in the code)?

Thanks!

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

No branches or pull requests

2 participants