Do you know?

Hello! A quick question I'd like to ask.

Does anyone know how RGSS handles Windows messages along with updating the screen graphics?


Thanks!~

I've moved this thread to Learning RGSSx. Thank you.



Please add a meaningful title to your thread next time.
I don't think RGSS handles Windows messages.
I think Windows messages are mostly handled by the RPG maker's exe file(A.K.A "RGSS_Player") itself.
Likely in a standard message loop.
But, as reverse-engineering the exe file is forbidden, I don't know many details.
I don't think RGSS handles Windows messages.
I think Windows messages are mostly handled by the RPG maker's exe file(A.K.A "RGSS_Player") itself.
Likely in a standard message loop.
But, as reverse-engineering the exe file is forbidden, I don't know many details.
If that's true, then how are they (RGSS Player and Ruby) not interfering with each other?
There are 3 components in a normal RPG MAKER game:
A The exe (RGSS_Player)
B, The DLL( All the dark secrets are here)
C, The Ruby Scripts.

The flow is:
First, exe loads functions from DLL while exe itself has very limited knowledge about how to do things about the game.
After DLL is loaded, the exe loads the Script.
But, exe itself does not know how to handle scripts. Thus, exe ask dll to handle the scripts.
DLL contains a Ruby language interpolater which can understand Script and transform them into actual machine language to execute.

But, the exe does have a message loop to handle windows messages just like many common win32 exe. Thus, the exe can, in theory, handle all the windows messages by itself. Thus, when handling those windows messages, the exe does not need to interfere with the script.
(But, from the script side, you can use "WIN32API" to interfere....)

The exe is also responsible to draw everything in its window. But, the flow is a bit backward...
Script says "a = Bitmap.new(....)"
Exe have no idea what that means, so exe asks dll to help exe to understand.
DLL explain to exe what exactly exe needs to do.(Because, DLL has an interpolator )
Exe then knows what to do with the screen.
Thus, exe and script does not directly interfere with each other, the function from DLL is the bridge.

We can do an experiment (Which is totally not reverse engineering)
1, delete dll -> exe will tell you can't find RGSSXXXX.dll
2, delete script -> exe will tell you can't find script (But, it's after it can find dll)
Thus, we know the basic flow...

Original thread: https://forums.rpgmakerweb.com/threads/do-you-know.133977/