Is there an easy way, or does anyone have code for retrieving all the OpenGL info to a StringList, Inifile etc. ?
Like php_info() in php
Is there an easy way, or does anyone have code for retrieving all the OpenGL info to a StringList, Inifile etc. ?
Like php_info() in php
Template to expand:
Code:uses dglOpenGL, // https://github.com/SaschaWillems/dglOpenGL Inifiles; procedure glInfoToDisk; var Ini: TCustomIniFile; Path: String; StatusI: GLint; begin // Check if openGL initialized if not assigned(glGetIntegerv) then begin raise Exception.Create('glInfoToDisk: openGL not initialized'); exit; end; // Make folder {$IOChecks off} MkDir('Debug'); {$IOChecks on} // Set path Path:= ExtractFilePath(Application.ExeName)+'\Debug'; // Check path exists if not DirectoryExists(Path) then begin raise Exception.Create('glInfoToDisk: cannot create folder'); exit; end; // Create file Ini := TInifile.Create(Path+'\OpenGLinfo.ini'); try // Total textures available StatusI := -1; glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, @StatusI); Ini.WriteInteger('OpenGLInfo', 'GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS', StatusI); // Texutres available per shader StatusI := -1; glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, @StatusI); Ini.WriteInteger('OpenGLInfo', 'GL_MAX_TEXTURE_IMAGE_UNITS', StatusI); // openGL version Ini.WriteString('OpenGLInfo', 'GL_VERSION', glGetString(GL_VERSION)); finally Ini.Free; end; end;[OpenGLInfo]
GL_MAX_TEXTURE_IMAGE_UNITS=32
GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS=192
Last edited by Thyandyr; 19-10-2017 at 09:03 AM.
There is none as far as I know.Is there an easy way
OpenGL wasn't created. It evolved. Nuff said.
I don't know how easy it is but it is definitely possible. Just check the glCapsViewer that is developed by PGD Member Sascha Willems
https://www.saschawillems.de/?page_id=771
As you can see on the web page this tools was first developed in Delphi but Sascha decided to move to using of C++ instead.
Any way I think he could provide you with best information on how to retrieve this information. Now since lately he isn't visiting PGD so frequently I recommend you get in contact with him though his web page instead.
Also if you haven't already I strongly recommend you check his awesome game Projekt "W"
https://www.saschawillems.de/?page_id=829
Yes Projekt W was created in pascal. But Projekt Weltherrscher - "Phase 2" is much more than just extension of Projekt W. In the beginning it was planed to be just and extension but in ended up being a new game instead. And for short time the game was even more popular than Minecraft at the time. And that it no small feat.
Any way you can read a bit more about it here on the forum:
Projekt W
http://www.pascalgamedevelopment.com/showthread.php?3594-Projekt-quot-W-quot&highlight=project
Projekt Weltherrscher - "Phase 2"
http://www.pascalgamedevelopment.com...t-Phase-2-quot
lol what is this even supposed to mean? Makes zero sense. Of course there's a way to do it (many ways, actually), and none of them are very difficult to implement at all. The dglOpenGL unit actually includes a function that literally just returns all supported extensions in a single string, called "Int_GetExtensionString". For whatever reason though it doesn't have a "forward", pre-implementation-section declaration so it isn't externally visible by default. However, all anyone needs to do to use it is simply copy and paste
anywhere in the file before "implementation" and below the type declarations.Code:function Int_GetExtensionString: AnsiString;
Last edited by Akira13; 23-10-2017 at 03:23 AM.
Last edited by Thyandyr; 23-10-2017 at 08:06 PM.
Bookmarks