| 41 | } |
| 42 | |
| 43 | bool GLTextRenderer::initialize() { |
| 44 | if (!text_prog.create(shader::text_vert_shader, |
| 45 | shader::text_frag_shader, |
| 46 | ShaderProgram::TexelChannels::FormatR, |
| 47 | "rgba", |
| 48 | {"mvp", |
| 49 | "buff_sampler", |
| 50 | "text_sampler", |
| 51 | "pix_coord", |
| 52 | "brightness_contrast"})) { |
| 53 | return false; |
| 54 | } |
| 55 | |
| 56 | canvas_.glGenTextures(1, &text_tex); |
| 57 | canvas_.glActiveTexture(GL_TEXTURE0); |
| 58 | canvas_.glBindTexture(GL_TEXTURE_2D, text_tex); |
| 59 | canvas_.glPixelStorei(GL_UNPACK_ALIGNMENT, 1); |
| 60 | canvas_.glGenBuffers(1, &text_vbo); |
| 61 | upload_atlas(); |
| 62 | |
| 63 | return true; |
| 64 | } |
| 65 | |
| 66 | void GLTextRenderer::upload_atlas() { |
| 67 | canvas_.glActiveTexture(GL_TEXTURE0); |
nothing calls this directly
no test coverage detected