mirror of
https://github.com/love2d/love.git
synced 2026-08-20 20:49:54 +02:00
Disabled opengl debug output until it can be improved & made optional
This commit is contained in:
@@ -49,13 +49,14 @@ Font::Font(love::font::Rasterizer *r, const Image::Filter &filter)
|
|||||||
, mSpacing(1)
|
, mSpacing(1)
|
||||||
, filter(filter)
|
, filter(filter)
|
||||||
{
|
{
|
||||||
// try to find the best texture size match for the font size
|
// Try to find the best texture size match for the font size. default to the
|
||||||
// default to the largest texture size if no rough match is found
|
// largest texture size if no rough match is found.
|
||||||
textureSizeIndex = NUM_TEXTURE_SIZES - 1;
|
textureSizeIndex = NUM_TEXTURE_SIZES - 1;
|
||||||
for (int i = 0; i < NUM_TEXTURE_SIZES; i++)
|
for (int i = 0; i < NUM_TEXTURE_SIZES; i++)
|
||||||
{
|
{
|
||||||
// base our chosen texture width/height on a very rough guess of the total size taken up by the font's used glyphs
|
// Make a rough estimate of the total used texture size, based on glyph
|
||||||
// the estimate is likely larger than the actual total size taken up, which is good since texture changes are expensive
|
// height. THe estimated size is likely larger than the actual total
|
||||||
|
// size, which is good because texture changes are expensive.
|
||||||
if ((height * 0.8) * height * 95 <= TEXTURE_WIDTHS[i] * TEXTURE_HEIGHTS[i])
|
if ((height * 0.8) * height * 95 <= TEXTURE_WIDTHS[i] * TEXTURE_HEIGHTS[i])
|
||||||
{
|
{
|
||||||
textureSizeIndex = i;
|
textureSizeIndex = i;
|
||||||
@@ -341,7 +342,8 @@ void Font::print(const std::string &text, float x, float y, float letter_spacing
|
|||||||
|
|
||||||
if (quadindex > 0 && glyphinfolist.size() > 0)
|
if (quadindex > 0 && glyphinfolist.size() > 0)
|
||||||
{
|
{
|
||||||
// sort glyph draw info list by texture first, and quad position in memory second (using the struct's < operator)
|
// Sort glyph draw info list by texture first, and quad position in
|
||||||
|
// memory second (using the struct's < operator).
|
||||||
std::sort(glyphinfolist.begin(), glyphinfolist.end());
|
std::sort(glyphinfolist.begin(), glyphinfolist.end());
|
||||||
|
|
||||||
glEnableClientState(GL_VERTEX_ARRAY);
|
glEnableClientState(GL_VERTEX_ARRAY);
|
||||||
@@ -350,7 +352,8 @@ void Font::print(const std::string &text, float x, float y, float letter_spacing
|
|||||||
glVertexPointer(2, GL_FLOAT, sizeof(vertex), (GLvoid *)&glyphquads[0].vertices[0].x);
|
glVertexPointer(2, GL_FLOAT, sizeof(vertex), (GLvoid *)&glyphquads[0].vertices[0].x);
|
||||||
glTexCoordPointer(2, GL_FLOAT, sizeof(vertex), (GLvoid *)&glyphquads[0].vertices[0].s);
|
glTexCoordPointer(2, GL_FLOAT, sizeof(vertex), (GLvoid *)&glyphquads[0].vertices[0].s);
|
||||||
|
|
||||||
// we need to draw a new vertex array for every section of the string that uses a different texture than the previous section
|
// We need to draw a new vertex array for every section of the string
|
||||||
|
// which uses a different texture than the previous section.
|
||||||
std::vector<GlyphArrayDrawInfo>::const_iterator it;
|
std::vector<GlyphArrayDrawInfo>::const_iterator it;
|
||||||
for (it = glyphinfolist.begin(); it != glyphinfolist.end(); ++it)
|
for (it = glyphinfolist.begin(); it != glyphinfolist.end(); ++it)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -208,10 +208,12 @@ bool Graphics::setMode(int width, int height, WindowFlags *flags)
|
|||||||
glGetIntegerv(GL_MAX_MODELVIEW_STACK_DEPTH, &matrixLimit);
|
glGetIntegerv(GL_MAX_MODELVIEW_STACK_DEPTH, &matrixLimit);
|
||||||
matrixLimit -= 5;
|
matrixLimit -= 5;
|
||||||
|
|
||||||
if (GLEE_ARB_debug_output)
|
// Debug output is temporarily disabled until we either improve it and make
|
||||||
|
// it optional or remove it.
|
||||||
|
if (GLEE_KHR_debug && false)
|
||||||
{
|
{
|
||||||
std::cerr << "debug on" << std::endl;
|
std::cerr << "debug on" << std::endl;
|
||||||
glDebugMessageCallbackARB(myErrorCallback, NULL);
|
glDebugMessageCallback(myErrorCallback, NULL);
|
||||||
glEnable(GL_DEBUG_OUTPUT);
|
glEnable(GL_DEBUG_OUTPUT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user