Re: Pygame or PyQt which Gui?

2019-12-07 Thread AudioGames . net Forum — Developers room : Turkce_Rap via Audiogames-reflector


  


Re: Pygame or PyQt which Gui?

This topic has inlightent me a lot. Let's go on  non gaming projects.

URL: https://forum.audiogames.net/post/483247/#p483247




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Pygame or PyQt which Gui?

2019-12-06 Thread AudioGames . net Forum — Developers room : keithwipf1 via Audiogames-reflector


  


Re: Pygame or PyQt which Gui?

I think there is a way that you can take WX and run the Event loop whenever you want, without breaking your game loop.I did some simple code that did this.I think it had to do with wx.event or something and the Main loop.

URL: https://forum.audiogames.net/post/48/#p48




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Pygame or PyQt which Gui?

2019-12-06 Thread AudioGames . net Forum — Developers room : Turkce_Rap via Audiogames-reflector


  


Re: Pygame or PyQt which Gui?

This topic has inlightent me a lot. Let's go on  none gaming projects.

URL: https://forum.audiogames.net/post/483247/#p483247




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Pygame or PyQt which Gui?

2019-12-06 Thread AudioGames . net Forum — Developers room : magurp244 via Audiogames-reflector


  


Re: Pygame or PyQt which Gui?

Pygame, Pyglet, wxPython, PyQt, etc. They all have uses outside gaming, it just depends on what you plan on doing. Libraries like PyQt and wxPython though tend to be optimized more towards sharing resources with the system, and for losing context to other programs, whereas Pyglet and Pygame tend to take more control and share less for higher performance or for running continuous simulations. As an example though, for BrushTone I used Pyglet, though in other projects i've used wxPython for a menu widget system and combined it with an OpenGL context from Pyglet into the backend for better image data handling, such as with AudiMesh3D. Neither of those projects required dedicated control for a continuous simulation or high performance, so it didn't really matter if they lost focus.

URL: https://forum.audiogames.net/post/483093/#p483093




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Pygame or PyQt which Gui?

2019-12-06 Thread AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector


  


Re: Pygame or PyQt which Gui?

@3, this is incorrect. WXPython and QT are both accessible; it is the custom elements and widgets that are not. I would however not recommend you use a non-game-specific GUI in your game without a very good reason and before the game loop takes control of the program. After you have handed control to the game loop, you should not use any more non-game-specific GUI functionality (i.e. use SFGUI for SFML over QT). Doing this is not only a bad idea but most likely won't work. This is because non-game-specific GUIs (called standard GUIs, instead of immediate-mode ones) are designed to run on the applications main thread and control the application entirely or nearly so. Using a non-immediate-mode GUI in your main thread will cause extreme harm to your games performance because the game loop will be unable to execute anything. In the game, the entire universe will halt waiting for that GUI loop to terminate, which may never happen; and if or when it does, everything that was queued up during that blocking cycle will execute simultaneously. The execution of the GUI loop also has a very high chance of destabilizing your game loop -- which is never good.To put this into perspective, when your game loop is running, physics, graphics, sound position and 3D calculations, etc., are being executed all in a strict, serialized order. This execution  may happen hundreds of times a second -- this is the frames per second, or FPS, because each execution of that game loop is a frame. If you then run a standard GUI loop in the middle of that game loops execution, the FPS drops to zero and the universe is dead until that loop terminates.Typically, the game loop uses some formula to calculate precisely how long it should wait for the next frame. During this time window, the loop sleeps. As an example, typically I set my FPS to (say) 60, then calculate the number of milliseconds to sleep by dividing 1000 by the number of frames, i.e.:import time
fps = 60
sleep_ticks = int(1000 / fps)
next_game_tick = int(time.time())
sleep_time = 0Then, in my game loop:next_game_tick += skip_ticks
sleep_time = next_game_tick -int( time.time())
if sleep_time>=0:
  time.sleep(sleep_time / 1000)
