diff options
author | Thomas Dinges <blender@dingto.org> | 2014-01-24 15:57:19 +0400 |
---|---|---|
committer | Thomas Dinges <blender@dingto.org> | 2014-01-24 15:59:15 +0400 |
commit | 544b7e6be42cda0f07fb83590a089a516bd6cfec (patch) | |
tree | 8a3fe1ca417c9ed04231cc67ea034d326789c38e /intern/cycles/util/util_view.cpp | |
parent | 456dc16e4a191c4cf101e62a22bf91046ed07e06 (diff) |
Cycles Standalone: Add a help message, which appears when pressing the "h" key.
This is very basic for now, but can be extended with more info (available devices for example) later.
Thanks to Bastien and Sergey for some help with the glRect coordinates stuff.
Diffstat (limited to 'intern/cycles/util/util_view.cpp')
-rw-r--r-- | intern/cycles/util/util_view.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/intern/cycles/util/util_view.cpp b/intern/cycles/util/util_view.cpp index 27c8d51149a..1e8db0086f5 100644 --- a/intern/cycles/util/util_view.cpp +++ b/intern/cycles/util/util_view.cpp @@ -74,6 +74,35 @@ void view_display_info(const char *info) glColor3f(1.0f, 1.0f, 1.0f); } +void view_display_help() +{ + const int w = V.width / 1.15; + const int h = V.height / 1.15; + + const int x1 = (V.width - w) / 2; + const int x2 = x1 + w; + + const int y1 = (V.height - h) / 2; + const int y2 = y1 + h; + + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glColor4f(0.4f, 0.4f, 0.4f, 0.8f); + glRectf(x1, y1, x2, y2); + glDisable(GL_BLEND); + + glColor3f(0.8f, 0.8f, 0.8f); + + view_display_text(x1+20, y2-20, "Cycles Renderer"); + view_display_text(x1+20, y2-40, "(C) 2011-2014 Blender Foundation"); + view_display_text(x1+20, y2-80, "Help:"); + view_display_text(x1+20, y2-100, "h: Toggle this help message"); + view_display_text(x1+20, y2-120, "r: Restart the render"); + view_display_text(x1+20, y2-140, "q: Quit the program"); + + glColor3f(1.0f, 1.0f, 1.0f); +} + static void view_display() { if(V.first_display) { |