9 #ifndef __OGLPLUS_EXAMPLE_EXAMPLE_1119071146_HPP__
10 #define __OGLPLUS_EXAMPLE_EXAMPLE_1119071146_HPP__
21 #pragma warning ( disable : 4244 )
22 #pragma warning ( disable : 4305 )
65 bool HighQuality(
void)
const
71 void setupExample(ExampleParams& params);
112 return _time / 3600.0;
118 return int(
Hours()) % 24;
124 return _time / (24*3600.0);
138 double _start, _past, _real_time, _curr_time, _prev_time, _pace;
152 _prev_time = _curr_time;
153 _real_time = real_time;
154 _curr_time = _past + (_real_time - _start) * _pace;
160 _prev_time = _curr_time;
161 _real_time += seconds;
162 _curr_time = _past + (_real_time - _start) * _pace;
220 assert(!
"Render must be overloaded by examples!");
240 std::unique_ptr<ExampleThread> makeExampleThread(
243 const ExampleParams& params
269 return duration < 3.0;
283 virtual void Reshape(GLuint width, GLuint height) = 0;
292 virtual void MouseMove(GLuint x, GLuint y, GLuint width, GLuint height)
295 (
float(x) - width * 0.5f) / (width * 0.5f),
296 (
float(y) - height* 0.5f) / (height* 0.5f),
304 assert(!
"Render must be overloaded by examples!");
345 std::unique_ptr<Example> makeExample(
const ExampleParams& params);
349 #endif // include guard
int Hour(void) const
The current minute of the period <0-24)
Definition: example.hpp:116
Base class for OGLplus example offscreen rendering threads.
Definition: example.hpp:204
virtual double HeatUpTime(void) const
The screenshot capture heat-up sequence start time.
Definition: example.hpp:339
void Update(double real_time)
Update the clock by providing real time.
Definition: example.hpp:150
virtual void MouseMove(GLuint x, GLuint y, GLuint width, GLuint height)
Mouse move event handler.
Definition: example.hpp:292
char ** argv
the arguments strings
Definition: example.hpp:34
virtual double ScreenshotTime(void) const
The time of the default screenshot.
Definition: example.hpp:321
virtual void Render(double)
Rendering procedure with simple timing.
Definition: example.hpp:218
virtual void Render(ExampleClock &clock)
Rendering procedure with advanced timing.
Definition: example.hpp:308
virtual double RenderPart(unsigned, ExampleClock &clock)
Rendering procedure split into several parts.
Definition: example.hpp:314
double Minutes(void) const
The length of the periods in minutes.
Definition: example.hpp:98
double Hours(void) const
The length of the periods in hours.
Definition: example.hpp:110
int Second(void) const
The current second of the period <0-60)
Definition: example.hpp:92
virtual bool Continue(double duration)
Hint for the main function whether to continue rendering.
Definition: example.hpp:267
virtual void Render(const ExampleClock &clock)
Rendering procedure with advanced timing.
Definition: example.hpp:224
Run-time parameters for example instances.
Definition: example.hpp:28
ExampleTimePeriod RealTime(void) const
Returns the real time elapsed since the start of the example.
Definition: example.hpp:183
virtual void MouseMoveNormalized(float x, float y, float aspect)
Mouse move event handler.
Definition: example.hpp:286
double Days(void) const
The length of the period in days.
Definition: example.hpp:122
virtual void PrepareThread(unsigned, ExampleThread &)
Place to do additional thread-related initialization of example.
Definition: example.hpp:258
int Minute(void) const
The current minute of the period <0-60)
Definition: example.hpp:104
virtual GLuint HeatUpFrames(void) const
The number of heat-up sequence frames.
Definition: example.hpp:333
std::set< unsigned > compat_context_threads
The set of threads for which a compatibility context should be created.
Definition: example.hpp:49
float quality
The quality of rendered image (0.0 = low, 0.5 = default, 1.0 = high)
Definition: example.hpp:37
ExampleTimePeriod Now(void) const
Returns the simulation time elapsed since the start of the example.
Definition: example.hpp:189
A class measuring a time period in the examples.
Definition: example.hpp:74
void Pace(double pace)
Set the pace by which the sim. time advances compared to real-time.
Definition: example.hpp:166
double Seconds(void) const
The length of the periods in seconds.
Definition: example.hpp:86
virtual void Cancel(void)
Notifies the thread that the example is closing.
Definition: example.hpp:215
virtual double RenderPart(unsigned, const ExampleClock &clock)
Rendering procedure split into several parts.
Definition: example.hpp:230
virtual void Reshape(GLuint width, GLuint height)=0
Reshape event handler.
unsigned num_gpus
The number of available GPUs.
Definition: example.hpp:40
Class measuring the simulation time of an Example.
Definition: example.hpp:135
int argc
the number of arguments passed on command-line
Definition: example.hpp:31
virtual double FrameTime(void) const
Single frame time in the screenshot capture sequence.
Definition: example.hpp:327
double Time(void) const
Equivalent to Now().Seconds()
Definition: example.hpp:177
ExampleTimePeriod Interval(void) const
Returns the time elapsed between the last and the previous Update.
Definition: example.hpp:195
void Advance(double seconds)
Advances the clock.
Definition: example.hpp:158
virtual void Render(double)
Rendering procedure with simple timing.
Definition: example.hpp:302
Base class for OGLplus examples.
Definition: example.hpp:247
unsigned num_threads
The number of offscreen rendering threads (not counting the main thread)
Definition: example.hpp:43
unsigned max_threads
The maximum number of threads.
Definition: example.hpp:46
virtual bool Continue(const ExampleClock &clock)
Hint for the main function whether to continue rendering.
Definition: example.hpp:277
int Day(void) const
The current day of the period.
Definition: example.hpp:128