如何使用ClanLib渲染到屏幕外缓冲区

时间:2011-12-26 17:49:37

标签: c++

我想用ClanLib动态修改sprite但是我找不到从CL_Sprite对象中检索CL_GraphicContext的方法。应该怎么做?

1 个答案:

答案 0 :(得分:2)

好的,这可以通过以下方式完成,使用类CL_FrameBufferCL_Texture

CL_FrameBuffer fb(gc);
CL_Texture texture(gc, symbol_width, symbol_height, cl_rgb8);
fb.attach_color_buffer(0, texture);
gc.set_frame_buffer(fb);
gc.clear(CL_Colorf::white);
相关问题