Skip to content

Commit

Permalink
Documentation|Cleanup: Canvas, CanvasWindow, et al.
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Mar 11, 2012
1 parent 805d5bf commit 5ad19ed
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions doomsday/engine/portable/include/canvas.h
Expand Up @@ -26,7 +26,9 @@

/**
* Drawing canvas with an OpenGL context and window surface. Each CanvasWindow
* creates one Canvas instance on which to draw.
* creates one Canvas instance on which to draw. Buffer swapping must be done
* manually when appropriate.
*
* @ingroup gl
*/
class Canvas : public QGLWidget
Expand All @@ -40,14 +42,25 @@ class Canvas : public QGLWidget
/**
* Sets a callback function that will be called when the canvas is ready
* for GL initialization. The OpenGL context and drawing surface are not
* ready to be used before that.
* ready to be used before that. The callback will only be called once
* during the lifetime of the Canvas.
*
* @param canvasInitializeFunc Callback.
*/
void setInitCallback(void (*canvasInitializeFunc)(Canvas&));

/**
* Sets a callback function that is responsible for drawing the canvas
* contents when it gets painted. Setting a @c NULL callback will cause the
* canvas to be filled with black.
*
* @param canvasDrawFunc Callback.
*/
void setDrawCallback(void (*canvasDrawFunc)(Canvas&));

/**
* Forces immediate repainting of the canvas. The draw callback gets called.
*/
void forcePaint();

protected:
Expand Down

0 comments on commit 5ad19ed

Please sign in to comment.