I'm currently tweaking some pixel shader code written in C++ of a computer game. I need a way to store a global value (integer or float) in a way that it can be retrieved later (within same process). Since everything seems to be executed "statelessly" in runtime it won't help simply declaring and using a static variable (class variable) as I normally would do in this situation.
Thus I came across the idea of storing my global value to a specific memory address, and get it from there later. My problem is that I have no idea whether this is possible at all and how to do it. I read those questions but didn't find an answer so far:
Create new C++ object at specific memory address?
Pointer to a specific fixed address
Assigning A Specific Memory Address from another program, and changing it's value
Assign a value to a specific address
Is this even possible on Windows Vista or 7, and if so, how? I have no option to include any library but have to achieve anything with the built-in c++ functionality.
If not (or not easily) achievable, are there alternative ways to store some value really globally (not as class variable) such that it can be accessed by other classes/instances within the same process? Maybe some sort of session or application cache like in .NET or Java?
Any help would be appreciated.