fix ..\src\slic3r\GUI\Jobs\CreateFontNameImageJob.cpp(100): warning C4101: 'tex_id': unreferenced local variable

This commit is contained in:
Filip Sykala 2022-05-18 15:10:35 +02:00
parent 37961c36e8
commit 8e40501e0e
2 changed files with 8 additions and 4 deletions

View File

@ -97,16 +97,15 @@ void CreateFontImageJob::finalize(bool canceled, std::exception_ptr &)
if (canceled) return; if (canceled) return;
// upload texture on GPU // upload texture on GPU
GLuint tex_id; const GLenum target = GL_TEXTURE_2D;
GLenum target = GL_TEXTURE_2D, format = GL_ALPHA, type = GL_UNSIGNED_BYTE;
GLint level = 0, border = 0;
glsafe(::glBindTexture(target, m_input.texture_id)); glsafe(::glBindTexture(target, m_input.texture_id));
GLint GLint
w = m_tex_size.x(), h = m_tex_size.y(), w = m_tex_size.x(), h = m_tex_size.y(),
xoffset = m_input.size.x() - m_tex_size.x(), // arrange right xoffset = m_input.size.x() - m_tex_size.x(), // arrange right
yoffset = m_input.size.y() * m_input.index; yoffset = m_input.size.y() * m_input.index;
glsafe(::glTexSubImage2D(target, level, xoffset, yoffset, w, h, format, type, m_result.data())); glsafe(::glTexSubImage2D(target, m_input.level, xoffset, yoffset, w, h,
m_input.format, m_input.type, m_result.data()));
// bind default texture // bind default texture
GLuint no_texture_id = 0; GLuint no_texture_id = 0;

View File

@ -21,6 +21,7 @@ struct FontImageData
wxString font_name; wxString font_name;
wxFontEncoding encoding; wxFontEncoding encoding;
// texture for copy result to // texture for copy result to
// texture MUST BE initialized
GLuint texture_id; GLuint texture_id;
// Index of face name, define place in texture // Index of face name, define place in texture
size_t index; size_t index;
@ -31,6 +32,10 @@ struct FontImageData
// bigger value create darker image // bigger value create darker image
// divide value 255 // divide value 255
unsigned char gray_level = 5; unsigned char gray_level = 5;
// texture meta data
GLenum format = GL_ALPHA, type = GL_UNSIGNED_BYTE;
GLint level = 0, border = 0;
}; };
/// <summary> /// <summary>