mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 00:32:57 -04:00
GraphicsEngine::get_render_lock()
This commit is contained in:
parent
cfcde491a8
commit
f110a269c8
@ -13,6 +13,20 @@
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: GraphicsEngine::get_render_lock
|
||||
// Access: Published
|
||||
// Description: Returns a ReMutex object that is held by the
|
||||
// GraphicsEngine during the entire call to
|
||||
// render_frame(). While you hold this lock you can be
|
||||
// confident that no part of the frame will be rendered
|
||||
// (at least by the app thread).
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE const ReMutex &GraphicsEngine::
|
||||
get_render_lock() const {
|
||||
return _public_lock;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: GraphicsEngine::set_auto_flip
|
||||
// Access: Published
|
||||
|
@ -645,6 +645,7 @@ get_window(int n) const {
|
||||
void GraphicsEngine::
|
||||
render_frame() {
|
||||
Thread *current_thread = Thread::get_current_thread();
|
||||
ReMutexHolder public_holder(_public_lock);
|
||||
|
||||
// Since this gets called every frame, we should take advantage of
|
||||
// the opportunity to flush the cache if necessary.
|
||||
|
@ -63,6 +63,8 @@ PUBLISHED:
|
||||
void set_threading_model(const GraphicsThreadingModel &threading_model);
|
||||
GraphicsThreadingModel get_threading_model() const;
|
||||
|
||||
INLINE const ReMutex &get_render_lock() const;
|
||||
|
||||
INLINE void set_auto_flip(bool auto_flip);
|
||||
INLINE bool get_auto_flip() const;
|
||||
|
||||
@ -325,6 +327,7 @@ private:
|
||||
bool _singular_warning_this_frame;
|
||||
|
||||
ReMutex _lock;
|
||||
ReMutex _public_lock;
|
||||
|
||||
class LoadedTexture {
|
||||
public:
|
||||
|
Loading…
x
Reference in New Issue
Block a user