Registriert: So Jan 15, 2017 18:52 Beiträge: 14
Programmiersprache: Delphi
Hello,
I have another problem with TextSuite. I tryed to find a problem in my OpenGL code but without luck. Description of the problem: Sometimes when I start application I see background quads instead of text. Quads have color of text. When it happens, I must restart application to repair. So I do not think it is a problem in my code but maybe in TextSuite. Picture is attached.
What bothers me the most is that it only happens sometimes.
Registriert: Sa Jan 01, 2005 17:11 Beiträge: 2067
Programmiersprache: C++
Doesn't look like a problem of the text suite. Please make sure that if you switch a state in OpenGL, you switch back once done with it. It looks like you're disabling texturing. Can you add some debug control or so which will reenable texturing if the problem occures?
Registriert: So Jan 15, 2017 18:52 Beiträge: 14
Programmiersprache: Delphi
Hello,
I take a deep look into TextSuite and all drawings are between glEnable(GL_TEXTURE_2D) and glDisable(GL_TEXTURE_2D). There is no reason why problem happens only sometimes.
Important note: I have several forms and each of them have own drawing code using OpenGL. This problem occur only on one of them. I compared them but no difference at all.
Registriert: Do Sep 02, 2004 19:42 Beiträge: 4158
Programmiersprache: FreePascal, C++
I’m afraid, in this case you’ll need to provide more code, as minimal as possible.
regards, Horazont
_________________ If you find any deadlinks, please send me a notification – Wenn du tote Links findest, sende mir eine Benachrichtigung. current projects: ManiacLab; aioxmpp zombofant network • my photostream „Writing code is like writing poetry“ - source unknown
„Give a man a fish, and you feed him for a day. Teach a man to fish and you feed him for a lifetime. “ ~ A Chinese Proverb
Registriert: So Jan 15, 2017 18:52 Beiträge: 14
Programmiersprache: Delphi
Hello all,
I am back. I thought that I solved this problem but it still appears "sometimes". I hate "sometimes" errors I tryed all the advices posted here on this forum but without luck.
I know how to simulate the problem with about 50% success:
I have three forms. Each have its own OpenGL drawing (I have my own class). First form have never problem with drawing texts. Never! ... Second not have texts but third forum "sometimes" show filled quads instead of texts. When it happens, I must restart the Application. When I start the App, first form is visible. Than I jump to third form and text is ok too! But when I open / close second form and open back third form, I see quads instead of texts.... as I sad "sometimes".
I think it is bug of OpenGL. All drawings go through one code.... but maybe I am wrong.
The DC/RC issues may not contribute to the problem, since I'm able to reproduce the problem without multiple DCs/RCs; I wanted to refer to them "pro forma" since the linked topics with this issue metionened above were (kind of) related to DC/RC issues.
I'm using Bergmann89's object oriented version of LossyX's Textsuite.
As far as I can see, the problem occurs after creating a lot (about > 20) of different fonts. Most interesstingly, i experienced that "Lorem Impsum" was rendered as "___I___" (_ means "Black Box" in this example). As you can see, the "I" (requireing only a very small Texture) can still be renderer, whereas TextSuite failed to create the texture for all other (bigger) Letters.
I can reproduce situations, where working and failed fonts are displayed.
Since the dimensions of each letter seem to to be correct, the problem might be in the TextSuit while reseting the AlphaValue for the Texture for each letter (since the entire "letterbox" is black --> 100% opaque) while the font texture is being created.
After freeing a few fonts and recreating a new one, text can be displayed as usual.
I insist that it's an error while creating the texture for the current font with TextSuite.
So how to solve this? There are multiple threads in this forum, mentioning this issue.
Unfortunately, afaik, there is no way to tell if the font has been created correctly or messed up. glGetError doesn't give any Error, nor do I get an exception from TextSuite.
A possible workaround would be an ErrorDetection-Function, which renders a single ("big") Letter like "X" to a texture. Then copy it to a Bitmap, and if ALL pixels are black, we've got the error, otherwise everything seems fine.
Somebody else got news or other ideas concerning this issue?
Mitglieder in diesem Forum: 0 Mitglieder und 3 Gäste
Du darfst keine neuen Themen in diesem Forum erstellen. Du darfst keine Antworten zu Themen in diesem Forum erstellen. Du darfst deine Beiträge in diesem Forum nicht ändern. Du darfst deine Beiträge in diesem Forum nicht löschen. Du darfst keine Dateianhänge in diesem Forum erstellen.