mirror of
https://github.com/SFML/SFML.git
synced 2025-01-31 13:45:13 +08:00
Manage memory with higher level constructs
This commit is contained in:
parent
5cf740fd93
commit
13dd9f59cf
@ -500,9 +500,9 @@ JNIEXPORT void ANativeActivity_onCreate(ANativeActivity* activity, void* savedSt
|
||||
|
||||
if (savedState != nullptr)
|
||||
{
|
||||
states->savedState = std::malloc(savedStateSize);
|
||||
states->savedStateSize = savedStateSize;
|
||||
std::memcpy(states->savedState, savedState, savedStateSize);
|
||||
const auto* begin = static_cast<const std::byte*>(savedState);
|
||||
const auto* end = begin + savedStateSize;
|
||||
states->savedState.assign(begin, end);
|
||||
}
|
||||
|
||||
states->mainOver = false;
|
||||
|
@ -39,6 +39,8 @@
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
class SFML_SYSTEM_API LogcatStream : public std::streambuf
|
||||
{
|
||||
public:
|
||||
@ -64,8 +66,7 @@ struct ActivityStates
|
||||
EGLDisplay display{};
|
||||
EglContext* context{};
|
||||
|
||||
void* savedState{};
|
||||
std::size_t savedStateSize{};
|
||||
std::vector<std::byte> savedState;
|
||||
|
||||
std::recursive_mutex mutex;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user