本文整理汇总了C++中operations::texture_image_2d方法的典型用法代码示例。如果您正苦于以下问题:C++ operations::texture_image_2d方法的具体用法?C++ operations::texture_image_2d怎么用?C++ operations::texture_image_2d使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类operations
的用法示例。
在下文中一共展示了operations::texture_image_2d方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
rendered_textures(GLsizei tex_side)
{
for(GLuint i=0; i<2u; ++i)
{
texture_name tex = texs[i];
gl.active_texture(GL.texture0+i);
gl.bind(GL.texture_2d, tex);
gl.texture_min_filter(GL.texture_2d, GL.linear);
gl.texture_mag_filter(GL.texture_2d, GL.linear);
gl.texture_image_2d(
GL.texture_2d,
0,
GL.rgb,
tex_side, tex_side,
0,
GL.rgb,
GL.unsigned_byte,
const_memory_block()
);
renderbuffer_name rbo = rbos[i];
gl.bind(GL.renderbuffer, rbo);
gl.renderbuffer_storage(
GL.renderbuffer,
GL.depth_component,
tex_side, tex_side
);
framebuffer_name fbo = fbos[i];
gl.bind(GL.draw_framebuffer, fbo);
gl.framebuffer_texture_2d(
GL.draw_framebuffer,
GL.color_attachment0,
GL.texture_2d,
tex, 0
);
gl.framebuffer_renderbuffer(
GL.draw_framebuffer,
GL.depth_attachment,
GL.renderbuffer,
rbo
);
gl.viewport(tex_side, tex_side);
gl.clear(GL.color_buffer_bit);
}
gl.bind(GL.draw_framebuffer, default_framebuffer);
gl.bind(GL.renderbuffer, no_renderbuffer);
}
示例2: init
void init(const texture_image_file& image_data)
{
gl.bind(GL.texture_2d, *this);
gl.texture_min_filter(GL.texture_2d, GL.nearest);
gl.texture_mag_filter(GL.texture_2d, GL.nearest);
gl.texture_wrap(
GL.texture_2d,
GL.texture_wrap_s,
GL.repeat
);
gl.texture_image_2d(GL.texture_2d, image_data.spec());
}