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

Aktuelle Zeit: Do Mär 28, 2024 21:14

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



Ein neues Thema erstellen Auf das Thema antworten  [ 5 Beiträge ] 
Autor Nachricht
 Betreff des Beitrags: dglOpenGL in gDEBugger GL: errors
BeitragVerfasst: Fr Aug 09, 2013 20:09 
Offline
DGL Member

Registriert: Fr Aug 09, 2013 10:54
Beiträge: 3
Programmiersprache: Delphi
There is errors shown by gDEBugger with program using dglOpenGL like "Debug String: Detected error: The debugged process asked for an extension function pointer (glPrimitiveRestartIndex) from one render context, but called this function pointer in another render context (context #1)" (same for glGenBuffers, glBindBuffer etc).

Initialization code
Code:
  1.  
  2. procedure TFormMain.FormCreate(Sender: TObject);
  3. ...
  4. begin
  5.   InitOpenGL; // Don't forget, or first gl-Call will result in an access violation!
  6.   dc := GetDC(Handle);
  7.   hrc := CreateRenderingContext(dc, [opDoubleBuffered], 32, 24, 0, 0, 0, 0);
  8.   ActivateRenderingContext(dc, hrc); // Necessary, will also read some extension
  9.  
  10.   glEnable(GL_TEXTURE_2D);
  11.   glEnable(GL_PRIMITIVE_RESTART);
  12.   glPrimitiveRestartIndex(VERTEX_RESTART_INDEX);
  13.   glEnableClientState(GL_NORMAL_ARRAY);
  14.   glEnableClientState(GL_VERTEX_ARRAY);
  15.   glEnable(GL_DEPTH_TEST);
  16.   glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
  17.  
etc


Nach oben
 Profil  
Mit Zitat antworten  
BeitragVerfasst: Fr Aug 09, 2013 23:10 
Offline
DGL Member
Benutzeravatar

Registriert: Mi Jul 21, 2004 22:39
Beiträge: 360
Wohnort: UK, Scotland
If you only activate one rendering context then its impossible for that to happen. The extensions are loaded after the first call to ActivateRenderingContext. So they will be used by that context until you call it again (Or use wglMakeCurrent).

_________________
Free Map Editor - Game Requirements - Stucuk.Net
-Stu


Nach oben
 Profil  
Mit Zitat antworten  
BeitragVerfasst: Sa Aug 10, 2013 08:45 
Offline
DGL Member

Registriert: Fr Aug 09, 2013 10:54
Beiträge: 3
Programmiersprache: Delphi
Only one context, I see all rendering results. I think (by searching stackoverflow, similar question) those another context from extensions for higher like OpenGL 3.3 functions:
Zitat:
The function pointers you get are based on the current context. That is, it is entirely possible for you to get different function pointers for different OpenGL contexts. gDEBugger is telling you that it has detected that you're using function pointers with a different context from the one used to acquire them. Which is not guaranteed to work.

That being said, it generally will work. It won't work if the two contexts aren't from the same vendor (and probably for the same GPU or SLI/CrossFire GPU setup). But if they are, it should be fine.
http://stackoverflow.com/questions/9663 ... indows-api


Nach oben
 Profil  
Mit Zitat antworten  
BeitragVerfasst: Sa Aug 10, 2013 10:35 
Offline
DGL Member
Benutzeravatar

Registriert: Do Okt 16, 2008 13:18
Beiträge: 252
You are right with your assumption about the contexts. There was a similar question a few weeks ago http://www.delphigl.com/forum/viewtopic.php?f=10&t=10874 (ger). OpenGL needs a special context for 3.x and higher versions which can only be requested by another context with a version less than 3.x. In general the function pointers should work for both contexts. An solution would be, to request all function pointers again from OpenGL (which is otherwise automatically done by the header for the first context) and overwrite all the gl-Functions with the new context specific pointers.

_________________
You even trying ...

Website: http://rise-of-light.de/


Nach oben
 Profil  
Mit Zitat antworten  
BeitragVerfasst: Sa Aug 10, 2013 10:39 
Offline
DGL Member

Registriert: Fr Aug 09, 2013 10:54
Beiträge: 3
Programmiersprache: Delphi
Thanks.


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


Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 13 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.042s | 17 Queries | GZIP : On ]