cgv
Loading...
Searching...
No Matches
callback_drawable.cxx
1#include "callback_drawable.h"
2
3namespace cgv {
4 namespace render {
5
6callback_drawable::callback_drawable(const std::string& name) : node(name)
7{
8}
9void callback_drawable::resize(unsigned w, unsigned h)
10{
11 resize_callback(w, h);
12}
14{
15 return init_callback(ctx);
16}
18{
19 clear_callback(ctx);
20}
22{
23 init_frame_callback(ctx);
24}
26{
27 draw_callback(ctx);
28}
30{
31 finish_draw_callback(ctx);
32}
34{
35 finish_frame_callback(ctx);
36}
38{
39 after_finish_callback(ctx);
40}
41 }
42}
base class for all drawables, which is independent of the used rendering API.
Definition context.h:670
namespace for api independent GPU programming
this header is dependency free
Definition print.h:11
void init_frame(cgv::render::context &ctx)
this method is called in one pass over all drawables before the draw method
void draw(cgv::render::context &ctx)
overload to draw the content of this drawable
void finish_draw(cgv::render::context &ctx)
this method is called when the current drawable is left in a tree traversal that calls the draw metho...
void clear(cgv::render::context &ctx)
clear all objects living in the context like textures or display lists
void after_finish(cgv::render::context &ctx)
this method is called in one pass over all drawables after finish frame
void finish_frame(cgv::render::context &ctx)
this method is called in one pass over all drawables after drawing
bool init(cgv::render::context &ctx)
this method is called after creation or recreation of the context, return whether all necessary funct...