diff options
author | Tavian Barnes <tavianator@gmail.com> | 2009-07-08 17:51:17 +0000 |
---|---|---|
committer | Tavian Barnes <tavianator@gmail.com> | 2009-07-08 17:51:17 +0000 |
commit | 5fa3d9e80212271231dd539867688fb4b74cd62f (patch) | |
tree | cdde92dca8e2a62169c19bf2223769078f581ac4 | |
parent | b749d0c61b0d33324b4f2f0a127f7a2571d9082f (diff) | |
download | dimension-5fa3d9e80212271231dd539867688fb4b74cd62f.tar.xz |
Rename GL_Drawer to GL_Writer for consistency.
-rw-r--r-- | libdimensionxx/dimensionxx/gl.hpp | 14 | ||||
-rw-r--r-- | libdimensionxx/gl.cpp | 22 | ||||
-rw-r--r-- | tests/glxx.cpp | 10 |
3 files changed, 23 insertions, 23 deletions
diff --git a/libdimensionxx/dimensionxx/gl.hpp b/libdimensionxx/dimensionxx/gl.hpp index d52ade5..dcf02f2 100644 --- a/libdimensionxx/dimensionxx/gl.hpp +++ b/libdimensionxx/dimensionxx/gl.hpp @@ -28,21 +28,21 @@ namespace Dimension { - class GL_Drawer + class GL_Writer { public: - GL_Drawer(Canvas& canvas); - ~GL_Drawer(); + GL_Writer(Canvas& canvas); + ~GL_Writer(); - void draw(); + void write(); private: // Copying prohibited - GL_Drawer(const GL_Drawer&); - GL_Drawer& operator=(const GL_Drawer&); + GL_Writer(const GL_Writer&); + GL_Writer& operator=(const GL_Writer&); Canvas* m_canvas; - bool m_drawn; + bool m_written; }; class GL_Reader diff --git a/libdimensionxx/gl.cpp b/libdimensionxx/gl.cpp index aa54aed..7d0c0a3 100644 --- a/libdimensionxx/gl.cpp +++ b/libdimensionxx/gl.cpp @@ -23,36 +23,36 @@ namespace Dimension { - GL_Drawer::GL_Drawer(Canvas& canvas) - : m_canvas(&canvas), m_drawn(false) + GL_Writer::GL_Writer(Canvas& canvas) + : m_canvas(&canvas), m_written(false) { - // Optimize the canvas for GL drawing + // Optimize the canvas for GL writeing dmnsn_gl_optimize_canvas(m_canvas->dmnsn()); } - // Draw the canvas if it hasn't been drawn yet - GL_Drawer::~GL_Drawer() + // Draw the canvas if it hasn't been writen yet + GL_Writer::~GL_Writer() { - if (!m_drawn) { + if (!m_written) { try { - draw(); + write(); } catch (...) { dmnsn_error(SEVERITY_MEDIUM, - "Drawing canvas to GL failed in GL_Drawer destructor."); + "Drawing canvas to GL failed in GL_Writer destructor."); } } } // Draw the canvas to the current openGL buffer - void GL_Drawer::draw() + void GL_Writer::write() { // Draw to the GL buffer if (dmnsn_gl_write_canvas(m_canvas->dmnsn()) != 0) { - // The drawing operation failed + // The writeing operation failed throw Dimension_Error("Drawing canvas to GL failed."); } - m_drawn = true; // Don't draw again in destructor + m_written = true; // Don't write again in destructor } // No-op diff --git a/tests/glxx.cpp b/tests/glxx.cpp index 2515156..b22111f 100644 --- a/tests/glxx.cpp +++ b/tests/glxx.cpp @@ -37,20 +37,20 @@ main() { { Raytracer raytracer(scene); - GL_Drawer drawer(scene.canvas()); + GL_Writer writer(scene.canvas()); // Render the scene Progress progress = raytracer.render_async(); // Display the scene as it's rendered while (progress.progress() < 1.0) { - drawer.draw(); + writer.write(); display.flush(); } // Make sure we show the completed rendering progress.finish(); - drawer.draw(); + writer.write(); display.flush(); } @@ -63,8 +63,8 @@ main() { = reader.read(0, 0, scene.canvas().width(), scene.canvas().height()); // And write it again - GL_Drawer drawer(canvas); - drawer.draw(); + GL_Writer writer(canvas); + writer.write(); display.flush(); // Pause for a second |