Fixed blending (for now)
This commit is contained in:
@ -19,82 +19,6 @@ RenderPipeline::RenderPipeline(RenderManager *renderManager) {
|
||||
}
|
||||
|
||||
void RenderPipeline::init() {
|
||||
// FT_Face face;
|
||||
// if(FT_New_Face(ft, "C:\\Windows\\Fonts\\Arial.ttf", 0, &face)) {
|
||||
// std::cout << "ERROR::FREETYPE: Failed to load font" << std::endl;
|
||||
// assertUnreachable();
|
||||
// }
|
||||
// // TESTING FONT
|
||||
// // glGenTextures(1, &texture);
|
||||
// // glBindTexture(GL_TEXTURE_2D, texture);
|
||||
// // glTexImage2D(
|
||||
// // GL_TEXTURE_2D,
|
||||
// // 0,
|
||||
// // GL_RED,
|
||||
// // face->glyph->bitmap.width,
|
||||
// // face->glyph->bitmap.rows,
|
||||
// // 0,
|
||||
// // GL_RED,
|
||||
// // GL_UNSIGNED_BYTE,
|
||||
// // face->glyph->bitmap.buffer
|
||||
// // );
|
||||
// // // set texture options
|
||||
// // glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||
// // glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||
// // glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
// // glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
// Mesh glyphMesh;
|
||||
// FT_Set_Pixel_Sizes(face, 0, 36);
|
||||
// FT_UInt glyph_index = FT_Get_Char_Index(face, 'B');
|
||||
// auto error = FT_Load_Glyph(
|
||||
// face, /* handle to face object */
|
||||
// glyph_index, /* glyph index */
|
||||
// FT_LOAD_DEFAULT ); /* load flags, see below */
|
||||
// if(error) {
|
||||
// std::cout << "Error loading glyph" << std::endl;
|
||||
// assertUnreachable();
|
||||
// }
|
||||
|
||||
// /* convert to an anti-aliased bitmap */
|
||||
// error = FT_Render_Glyph(face->glyph, FT_RENDER_MODE_NORMAL );
|
||||
// if(error) {
|
||||
// std::cout << "Error rendering glyph" << std::endl;
|
||||
// assertUnreachable();
|
||||
// }
|
||||
|
||||
// // Shader
|
||||
// auto shdr = &this->renderManager->simpleTexturedShader->program;
|
||||
// shdr->bind();
|
||||
// shdr->setMatrix(shdr->paramProjection, camera->getProjection());
|
||||
// shdr->setMatrix(shdr->paramView, camera->transform->getWorldTransform());
|
||||
// shdr->setMatrix(shdr->paramModel, glm::mat4(1.0f));
|
||||
// shdr->setColor(shdr->paramColor, COLOR_WHITE);
|
||||
|
||||
// // Texture
|
||||
// Texture texture;
|
||||
// texture.setSize(
|
||||
// face->glyph->bitmap.width,
|
||||
// face->glyph->bitmap.rows,
|
||||
// TEXTURE_FORMAT_R
|
||||
// );
|
||||
// texture.wrapModeX = TEXTURE_WRAP_MODE_CLAMP_TO_EDGE;
|
||||
// texture.wrapModeY = TEXTURE_WRAP_MODE_CLAMP_TO_EDGE;
|
||||
// texture.buffer((uint8_t*)face->glyph->bitmap.buffer);
|
||||
|
||||
// shdr->setBoolean(shdr->paramHasTexture, true);
|
||||
// shdr->setTexture(shdr->paramTexture, 0);
|
||||
// texture.bind(0);
|
||||
|
||||
// this->renderManager->setRenderFlags(RENDER_MANAGER_RENDER_FLAG_DEPTH_TEST | RENDER_MANAGER_RENDER_FLAG_BLEND);
|
||||
|
||||
// auto faceCloneForDebugging = face;
|
||||
// QuadMesh::initQuadMesh(&glyphMesh,
|
||||
// glm::vec2(face->glyph->bitmap.width, face->glyph->bitmap.rows), glm::vec2(1, 0),
|
||||
// glm::vec2(0, 0), glm::vec2(0, 1),
|
||||
// 0.0f
|
||||
// );
|
||||
// glyphMesh.draw(MESH_DRAW_MODE_TRIANGLES, 0, -1);
|
||||
|
||||
this->shaderBuffer.init();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user