# game loop goes hereNote that the usage of the time package is discouraged and you should use a far more accurate time measurement system like Pygames clock system. The usage of the time package was purely illustrative.Note that this game loop is only one way of making a game loop. There are various ways of makign one, but this one is constant and there is less difficulty with it, so it is easier to get started with. I strongly encourage you to explore other avenues for game loop code; perhaps you may find a way for game loops and GUI loops to coexist.

URL: https://forum.audiogames.net/post/483089/#p483089




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Pygame or PyQt which Gui?

2019-12-06 Thread AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector


  


Re: Pygame or PyQt which Gui?

@3, this is incorrect. WXPython and QT are both accessible; it is the custom elements and widgets that are not. I would however not recommend you use a non-game-specific GUI in your game without a very good reason and before the game loop takes control of the program. After you have handed control to the game loop, you should not use any more non-game-specific GUI functionality (i.e. SFGUI for SFML). Doing this is not only a bad idea but most likely won't work. This is because non-game-specific GUIs (called standard GUIs, instead of immediate-mode ones) are designed to run on the applications main thread and control the application entirely or nearly so. Using a non-immediate-mode GUI in your main thread will cause extreme harm to your games performance because the game loop will be unable to execute anything. In the game, the entire universe will halt waiting for that GUI loop to terminate, which may never happen; and if or when it does, everything that was queued up during that blocking cycle will execute simultaneously. The execution of the GUI loop also has a very high chance of destabilizing your game loop -- which is never good.To put this into perspective, when your game loop is running, physics, graphics, sound position and 3D calculations, etc., are being executed all in a strict, serialized order. This execution  may happen hundreds of times a second -- this is the frames per second, or FPS, because each execution of that game loop is a frame. If you then run a standard GUI loop in the middle of that game loops execution, the FPS drops to zero and the universe is dead until that loop terminates.Typically, the game loop uses some formula to calculate precisely how long it should wait for the next frame. During this time window, the loop sleeps. As an example, typically I set my FPS to (say) 60, then calculate the number of milliseconds to sleep by dividing 1000 by the number of frames, i.e.:import time
fps = 60
sleep_ticks = int(1000 / fps)
next_game_tick = int(time.time())
sleep_time = 0Then, in my game loop:next_game_tick += skip_ticks
sleep_time = next_game_tick -int( time.time())
if sleep_time>=0:
  time.sleep(sleep_time / 1000)
# game loop goes hereNote that the usage of the time package is discouraged and you should use a far more accurate time measurement system like Pygames clock system. The usage of the time package was purely illustrative.Note that this game loop is only one way of making a game loop. There are various ways of makign one, but this one is constant and there is less difficulty with it, so it is easier to get started with. I strongly encourage you to explore other avenues for game loop code; perhaps you may find a way for game loops and GUI loops to coexist.

URL: https://forum.audiogames.net/post/483089/#p483089




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Pygame or PyQt which Gui?

2019-12-05 Thread AudioGames . net Forum — Developers room : NicklasMCHD via Audiogames-reflector


  


Re: Pygame or PyQt which Gui?

wx python. Pygame was not designed for non-game applications and qt is just inaccessible.

URL: https://forum.audiogames.net/post/483070/#p483070




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Pygame or PyQt which Gui?

2019-12-05 Thread AudioGames . net Forum — Developers room : Hijacker via Audiogames-reflector


  


Re: Pygame or PyQt which Gui?

Usually WX Python if needed, Qt should be fine though.

URL: https://forum.audiogames.net/post/482969/#p482969




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Pygame or PyQt which Gui?

2019-12-05 Thread AudioGames . net Forum — Developers room : Turkce_Rap via Audiogames-reflector


  


Pygame or PyQt which Gui?

What gui do You use for Your none gaming programing projects?

URL: https://forum.audiogames.net/post/482909/#p482909




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector