|
Tissue Forge C++ 0.2.1
Interactive, particle-based physics, chemistry and biology modeling and simulation environment
|
The Simulator is the entry point to simulation, this is the very first object that needs to be initialized before any other method can be called. All the methods of the Simulator are static, but the constructor needs to be called first to initialize everything. More...
#include <tfSimulator.h>


Classes | |
| struct | Config |
| class | GLConfig |
| OpenGL context configuration. More... | |
Public Types | |
| enum | WindowFlags : std::uint16_t { Fullscreen = 1 << 0 , Borderless = 1 << 1 , Resizable = 1 << 2 , Hidden = 1 << 3 , Maximized = 1 << 4 , Minimized = 1 << 5 , AlwaysOnTop = 1 << 6 , AutoIconify = 1 << 7 , Focused = 1 << 8 , Contextless = 1 << 9 } |
| Window flag. More... | |
| enum class | EngineIntegrator : int { FORWARD_EULER = TissueForge::EngineIntegrator::FORWARD_EULER , RUNGE_KUTTA_4 = TissueForge::EngineIntegrator::RUNGE_KUTTA_4 } |
| enum | Key { NONE , WINDOWLESS , GLFW } |
| enum | Options { Windowless = 1 << 0 , glfw = 1 << 1 , GlForwardCompatible = 1 << 2 , GlNoError = 1 << 3 , GlDebug = 1 << 4 , GlStereo = 1 << 5 } |
| enum class | DpiScalingPolicy : std::uint8_t { Virtual = 2 , Physical = 3 , Default = Virtual } |
| enum | Flags { Running = 1 << 0 } |
Public Member Functions | |
| HRESULT | makeCurrent () |
| Make the instance the global simulator object. | |
Static Public Member Functions | |
| static Simulator * | get () |
| static HRESULT | initConfig (const Config &conf, const GLConfig &glConf) |
| static HRESULT | pollEvents () |
| static HRESULT | waitEvents () |
| static HRESULT | waitEventsTimeout (FloatP_t timeout) |
| static HRESULT | postEmptyEvent () |
| static HRESULT | run (FloatP_t et) |
| Runs the event loop until all windows close or simulation time expires. Automatically performs universe time propogation. | |
| static HRESULT | show () |
Shows any windows that were specified in the config. Does not start the universe time propagation unlike run. | |
| static HRESULT | close () |
| Closes the main window, while the application / simulation continues to run. | |
| static HRESULT | destroy () |
| static HRESULT | redraw () |
| static HRESULT | swapInterval (int si) |
| static const int | getNumThreads () |
| static const rendering::GlfwWindow * | getWindow () |
| static HRESULT | throwExceptions (const bool &_throw) |
| static bool | throwingExceptions () |
Public Attributes | |
| int32_t | kind |
| struct rendering::Application * | app |
| std::vector< rendering::GlfwWindow * > | windows |
The Simulator is the entry point to simulation, this is the very first object that needs to be initialized before any other method can be called. All the methods of the Simulator are static, but the constructor needs to be called first to initialize everything.
The Simulator manages all of the operating system interface, it manages window creation, end user input events, GPU access, threading, inter-process messaging and so forth. All 'physical' modeling concepts go in the Universe.
| enum TissueForge::Simulator::WindowFlags : std::uint16_t |
Window flag.
|
static |
gets the global simulator object, returns NULL if fail.
|
static |
Number of threads
| HRESULT TissueForge::Simulator::makeCurrent | ( | ) |
Make the instance the global simulator object.
|
static |
This function processes only those events that are already in the event queue and then returns immediately. Processing events will cause the window and input callbacks associated with those events to be called.
On some platforms, a window move, resize or menu operation will cause event processing to block. This is due to how event processing is designed on those platforms. You can use the window refresh callback to redraw the contents of your window when necessary during such operations.
|
static |
This function posts an empty event from the current thread to the event queue, causing waitEvents or waitEventsTimeout to return.
|
static |
Redraw the scene
|
static |
Runs the event loop until all windows close or simulation time expires. Automatically performs universe time propogation.
| et | period to execute, in units of simulation time; a negative number runs infinitely |
|
static |
This function sets the swap interval for the current OpenGL or OpenGL ES context, i.e. the number of screen updates to wait from the time glfwSwapBuffers was called before swapping the buffers and returning. This is sometimes called vertical synchronization, vertical retrace synchronization or just vsync.
A context that supports either of the WGL_EXT_swap_control_tear and GLX_EXT_swap_control_tear extensions also accepts negative swap intervals, which allows the driver to swap immediately even if a frame arrives a little bit late. You can check for these extensions with glfwExtensionSupported.
A context must be current on the calling thread. Calling this function without a current context will cause a GLFW_NO_CURRENT_CONTEXT error.
This function does not apply to Vulkan. If you are rendering with Vulkan, see the present mode of your swapchain instead.
Parameters [in] interval The minimum number of screen updates to wait for until the buffers are swapped by glfwSwapBuffers. Errors Possible errors include GLFW_NOT_INITIALIZED, GLFW_NO_CURRENT_CONTEXT and GLFW_PLATFORM_ERROR. Remarks This function is not called during context creation, leaving the swap interval set to whatever is the default on that platform. This is done because some swap interval extensions used by GLFW do not allow the swap interval to be reset to zero once it has been set to a non-zero value. Some GPU drivers do not honor the requested swap interval, either because of a user setting that overrides the application's request or due to bugs in the driver.
|
static |
Set whether errors result in exceptions
|
static |
Check whether errors result in exceptions
|
static |
This function puts the calling thread to sleep until at least one event is available in the event queue. Once one or more events are available, it behaves exactly like glfwPollEvents, i.e. the events in the queue are processed and the function then returns immediately. Processing events will cause the window and input callbacks associated with those events to be called.
Since not all events are associated with callbacks, this function may return without a callback having been called even if you are monitoring all callbacks.
On some platforms, a window move, resize or menu operation will cause event processing to block. This is due to how event processing is designed on those platforms. You can use the window refresh callback to redraw the contents of your window when necessary during such operations.
|
static |
This function puts the calling thread to sleep until at least one event is available in the event queue, or until the specified timeout is reached. If one or more events are available, it behaves exactly like pollEvents, i.e. the events in the queue are processed and the function then returns immediately. Processing events will cause the window and input callbacks associated with those events to be called.
The timeout value must be a positive finite number. Since not all events are associated with callbacks, this function may return without a callback having been called even if you are monitoring all callbacks.
On some platforms, a window move, resize or menu operation will cause event processing to block. This is due to how event processing is designed on those platforms. You can use the window refresh callback to redraw the contents of your window when necessary during such operations.