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

Aktuelle Zeit: Sa Mai 25, 2024 04:31

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



Ein neues Thema erstellen Auf das Thema antworten  [ 7 Beiträge ] 
Autor Nachricht
BeitragVerfasst: Di Okt 28, 2003 19:46 
Offline
DGL Member
Benutzeravatar

Registriert: Di Jul 01, 2003 18:59
Beiträge: 887
Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
I want to use more then one opengl rendering context at once.
But it does not seem to work.
Only the last one rendered is updated. The first one does not update.
The idea i want is a preview window for a mesh before inserting a new mesh into the scene. Without a preview window everything goes ok. But i cannot get back the rendering context anymore. All rendering goes to the preview window, even after it is closed down.

Has anyone ever used more than one opengl rendering context at once?

_________________
http://3das.noeska.com - create adventure games without programming


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Di Okt 28, 2003 20:02 
Offline
DGL Member
Benutzeravatar

Registriert: Mo Sep 23, 2002 19:27
Beiträge: 5812
Programmiersprache: C++
Using more than one rendering context in the same app shouldn't make any bigger problems if you keep some things in mind.You most likely need two device contexts and two render contexts (two coherrent DC/RC-pairs) and your code should looke something like this :

Code:
  1. // Activate first RC
  2. ActivateRenderingContext(DC1, RC1);
  3. // Render your first scene
  4. SwapBuffers(DC1);
  5. DeActivateRenderingContext;
  6. ...
  7. // Activate second RC
  8. ActivateRenderingContext(DC2, RC2);
  9. // Render your second scene
  10. SwapBuffers(DC2);
  11. DeActivateRenderingContext;


That should work,and don't forget to call wglShareLists(RC1, RC2) if you want to use the same textures and displaylists in both contexts.

_________________
www.SaschaWillems.de | GitHub | Twitter | GPU Datenbanken (Vulkan, GL, GLES)


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mi Okt 29, 2003 19:11 
Offline
DGL Member
Benutzeravatar

Registriert: Di Jul 01, 2003 18:59
Beiträge: 887
Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
thanks. I have a look at that angle. I use a opengl class so my idea is that i already use different dc and rc for different instances of that class. But maybe not.

_________________
http://3das.noeska.com - create adventure games without programming


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Do Okt 30, 2003 00:57 
Offline
Fels i.d. Brandung
Benutzeravatar

Registriert: Sa Mai 04, 2002 19:48
Beiträge: 3827
Wohnort: Tespe (nahe Hamburg)
Also keep in mind that a template for this situation exists on our page. Have a look at the templates ;)

_________________
"Light travels faster than sound. This is why some people appear bright, before you can hear them speak..."


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Do Okt 30, 2003 19:13 
Offline
DGL Member
Benutzeravatar

Registriert: Di Jul 01, 2003 18:59
Beiträge: 887
Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
does the template use a tcustompanel class? I have a look again at the templates.
Also i solved the problem. I forgot to add wglMakeCurrent (dc, hrc); i used it when creating the panel. But when focus has changed to another glpanel i need to call it again.

_________________
http://3das.noeska.com - create adventure games without programming


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Do Okt 30, 2003 20:45 
Offline
Fels i.d. Brandung
Benutzeravatar

Registriert: Sa Mai 04, 2002 19:48
Beiträge: 3827
Wohnort: Tespe (nahe Hamburg)
the type of "window" that is used for rendering is nearly unimportant as long as it has some kind of handle the rc can get use ;)

_________________
"Light travels faster than sound. This is why some people appear bright, before you can hear them speak..."


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Do Okt 30, 2003 22:37 
Offline
DGL Member
Benutzeravatar

Registriert: Di Jul 01, 2003 18:59
Beiträge: 887
Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
i know, i have been optimizing to much.

_________________
http://3das.noeska.com - create adventure games without programming


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


Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 1 Gast


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.009s | 14 Queries | GZIP : On ]