OGLplus (0.52.0) a C++ wrapper for OpenGL

synchronization.hpp
Go to the documentation of this file.
1 
12 #pragma once
13 #ifndef OGLPLUS_CONTEXT_SYNCHRONIZATION_1201040722_HPP
14 #define OGLPLUS_CONTEXT_SYNCHRONIZATION_1201040722_HPP
15 
16 #include <oglplus/glfunc.hpp>
18 #include <oglplus/bitfield.hpp>
19 
20 // NOTE: winnt.h apparantly defines this symbol
21 // using the preprocessor. To avoid any sort of
22 // problems here it is necessary to observe correct order
23 // of header includes or you gotta keep 'em separated
24 // (in different translation units)
25 #ifdef MemoryBarrier
26 #undef MemoryBarrier
27 #endif
28 
29 namespace oglplus {
30 namespace context {
31 
33 
37 {
38 public:
39 
40 #if OGLPLUS_DOCUMENTATION_ONLY || GL_VERSION_4_2 || GL_ARB_shader_image_load_store
41 
64  {
65  OGLPLUS_GLFUNC(MemoryBarrier)(GLbitfield(bits));
66  OGLPLUS_VERIFY_SIMPLE(MemoryBarrier);
67  }
68 #endif
69 
71  static void Flush(void)
72  {
73  OGLPLUS_GLFUNC(Flush)();
74  OGLPLUS_VERIFY_SIMPLE(Flush);
75  }
76 
78  static void Finish(void)
79  {
80  OGLPLUS_GLFUNC(Finish)();
81  OGLPLUS_VERIFY_SIMPLE(Finish);
82  }
83 };
84 
85 } // namespace context
86 } // namespace oglplus
87 
88 #endif // include guard
OpenGL bitfield-related helpers.
OpenGL memory barrier bits enumeration.
Wrapper for synchronization operations.
Definition: synchronization.hpp:36
This template serves as a wrapper for OpenGL bitfields.
Definition: bitfield.hpp:56
Helper macro for optional checking of availability of GL function.
static void MemoryBarrier(Bitfield< MemoryBarrierBit > bits)
Defines a barrier for memory transactions.
Definition: synchronization.hpp:63
static void Finish(void)
Force all previous GL commands to complete before returning.
Definition: synchronization.hpp:78
static void Flush(void)
Indicate that all previous GL commands must finish in finite time.
Definition: synchronization.hpp:71

Copyright © 2010-2014 Matúš Chochlík, University of Žilina, Žilina, Slovakia.
<matus.chochlik -at- fri.uniza.sk>
<chochlik -at -gmail.com>
Documentation generated on Mon Sep 22 2014 by Doxygen (version 1.8.6).