Conversation
caa8d5d to
ae4f1c3
Compare
caa50b4 to
b4f0e57
Compare
|
Practically same as wopss/RED4ext#94 (comment), would like to have a more proper look over the Present again if something might not be useful to expose, even if it may not be intresting now due to missing structs (already pre-exposed index into monitors structure that is used with HDR and contains curves for various supported modes by the monitor in the ResizeBuffers...) But those are for the next PR, this was supposed to be about API primarily... |
wopss
left a comment
There was a problem hiding this comment.
Thanks for the PR.
I saw some changes that include STL structs, which I would not prefer in the API, since it might be used in other code than C++ or compiled with a different C++ version.
9099004 to
d66f101
Compare
|
Just some update on why nothing gets posted for a bit - I found various issues trying to use this, trying to find some better hooks for initialize/deinitialize or some combination that should be reliable enough. Initialize only does base initialization of devices, not swapchain and some other systems that I had plan to hook. Same for shutdown - is just absolute last step of shutdown as I found out and not shutdown for all systems as I thought at first. Found something already and got a bit sidetracked by it, should hopefully post some updates soon... Also considering swapping the ResizeBackbuffer for some more upper-level function as it may get called twice a frame for no good reason as I found out, leading to some suboptimal things on hooked side. |
d66f101 to
14258bc
Compare
14258bc to
1cd1cd6
Compare
1cd1cd6 to
1934055
Compare
* promote v0 to v1 * swap to references instead of pointers * update `GameState` hooks * update documentation * fix incorrect naming of `IGameState::OnUpdate` to `OnTick` * rename `GameStates::Add` to `AddHook` * split `GameState` hooks to before/after hooks for more granular control and better verbosity * add `EMainReason::Run` for notifying plugins about entry to `CRunningState` * add NOMINMAX preprocessor define * fix incorrect naming of `EGameStateStatus` enum values * fix members of `CGameApplication` * simpler `vendor` exclusion in pre-commit
1934055 to
d9d953e
Compare
|
I just quickly removed changes to SSwapChainData that I left in on accident and noticed just now trying to work on another PR... No other changes done. |
|
Ill try to add something which wraps the newer API, should be doable I believe... Something to emulate v1 via v0 iface. |
| namespace RED4ext | ||
| { | ||
| /** | ||
| * @brief The latest plugin info type. |
There was a problem hiding this comment.
I'd delete "the latest" from all comments.
| */ | ||
| enum class EGameStateResult : uint8_t | ||
| { | ||
| Running, /**< Hook has not yet finished. Until the state changes, hook continues to operate. */ |
There was a problem hiding this comment.
I think this comment is missing the most important part: "Running" prevents game state transition.
| { | ||
| Running, /**< Hook has not yet finished. Until the state changes, hook continues to operate. */ | ||
| Finished, /**< Hook has finished. When signaled, hook is detached. */ | ||
| Observing /**< Hook is observing, not running a task. Hook won't get detached until shutdown. */ |
There was a problem hiding this comment.
Similar to "Running", the most important property of "Observing" is that it doesn't prevent game state transition (while still executing).
| /** | ||
| * @brief Result type for game state hooks. | ||
| */ | ||
| enum class EGameStateResult : uint8_t |
There was a problem hiding this comment.
Proposal: rename it to EGameStateHookResult.
| Observing /**< Hook is observing, not running a task. Hook won't get detached until shutdown. */ | ||
| }; | ||
|
|
||
| struct GameState |
There was a problem hiding this comment.
Proposal: rename it to GameStateHooks.
GameStatehooksIGameState::OnUpdatetoOnTickGameStates::AddtoAddHookGameStatehooks to before/after hooks for more granular control and better verbosityEMainReason::Runfor notifying plugins about entry toCRunningStateEGameStateStatusenum valuesCGameApplicationvendorexclusion in pre-commit