- DC:=tbm.canvas.handle;
- InitOpenGL;
- RC := CreateRenderingContext(DC, [opDoubleBuffered,opGDI], GetColorBits, 32, 0, 0, 0, 0);
- ActivateRenderingContext(DC, RC, true);
DGL https://delphigl.com/forum/ |
|
Software OpenGL to hardware OpenGL https://delphigl.com/forum/viewtopic.php?f=19&t=11676 |
Seite 1 von 1 |
Autor: | GL123 [ Mi Jan 16, 2019 01:27 ] |
Betreff des Beitrags: | Software OpenGL to hardware OpenGL |
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:
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. |
Autor: | GL123 [ Mi Jan 16, 2019 02:43 ] |
Betreff des Beitrags: | Re: Software OpenGL to hardware OpenGL |
I also tried using CreateRenderingContextVersion I saw in dglOpengl. But even using v1.1, ie Code:
Gives me the exception "Could not get function pointer address for wglCreateContextAttribsARB - OpenGL 3.x and above not supported" dglopengl line 20,000. |
Autor: | TAK2004 [ Di Jan 22, 2019 16:36 ] |
Betreff des Beitrags: | Re: Software OpenGL to hardware OpenGL |
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. |
Seite 1 von 1 | Alle Zeiten sind UTC + 1 Stunde |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |