Files |  Tutorials |  Articles |  Links |  Home |  Team |  Forum |  Wiki |  Impressum

Aktuelle Zeit: Do Mär 28, 2024 12:44

Foren-Übersicht » English » English Programming Forum
Unbeantwortete Themen | Aktive Themen



Ein neues Thema erstellen Auf das Thema antworten  [ 8 Beiträge ] 
Autor Nachricht
BeitragVerfasst: Mo Feb 13, 2017 18:59 
Offline
DGL Member

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.

Any ideas?

Thanks!
SpaM


Dateianhänge:
Dateikommentar: Wrong and correct text display
example.png
example.png [ 2.5 KiB | 12744-mal betrachtet ]
Nach oben
 Profil  
Mit Zitat antworten  
BeitragVerfasst: Mo Feb 13, 2017 21:44 
Offline
Ernährungsberater
Benutzeravatar

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?

_________________
Steppity,steppity,step,step,step! :twisted:
❆ ❄ ❄ ❄ ❅ ❄ ❆ ❄ ❅ ❄ ❅ ❄ ❅ ❄ ❄
❄ ❄ ❄ ❅ ❄ ❄ ❄ ❅ ❄ ❄ ❆ ❄ ❄


Nach oben
 Profil  
Mit Zitat antworten  
BeitragVerfasst: Fr Feb 17, 2017 14:08 
Offline
DGL Member

Registriert: So Jan 15, 2017 18:52
Beiträge: 14
Programmiersprache: Delphi
Thank you for tip. I am disabling textures after TextSuite because than I not see other objects. I will take alook on it!


Nach oben
 Profil  
Mit Zitat antworten  
BeitragVerfasst: Mo Feb 20, 2017 07:52 
Offline
DGL Member

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.

It is weird :(


Nach oben
 Profil  
Mit Zitat antworten  
BeitragVerfasst: Mo Feb 20, 2017 15:32 
Offline
DGL Member
Benutzeravatar

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 networkmy 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


Nach oben
 Profil  
Mit Zitat antworten  
BeitragVerfasst: Fr Feb 24, 2017 19:23 
Offline
DGL Member
Benutzeravatar

Registriert: Di Apr 29, 2008 18:56
Beiträge: 1213
Programmiersprache: Delphi/FPC
Hey,

did you enabled blending? You need Additiv Alpha Blending or Normal Alpha Blending:

Code:
  1. glEnable(GL_BLEND);
  2. glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // normal
  3. glBlendFunc(GL_SRC_ALPHA, GL_ONE); // additiv


Greetings Bergmann89

_________________
Aktuelle Projekte: BumpMapGenerator, Massive Universe Online
Auf meiner Homepage gibt auch noch paar Projekte und Infos von mir.


Nach oben
 Profil  
Mit Zitat antworten  
BeitragVerfasst: Do Jun 29, 2017 07:15 
Offline
DGL Member

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.

Any idea what to do?
Thanks!


Nach oben
 Profil  
Mit Zitat antworten  
BeitragVerfasst: Mo Jun 04, 2018 14:03 
Offline
DGL Member

Registriert: Mo Jul 17, 2006 13:16
Beiträge: 69
Any updates concening this issue? I've got the very same problem.

I may refer to:

Another description of this issue:
https://delphigl.com/forum/viewtopic.php?f=2&t=11545&hilit=textsuite+context#p100785

Discussion about DC/RC issue with TextSuite:
https://delphigl.com/forum/viewtopic.php?f=2&t=9458

Earlier Thread about DC/RC issues:
https://delphigl.com/forum/viewtopic.php?f=10&t=11648

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?


Nach oben
 Profil  
Mit Zitat antworten  
Beiträge der letzten Zeit anzeigen:  Sortiere nach  
Ein neues Thema erstellen Auf das Thema antworten  [ 8 Beiträge ] 
Foren-Übersicht » English » English Programming Forum


Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 4 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.

Suche nach:
Gehe zu:  
cron
  Powered by phpBB® Forum Software © phpBB Group
Deutsche Übersetzung durch phpBB.de
[ Time : 0.073s | 19 Queries | GZIP : On ]