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

Aktuelle Zeit: Mo Nov 11, 2024 12:37

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



Ein neues Thema erstellen Auf das Thema antworten  [ 3 Beiträge ] 
Autor Nachricht
 Betreff des Beitrags: Software OpenGL to hardware OpenGL
BeitragVerfasst: Mi Jan 16, 2019 01:27 
Offline
DGL Member

Registriert: Mo Jul 08, 2013 05:28
Beiträge: 14
Programmiersprache: Delphi
I want to update some older OpenGL code to use hardware v3+ OpenGL. My current code is OpenGL v1.1 compatible and runs using the Microsoft software OpenGL DLLs.

In my current OpenGL code I replaced the old gl and glu uses calls with dglopengl, but still got v1.1 GLVERSION reported.

For the OpenGL init I use;

Code:
  1. DC:=tbm.canvas.handle;
  2. InitOpenGL;
  3. RC := CreateRenderingContext(DC, [opDoubleBuffered,opGDI], GetColorBits, 32, 0, 0, 0, 0);
  4. ActivateRenderingContext(DC, RC, true);

tbm is a tbitmap32 bitmap. DC is an HDC and RC is an HGLRC.

After those calls I use the usual/same glenable etc calls and draw objects between glbegin and glend pairs. The display works as expected, but it is no faster than using software OpenGL. I added a call to check GLVERSION and it returns 1.1.0?

How can I get the OpenGL code to initialize and use my GPU for faster OpenGL processing and display?

Thanks for any tips.


Nach oben
 Profil  
Mit Zitat antworten  
BeitragVerfasst: Mi Jan 16, 2019 02:43 
Offline
DGL Member

Registriert: Mo Jul 08, 2013 05:28
Beiträge: 14
Programmiersprache: Delphi
I also tried using CreateRenderingContextVersion I saw in dglOpengl. But even using v1.1, ie

Code:
  1.      RC := CreateRenderingContextVersion( DC,                        //DC: HDC
  2.                                           [opDoubleBuffered,opGdi],  //Options: TRCOptions
  3.                                           1,                         //MajorVersion:Integer
  4.                                           1,                         //MinorVersion:Integer
  5.                                           true,                      //ForwardCompatible:boolean
  6.                                           32,                        //Colorbits:Integer
  7.                                           0,                         //Zbits:Integer
  8.                                           0,                         //StencilBits:Integer
  9.                                           0,                         //AccumBits:Integer
  10.                                           0,                         //AuxBuffers:Integer
  11.                                           0);                        //Layer:Integer
  12.  


Gives me the exception "Could not get function pointer address for wglCreateContextAttribsARB - OpenGL 3.x and above not supported" dglopengl line 20,000.


Nach oben
 Profil  
Mit Zitat antworten  
BeitragVerfasst: Di Jan 22, 2019 16:36 
Offline
DGL Member
Benutzeravatar

Registriert: Di Mai 18, 2004 16:45
Beiträge: 2622
Wohnort: Berlin
Programmiersprache: Go, C/C++
Hi GL123,

One issue of the OpenGL3+ API is, that it didn't solved the issue of using an own init function.
You need to create an old context, request the GL3+ init function as a kind of extension and then use this to create a GL3+ context, switch to it and destroy the GL1+ context.
C++ working code
This code comply with the specs and don't raise any warnings on the intel, nv, amd drivers.
NV allowed in the past to create a GL3+ context directly but this was not conform with the spec and didn't worked on AMD, Mesa and Intel which stay strict to specs.

edit:
I missed to mention the OpenGLGetProcAddress function.
You can find it here.
First check with the system specific function then as fallback ask the library.

_________________
"Wer die Freiheit aufgibt um Sicherheit zu gewinnen, der wird am Ende beides verlieren"
Benjamin Franklin

Projekte: https://github.com/tak2004


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


Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 5 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:  
  Powered by phpBB® Forum Software © phpBB Group
Deutsche Übersetzung durch phpBB.de
[ Time : 0.017s | 17 Queries | GZIP : On ]